The protocol defines fixed precision constants:
USD value calculation:
However:
The contract does not call price_feed.decimals()
The contract does not normalize ERC20(token).decimals()
This implicitly assumes:
Oracle price feeds use 8 decimals
Collateral tokens use 18 decimals
If either assumption is violated:
Collateral value becomes miscomputed
Health factor becomes inaccurate
Liquidation eligibility may be incorrectly determined
Mint limits may be exceeded
The solvency model is therefore tightly coupled to implicit precision alignment rather than dynamically enforcing it.
Technical Risk
Collateral valuation depends on fixed scaling factors instead of querying external contract configuration dynamically.
Likelihood: Medium
Reason 1 Adding new collateral tokens (e.g., 6-decimal tokens like USDC)
Reason 2 Integrating price feeds with non-8 decimal precision
Reason 3 Expanding protocol support across chains with different oracle configurations
Impact: Medium
Incorrect collateral valuation may occur if a price feed or collateral token uses non-standard decimals. Since mint limits and liquidation thresholds rely directly on USD valuation, mispricing can distort:
Impact 1 Maximum mintable DSC
Impact 2 Health factor calculation
Impact 3 Liquidation eligibility
This can lead to:
Undercollateralized positions not being liquidated
Safe positions being liquidated incorrectly
Stablecoin supply exceeding intended collateral backing
Because the stablecoin’s solvency model depends entirely on correct valuation, this introduces economic risk.
Deploy two engines:
Engine A → 8-decimal feed
Engine B → 18-decimal feed
With identical human prices.
Engine with incorrect feed precision allows excessive minting.
The protocol should remove implicit precision assumptions and normalize values dynamically.
The issue originates from hardcoded precision constants used inside the USD valuation logic:
This logic assumes:
Feed decimals = 8
Token decimals = 18
Instead, valuation should dynamically normalize both price and token precision.
In get_usd_value(token, amount):
Normalize both price and amount to 18 decimals.
Compute USD value using only 1e18 precision.
Eliminate:
They are no longer required when normalization is dynamic.
The function converting USD → token amount must also normalize feed precision dynamically:
Failing to update both directions will reintroduce precision drift.
To prevent misconfiguration:
1.In get_token_amount_from_usd(token, usd_amount):
Use the same feed_decimals and token_decimals
Invert the normalized formula so both directions remain consistent.
This removes reliance on FEED_PRECISION / ADDITIONAL_FEED_PRECISION and prevents mispricing when adding feeds/tokens with non-default decimals.
The protocol’s solvency model relies on implicit decimal assumptions rather than dynamically enforcing precision consistency.
While current deployment may operate under aligned precision, future integrations or asset expansions could introduce systemic valuation errors.
This warrants Medium severity due to its potential impact on collateral accounting and liquidation correctness.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.