Overseer
The Overseer contract is responsible for storing key protocol parameters and the whitelisting of new bAsset collaterals. The borrow limit of users are calculated here, as the Overseer keeps track of locked collateral amounts for all users.
This contract is the recipient for collected bAsset rewards claimed by Custody contracts. The Overseer calculates the amount of depositor subsidies that has to be distributed, and the resulting amount is sent to the Market contract.
The Overseer halts borrow-related operations if the Oracle's price data is older than 60 seconds (price_timeframe
). Operations are resumed when new price data is fed-in.
Config
Key | Type | Description |
| CanonicalAddr | Address of contract owner that can update config |
| CanonicalAddr | Contract address of Oracle |
| CanonicalAddr | Contract address of Market |
| CanonicalAddr | Contract address of Liquidation Contract |
| CanonicalAddr | Contract address of Collector |
| String | Native token denomination for stablecoin |
| u64 | Minimum time delay between epoch operations [blocks] |
| Decimal256 | Threshold per-block deposit rate before triggering interest buffer distribution |
| Decimal256 | Target per-block stablecoin deposit rate of Anchor |
| Decimal256 | Maximum portion of interest buffer that can be distributed in an epoch |
| Decimal256 | Portion of bAsset rewards used to purchase ANC |
| u64 | Window of time before price data is considered outdated [seconds] |
InstantiateMsg
Key | Type | Description |
| String | Address of contract owner that can update config |
| String | Contract address of Oracle |
| String | Contract address of Market |
| String | Contract address of Liquidation Contract |
| String | Contract address of Collector |
| String | Native token denomination for stablecoin |
| u64 | Minimum time delay between epoch operations [blocks] |
| Decimal256 | Threshold per-block deposit rate to trigger interest buffer distribution |
| Decimal256 | Target per-block stablecoin deposit rate of Anchor |
| Decimal256 | Maximum portion of interest buffer that can be distributed in an epoch |
| Decimal256 | Portion of bAsset rewards used to purchase ANC |
| u64 | Window of time before price data is considered outdated [seconds] |
ExecuteMsg
UpdateConfig
UpdateConfig
Updates the configuration of the contract. Can only be issued by the owner.
Key | Type | Description |
| String | Address of new contract owner |
| String | Contract address of new Oracle |
| String | Contract address of new Liquidation Contract |
| Decimal256 | New threshold per-block deposit rate to trigger interest buffer distribution |
| Decimal256 | New target per-block stablecoin deposit rate of Anchor |
| Decimal256 | New maximum portion of interest buffer that can be distributed in an epoch |
| Decimal256 | New portion of bAsset rewards used to purchase ANC |
| u64 | New minimum time delay between epoch operations [blocks] |
| u64 | New window of time before price data is considered outdated [seconds] |
* = optional
Whitelist
Whitelist
Whitelists a new collateral accepted in the money market. Can only be issued by the owner.
Key | Type | Description |
| String | Name of collateral bAsset |
| String | Token symbol of collateral bAsset |
| String | Cw20 token contract address of collateral |
| String | Custody contract address of collateral |
| Decimal256 | Maximum loan-to-value ratio allowed for collateral |
UpdateWhitelist
UpdateWhitelist
Updates information for an already whitelisted collateral. Can only be issued by the owner.
Key | Type | Description |
| String | Cw20 token contract address of collateral |
| String | New Custody contract address of collateral |
| Decimal256 | New maximum loan-to-value ratio allowed for collateral |
* = optional
ExecuteEpochOperations
ExecuteEpochOperations
Executes epoch operations. Distributes interest buffers if necessary, and requests Custody contracts to claim bAsset rewards and distribute depositor subsidies.
Key | Type | Description |
[Internal] UpdateEpochState
[Internal] UpdateEpochState
Updates state related to epoch operations. Can only be issued by Overseer
.
Key | Type | Description |
| Uint256 | Amount of yield reserve left after distributing subsidies |
| Uint256 | Amount of depositor subsidies distributed in this epoch |
LockCollateral
LockCollateral
Locks specified amount of collateral deposited by message sender. Requests Custody contracts to reduce spendable collateral balance.
Key | Type | Description |
| TokensHuman | List of collaterals and their lock amounts |
Key | Type | Description |
| Vec<(String, Uint256)> | Vector of (Collateral token address, Amount to lock) |
UnlockCollateral
UnlockCollateral
Unlocks specified amount of collateral unlocked by message sender. Requests Custody contracts to increase spendable collateral balance.
Key | Type | Description |
| TokensHuman | List of collaterals and their unlock amounts |
Key | Type | Description |
| Vec<(String, Uint256)> | Vector of (Collateral token address, Amount to lock) |
LiquidateCollateral
LiquidateCollateral
Liquidates loan position of the specified borrower. Requests Custody contracts to process collateral liquidation.
Key | Type | Description |
| String | Address of borrower to liquidate loan position |
QueryMsg
Config
Config
Gets the configuration of the Overseer contract.
Key | Type | Description |
ConfigResponse
ConfigResponse
Key | Type | Description |
| String | Address of contract owner |
| String | Contract address of Oracle |
| String | Contract address of Market |
| String | Contract address of Liquidation Contract |
| String | Contract address of Collector |
| Decimal256 | Threshold per-block deposit rate before triggering interest buffer distribution |
| Decimal256 | Target per-block stablecoin deposit rate of Anchor |
| Decimal256 | Maximum portion of interest buffer that can be distributed in an epoch |
| Decimal256 | Portion of bAsset rewards used to purchase ANC |
| String | Native token denomination for stablecoin |
| u64 | Minimum time delay between epoch operations [blocks] |
| u64 | Window of time before price data is considered outdated [seconds] |
EpochState
EpochState
Gets information related to the current epoch.
Key | Type | Description |
EpochStateResponse
EpochStateResponse
Key | Type | Description |
| Decimal256 | Average per-block deposit rate during the last epoch |
| Uint256 | Total aTerra supply at when epoch operations were last executed |
| Decimal256 | aTerra exchange rate when epoch operations were last executed |
| Uint256 | Amount of yield reserves when epoch operations were last executed |
| u64 | Block number when epoch operations were last executed |
Whitelist
Whitelist
Gets information about the specified collateral if the collateral_token
field is filled. Gets information about all collaterals if the collateral_token
field is not filled.
Key | Type | Description |
| String | Cw20 Token address of collateral to query information |
| String | Collateral Cw20 Token address to start query |
| u32 | Maximum number of query entries |
* = optional
WhitelistResponse
WhitelistResponse
Key | Type | Description |
| Vec<WhitelistResponseElem> | Vector of whitelisted collateral information |
Key | Type | Description |
| String | Name of bAsset collateral |
| String | Token symbol of bAsset collateral |
| Decimal256 | Loan-to-value ratio allowed for collateral |
| String | Custody contract address of this collateral |
| String | Cw20 Token contract address of this collateral |
Collaterals
Collaterals
Gets locked collateral information for the specified borrower.
Key | Type | Description |
| String | Address of borrower that locked collateral |
CollateralsResponse
CollateralsResponse
Key | Type | Description |
| String | Address of borrower that locked collateral |
| TokensHuman | List of collaterals and locked amounts |
Key | Type | Description |
| Vec<(String, Uint256)> | Vector of (Collateral token address, Amount locked) |
AllCollaterals
AllCollaterals
Gets locked collateral information for all borrowers.
Key | Type | Description |
| String | Borrower address of start query |
| u32 | Maximum number of query entries |
* = optional
AllCollateralsResponse
AllCollateralsResponse
Key | Type | Description |
| Vec<CollateralsResponse> | List of collaterals and locked amounts |
Key | Type | Description |
| String | Address of user that locked collateral |
| TokensHuman | List of collaterals and locked amounts |
Key | Type | Description |
| Vec<(String, Uint256)> | Vector of (Contract address of collateral token, Locked amount) |
BorrowLimit
BorrowLimit
Gets the borrow limit for the specified borrower. Fails if the oracle price is expired.
Key | Type | Description |
| String | Address of borrower |
| u64 | Current block timestamp |
* = optional
BorrowLimitResponse
BorrowLimitResponse
Key | Type | Description |
| String | Address of borrower |
| Uint256 | Borrow limit of borrower |
Last updated