Liquidating
Liquidating on CygnusDAO
Last updated
Liquidating on CygnusDAO
Last updated
All borrow positions are public and available through our API.
When a loan reaches 100% debt ratio, it means that anyone on the network can liquidate position and receive a profit for doing so.
Liquidating positions means in essence paying back the user's loan. For example, if a user has borrowed $300 USDC, the lenders at one point in time expect back the $300 + interest. If the user's collateral (LP Tokens) drops in value and reaches a market price close to their current borrowed amount, the position becomes liquidatable. At this point, anyone on the network can repay the loan and receive a bonus for helping keep the vaults healthy.
To incentivize users to liquidate positions there is a liquidation incentive offered to liquidators, which is the profit they earn for liquidating positions. This profit is taken from the borrower's collateral, and can be received in the form of LP tokens or USDC.
Therefore it is important to understand the two liquidation methods available at Cygnus:
Liquidate with USDC (Liquidators earn LP Tokens)
Liquidator repays someone's loan in USDC, sending their own USDC to the pool and receiving back the equivalent of the USDC repaid + the liquidation incentive (2% at the moment) in LP Tokens.
Pros: Low transaction fees and no slippage.
Cons: Liquidator needs sufficient USDC in their wallet.
Flash Liquidating (Liquidators earn USDC)
Liquidator signs the transaction to sell the borrower's collateral (LP Tokens) to the market for USDC and sending the USDC to the vault, keeping the difference (which is the liquidation incentive).
Pros: Liquidators don't need to have any USDC as they are just signing a transaction. Liquidators receive back USDC which some users might prefer.
Cons: Transaction fees can be high depending on network congestion. Liquidators might receive slightly less than the liquidation incentive due to slippage incurred from swapping to USDC.
This option requires the liquidator to have sufficient USDC in their wallets, since the liquidator is essentially repaying the user's loan (all loans in CygnusDAO are in USDC) and receiving back the amount + liquidation bonus in CygLP.
All collaterals in Cygnus are LP Tokens, and each LP is priced before deploying a pool (or else users wouldn't be able to borrow!), so we can also price the CygLP which is the vault token borrowers receive when they deposit LPs:
Borrower's position = CygLP Balance * Exchange Rate * Price = 1 * 1.5 * 10.25 = $15.37
If their loan reaches 100% debt ratio, the liquidator can repay back a certain amount and the contract will seize CygLP from the borrower and transfer it to the liquidator.
Let's say a borrower borrowed 10 USDC from the pool and after a few days their ETH/MATIC LP Token collateral fell in value (maybe because ETH or Matic crashed). Their position now reaches 100% debt ratio and becomes liquidatable. A liquidator now decides to liquidate the loaned amount ($10), and seizes CygLP from the borrower:
Seized CygLP = (Repay Amount / LP Price * (1 + Liquidation Incentive)) / Exchange Rate = (10 / 10.25 * 1.02) / 1.5 = 0.663414634
Redeeming 0.663414634 CygLP for LP, the liquidator would receive 0.995121951 LPs (0.663414634 * Exchange Rate) with a market value of $10.20 (They repaid $10 in USDC and received $10.20 in CygLP, so the profit is $0.2 which is the liquidation incentive of 2%).
This option does not require the liquidator to have any USDC. It works similar to the first option, but it works in the opposite direction. Instead of having to transfer USDC from the liquidator back to the pool, the liquidator signs a transaction to sell the LP collateral to the market for USDC, and uses these funds to repay the loan.
First it seizes collateral, redeems it for LPs, withdraws the LP from the DEX and sells both assets (or more in the case of Balancer where an LP can have many assets) for USDC. It then repays the borrower's loan with the received USDC from the trades, and sends the rest (the incentive) to the liquidator. Using our previous example, a liquidator initializes a flash liquidation of $10:
Router contract seizes the 0.663414634 CygLP from the borrower
Redeems it from the Collateral contract for 0.995121951 LPs (with a market value of $10.20).
The LP is then withdrawn from the dex, receiving the tokens that compose the LP.
Since the Cygnus Router is integrated with dex aggregators, it sells all assets received using the aggregator of choice, receiving $10.20 in USDC.
The lender's pool expects $10 since this is what was seized from the collateral (+ the liquidation incentive). The $10 is transferred from the router back to the lender's pool and the rest is transferred to the liquidator for signing the transaction.
This is the easiest way to liquidate positions, but liquidators might receive a bit less than the liquidation incentive (2% in our example) since to convert the assets to USDC usually involves a DEX trading fee.
Here is an example of the router performing a flash liquidation on Polygon: https://polygonscan.com/tx/0xe963c1960ecb17e10935ecf04cc2fcf178c9697ba6a4aff89b87c789018f1112
The Cygnus Router is integrated with 0xProject, One Inch and Paraswap to perform the all leverage/deleverage/liquidation swaps, minimalizing slippage or trading fees. This means that usually the amount received by the liquidator is very close to the liquidation incentive (2%).
Impermanent loss refers to a "situation in which the profit you gain from staking a token in a liquidity pool is less than what you would have earned just holding the asset" (https://www.ledger.com/academy/glossary/impermanent-loss). In other terms, impermanent loss affects individuals, not the price of the LP. Since the oracle prices the liquidity amount in USDC using the fair reserves mechanism, then assuming that the oracle works correctly, redeeming the LP at any time means that the user would always receive the equivalent of USDC in the underlying LP assets (ie a user redeems 1 LP of eth/matic, which is priced at $2000. After redeeming the liquidity they would receive amounts of eth and matic that if were to be sold to the market would equal $2000).
So impermanent loss does not affect the price of the LP or liquidators. Pricing the liquidity this way greatly simplifies the borrowing and lending experience for all users since we can always expect to receive back exactly what our oracle is pricing the token at!
Parameter | Value |
---|---|
LP Price
$10.25
Exchange Rate (How much LP we receive for 1 CygLP)
1.5
Liquidation Incentive (Profit for liquidators)
2%
Borrower's CygLP Balance
1