Stability Pool
Inspired by Liquity's Stability Pool (https://docs.liquity.org/faq/stability-pool-and-liquidations)
The Stability Pool (SP) is the second line of defense in Positions contract liquidations. It acts as a pool of liquidity that can be used to repay insolvent positions in return for discounted collateral assets. When a position is liquidated, the pool repays its debt in exchange for assets sent by the Positions contract after successful repayments. In contrast to Liquity's pro rata model, this SP is First In First Out when it comes to rewarding liquidations to pool liquidity providers. Due to how the Liquidation Queue calculates liquidations, there will always be something for the SP to liquidate, meaning its advantageous for the first bidder at every liquidation and not just the one's the Liq Queue can't fulfill. This has the added benefit of filtering through spam deposits before large liquidatiosn. Pro-rata distributions, like the Liq Queue and Liquity's SP are better than FIFO at attracting large capital, but FIFO has direct incentives for competitive replenishes which is better for a pool that isn't prioritized but needs quick refills if the situation calls for it. We want this step of the liquidation mechanism to be reactive when low while not taking too much potential capital from the Liq Queue which will likely liquidate collateral for lower premiums a majority of the time, which is better for user solvency.
Key Points:
Any user funds in the Stability Pool will be used to repay said user's positions if liquidated. Meaning depositing in the SP doesn't increase liquidation risk for the user.
Unstaked deposits are still used to liquidate but accrue no incentives.
Withdrawals that would leave less than the minmum deposit amount will withdraw the remaining bid.
InstantiateMsg
Key | Type | Description |
---|---|---|
| AssetPool | Initial Asset Pool for the contract |
| String | Owner of the contract, defaults to info.sender |
| Decimal | Base MBRN incentive rate |
| Uint128 | Maximum MBRN the Pool can mint for incentives |
| Uint128 | Minimum deposit amount |
| String | Osmosis Proxy contract address |
| String | CDP contract |
| String | Oracle contract |
| String | MBRN denom |
* = optional
ExecuteMsg
UpdateConfig
UpdateConfig
Update Config if info.sender is config.owner
Deposit
Deposit
Deposit accepted credit assets to corresponding Asset Pools
Key | Type | Description |
---|---|---|
| String | Address with claim over the deposit(s) |
* = optional
Withdraw
Withdraw
Withdraw caller owned deposits from corresponding Asset Pools
Key | Type | Description |
---|---|---|
| Uint128 | Amount to be withdrawn |
Restake
Restake
Restake unstak(ed/ing) assets
Key | Type | Description |
---|---|---|
| Decimal | Amount to restake |
Liquidate
Liquidate
Use Asset Pool assets to repay for a Position and earn discounted assets
Key | Type | Description |
---|---|---|
| Decimal | Amount to be repaid |
ClaimRewards
ClaimRewards
Claim all discounted assets received from liquidations for the calling address
Distribute
Distribute
Called by the Positions contract. Distributes liquidated funds to the users whose Deposits were used to repay the debt.
Key | Type | Description |
---|---|---|
| Vec<Asset> | Assets to be distributed to users |
| Vec<Decimal> | Ratios of distribution assets |
| Decimal | Redemption price of |
Repay
Repay
Allows the Positions contract to use user funds to repay for themselves
Key | Type | Description |
---|---|---|
| UserInfo | User's Position info |
| Asset | Asset to repay |
QueryMsg
Config
Config
Returns the current Config fields
CheckLiquidatible
CheckLiquidatible
Returns the amount of said asset that isn't liquidatible (i.e. leftover)
Key | Type | Description |
---|---|---|
| Decimal | Amount to check for |
UserClaims
UserClaims
Returns the user
's claimable assets
Key | Type | Description |
---|---|---|
| String | The user whose claims to check |
AssetPool
AssetPool
Returns Asset Pool info
Key | Type | Description |
---|---|---|
| String | User's deposits to return |
| u32 | Deposit limit |
| u32 | Start after Deposit count |
UnclaimedIncentives
UnclaimedIncentives
Returns unclaimed incentives for a user in an AssetPool
Key | Type | Description |
---|---|---|
| String | User address |
CapitalAheadOfDeposit
CapitalAheadOfDeposit
Returns capital ahead of each user Deposit in an AssetPool
Key | Type | Description |
---|---|---|
| String | User address |
Last updated