The Liquidation Contract enables users to submit Terra stablecoin bids for a Cw20-compliant token. Bidders can specify the rate of premium they will receive on bid execution, and the maximum premium rate is set at 30%.
Upon execution of a bid, Cw20 tokens are sent to the bidder, while the bidder's Terra stablecoins are sent to the repay address (if not specified, sent to message sender). The oracle contract is responsible for providing the relevant Cw20 token prices.
Additionally, the Liquidation Contract serves as the point of calculation for partial collateral liquidations, where a loan position is liquidated until it reaches a safe borrow_amount / borrow_limit ratio. The required liquidation amount for each collateral is calculated based on the fed-in loan position's attributes.
Price data from the Oracle contract are only valid for 60 seconds (price_timeframe). The Liquidation contract disables bid executions until new price data is fed-in to the Oracle contract.
Address of contract owner that can update config
Contract address of Oracle
Native token denomination for bids
A liability / borrow limit ratio of a loan deemed safe
Fee rate applied to all executed bids
Maximum rate of commission given to bidder of an executed bid
Threshold collateral value for partial collateral liquidations
Window of time before oracle price data is considered outdated [seconds]
Liquidates collateral by executing an existing bid for the received collateral. Requires the liquidator to have an existing bid. For Usage in Anchor, Custody issues this message with fee_address as Overseer's contract address and repay_address as Market's contract address, where stablecoins from the bid is sent to the Market contract to repay a borrower's loan and fees are sent to the Overseer contract to be added to the interest buffer.