Al-Qa-qa / dyad-private-audit

4 stars 1 forks source link

Regardes Mitigating Partial Liquidation #10

Open Al-Qa-qa opened 2 weeks ago

Al-Qa-qa commented 2 weeks ago

After further searching about How partial Liquidation is implemented, I found that the way the Liquidate implementation incentivizes Liquidating Position to happen rabidly when the position goes undercollateralized, in famous Stable Coins protocol like MakerDAO.

This is a side info but will is important to know

The theory is that the Liquidity Providers may not Choose to Liquidate bad positions As their CR will decrease if they want to recover the DYAD burned.

let's examine it with some examples.

Now lets say if the address who owns the first position with CR = 2 wanted to liquidate position 2.

Now the liquidator position still has 1000 DYAD, but his address actually contains 500 (as he burned the other 500)

Let's say that this Liquidity Provider wanted to get his DYAD back, and wants to mint new DYADs, but leaving CR == 2.

If he minted 300 DYAD , the position state will be 1300 DYAD minted, 2600$ collaterals, so CR = 2.

He was not able to mint the 500 DYAD he paid again, he just minted 300 DYAD, and his CR goes to 2 again, if he minted again it will decraese.

This is not a problem, as in most cases DYAD will be in market. and anyone can buy 1 DYAD with 1 USD. This theory of StableCoins Liquidation explains why liquidity providers may not liquidate positions.


The design choice of Dyad is that collaterals are transferred to a given position, and for the user to open a position (ID), he should pay an amount of ETH to mint DNft which will express his position.

ofc, they can buy DYAD from the secondary market, instead of minting it again, but it stills makes the process of liquidation only available for liquidity providers which may not do it.

After seeing some protocols, I found that the liquidation process is more advanced that I though, lets take MakerDAO for example, which makes the liquidation as an Auction process, and I found one of the wardens who submitted the issue suggested mitigation. here.


And for the possibility on who can liquidate the bad position, they allow anyone to participate in the process, not just the liquidity providers, MakerDAo DAI liquidation Auction process is incentized to anyone.

Another thing is the FlashMint() feature, which allow any one which do not even have collaterals to get the Stablecoin, which makes liquidating bad positions easier, flash-mint-module.

I do not want to just suggest points without taking action, But the idea is that the position should not stay undercollateralized for too long, as this affects the system in all cases. so the Popular Stable coins make Liquidation process easy and as fast as they can to not leave that positions for a long time, which will mitigate our issue as the CR will not goes below too much.

You can read this issue here: https://www.codehawks.com/report/cljx3b9390009liqwuedkn0m0#H-04


So I think implementing these kind of features to enhance liquidate process is not idea. as the design is simple, and adding all these features is not applicable,.

My thought about the issue, is that it can me mitigated by one of the three things.

Let me know what you think about this, and I apologize for late reply, and by bad English.