# Liquidation Auction Opportunity

## Motivation

You can read about the Acala stablecoin liquidation mechanism [here](https://wiki.acala.network/learn/acala-introduction#liquidation-process). The goal for liquidation is to sell off collateral assets from unsafe vaults and payback outstanding stablecoin debts. The collateral assets are sold on AcalaSwap first, then if unsuccessful, they will be sold on a Collateral Auction. There's usually great arbitrage opportunities to pick up collateral assets at a discount.&#x20;

Arbitragers (auction bidders) profits from participating in the auctions, while help keep the protocol safe.

Below is an example from Acala stablecoin deployed on the Karura Network.

## Recent Event

In recent events, a collateralized debt position (CDP) of 24 thousand KSM for a debt of 6 million kUSD was liquidated. The collateral ratio fell below the required percentage and a liquidation was triggered.  The collateral was sold on the DeX for a 40 percent discount due to the shallow depth of the liquidity pool.  A liquidator Bot could have picked up this opportunity at a better rate for the vault holders before the DeX liquidation occured and capture the discounted price gains.

* [Chain Explorer Details of the Event](https://karura.subscan.io/extrinsic/915526-0?event=915526-18)

![](https://4043836126-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJLxaS3ko9A8anJGwowom%2Fuploads%2FCEBTM1Ilo7hlVXFQG7TQ%2Fimage.png?alt=media\&token=aa57b178-e41e-4aba-8eb8-503b8c5adbeb)

## Participate in an Auction

Anyone can participate in collateral auctions and bid for the collaterals in Acala Dollar.&#x20;

### The Process for Bidders

* You can monitor on-chan events to know when there is an auction
* You can place a bid by sending Acala Dollar to a specific auction
* Once your bid is accepted, your Acala Dollar bid will be transferred from your address to the auction
* If your bid is outbidded by the next bider, then losing bid is refunded back to your address
* If you won the auction, then the corresponding amount of collateral asset will be sent to your account

### Parameters&#x20;

These are important parameters for the auction, and they are under the jurisdiction of governance.&#x20;

* You bid must be at least the `last bid + minimum price increment`&#x20;
* The auction will run for the duration of the `AuctionTimeToClose` if no new bids is placed. However if there is a new bid placed, the auction will be extended for this same period of time.
* `AuctionDurationSoftCap` if an auction passes this period, it will be expedited where `price increment` will be doubled, and `auction time` will be halved.&#x20;

### Monitor Events

* `LiquidateUnsafeCDP`
* `NewCollateralAuction`
* `CollateralAuctionDealt`&#x20;

### Place a bit

&#x20;Use this extrinsics to place a bid

```
auction.bid(id, value)
```

## Liquidation Auction Bot Framework

You could also build a bot to participate in the auctions. Here is an example of a collateral auction bot implementation and a monitoring framework that you are free to use and develop further.

### Strategy

The auction bot employs a very simple and conservative strategy: KSM > LKSM (HODL) > kUSD (mint on the fly) > bid.

* Convert KSM to LKSM and hold it as reserve fund (so that we are earning yield while waiting for the auction opportunity)
* When there is an auction event, use LKSM to mint kUSD on the fly to bid for the collateral assets

You can make your own strategy that suits your profit and risk profiles.

### Reference Code

* [Collateral Auction Bot example](https://github.com/AcalaNetwork/collateral-auction-bot-example)&#x20;
* [Guardian (monitoring/alert framework tool)](https://github.com/AcalaNetwork/collateral-auction-bot-example)
