What can occur is that if there is a rich person with large collaterals in a given position. He can continuously mint and burn DYAD. Making the Price Go Up and Down.
There are no restrictions for minting and burning. You should just keep CR > 150% when minting. So if a Rich person have a lot of collaterals in His Position and has no DYAD minted he can mint a lot of DYAD tokens.
And of course, he can also burn them, no problem.
Minting DYAD will make kerosine price decrease.
Burning DYAD will make kerosine price increase.
This will introduce some Attacks to occur.
Arbitrage trading and gaining profits.
Frontrun users' transactions by either increasing the price of kerosine or decreasing it.
Minting A large amount of DYAD to decrease kerosine prices, this will make positions that depend on kerosine as collateral (endogenous) in an under-collateralization risk.
The number of things that occur from controlling the price is a lot and we just said some of the issues that can occur.
Prood of Concept
We will explain how manipulating the kerosine price will make a profit for the manipulator.
Arbitrage
What can rich people do to make arbitrage trading profits from that issue is:
Burn a lot of DYAD tokens.
Kerosine price increases.
Swap that kerosine to another token (on 3rd party DEX or something).
Mint that DYAD tokens again and they will gain a profit as they made a swap when the kerosine price worth more than its real value.
Liquidating Positions
Mint a lot of DYAD tokens.
Kerosine price decreases.
Some positions, which have endogenous collaterals, go undercollateralized.
Liquidate these positions and gain additional rewards.
Tools Used
Manual Review
Recommended Mitigation Steps
Do not allow burning from a position that is minted short time ago. We can make a MIN_BURN_AMOUNT variable to be 1 day. so the token owner can only burn his tokens if he minted them 1 day ago. This will prevent minting and burning in a short time.
Do not allow minting in a short period of time. This will be like if you minted now, you can only mint tomorrow.
This will not mitigate the issue 100%, but it will reduce its occurrence and impact.
Lines of code
https://github.com/code-423n4/2024-04-dyad/blob/main/src/core/VaultManagerV2.sol#L156-L169 https://github.com/code-423n4/2024-04-dyad/blob/main/src/core/VaultManagerV2.sol#L172-L181
Vulnerability details
Impact
The kerosine price is determined using the
TVL
, and the total Supply of theDYAD
token.Vault.kerosine.unbounded.sol#L60-L65
What can occur is that if there is a rich person with large collaterals in a given position. He can continuously mint and burn
DYAD
. Making the Price Go Up and Down.VaultManagerV2.sol#L156-L181
There are no restrictions for minting and burning. You should just keep CR >
150%
when minting. So if a Rich person have a lot of collaterals in His Position and has noDYAD
minted he can mint a lot ofDYAD
tokens.And of course, he can also burn them, no problem.
DYAD
will makekerosine
price decrease.DYAD
will makekerosine
price increase.This will introduce some Attacks to occur.
kerosine
or decreasing it.DYAD
to decreasekerosine
prices, this will make positions that depend onkerosine
as collateral (endogenous) in an under-collateralization risk.The number of things that occur from controlling the price is a lot and we just said some of the issues that can occur.
Prood of Concept
We will explain how manipulating the
kerosine
price will make a profit for the manipulator.Arbitrage
What can rich people do to make arbitrage trading profits from that issue is:
DYAD
tokens.Kerosine
price increases.kerosine
to another token (on 3rd party DEX or something).DYAD
tokens again and they will gain a profit as they made a swap when thekerosine
price worth more than its real value.Liquidating Positions
DYAD
tokens.Kerosine
price decreases.Tools Used
Manual Review
Recommended Mitigation Steps
Do not allow burning from a position that is minted short time ago. We can make a
MIN_BURN_AMOUNT
variable to be1 day
. so the token owner can only burn his tokens if he minted them1 day
ago. This will prevent minting and burning in a short time.Do not allow minting in a short period of time. This will be like if you minted now, you can only mint tomorrow.
This will not mitigate the issue
100%
, but it will reduce its occurrence and impact.Assessed type
Context