This contract is responsible for storing all information about key guardian contracts. It will also connect to the Exec contract to trigger the unwind strategy when required.
Config
InstantiateMsg
{
"owner_addr": "terra1...", // should be gov contract
"overseer_addr": "terra1...",
"liquidator_fee": 0.01 // same as liquidation queue
}
ExecuteMsg
UpdateConfig
Update configuration
{
"UpdateConfig":
{
"owner_addr": "terra1...", // should be gov contract
"overseer_addr": "terra1...",
"liquidator_fee": 0.01 // same as liquidation queue
}
}
ListGuardian
Whitelist a new guardian that is accepted
Security: This can only be called from owner contract !
This is called from overseer contract if LiquidateCollateral is called and the LTV is to low. It is called before a the liquidation queue is triggered and prevents actual liquidation.
Security: This can only be called from Overseer contract !
{
"borrower": "terra1...", // who
"borrow_amount": "100000000" // amount that need to be repayed
"borrow_limit": "100000000" // amount that collaral need to be
"collaterals" : ["terra1...", "100000000"], // (Cw20 contract address, Locked amount)
["terra1...", "100000000"]
"collateral_prices": [
"123.456789", // Price of collateral
"123.456789"
]
}
DepositGuardian
This is called from the User when he wants to deposit a new guardian to the contract
Not all Guardians will collect external rewards but if they do the user can call this function and receive the amount of rewards that are his for each of the provided Guardian. ( Maybe provide option to just withdraw for one of them.)
List the guardians, if no parameter it returns all. If token is specified to takes just the one. start_after and limit can be used to get just some of them from the list