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
owner_addr
CanonicalAddr
Address of contract owner that can update config
oracle_contract
CanonicalAddr
Contract address of Oracle
market_contract
CanonicalAddr
Contract address of Market
liquidation_contract
CanonicalAddr
Contract address of Liquidation Contract
collector_contract
CanonicalAddr
Contract address of Collector
stable_denom
String
Native token denomination for stablecoin
epoch_period
u64
Minimum time delay between epoch operations [blocks]
threshold_deposit_rate
Decimal256
Threshold per-block deposit rate before triggering interest buffer distribution
target_deposit_rate
Decimal256
Target per-block stablecoin deposit rate of Anchor
buffer_distribution_factor
Decimal256
Maximum portion of interest buffer that can be distributed in an epoch
anc_purchase_factor
Decimal256
Portion of bAsset rewards used to purchase ANC
price_timeframe
u64
Window of time before price data is considered outdated [seconds]
InstantiateMsg
Key
Type
Description
owner_addr
String
Address of contract owner that can update config
oracle_contract
String
Contract address of Oracle
market_contract
String
Contract address of Market
liquidation_contract
String
Contract address of Liquidation Contract
collector_contract
String
Contract address of Collector
stable_denom
String
Native token denomination for stablecoin
epoch_period
u64
Minimum time delay between epoch operations [blocks]
threshold_deposit_rate
Decimal256
Threshold per-block deposit rate to trigger interest buffer distribution
target_deposit_rate
Decimal256
Target per-block stablecoin deposit rate of Anchor
buffer_distribution_factor
Decimal256
Maximum portion of interest buffer that can be distributed in an epoch
anc_purchase_factor
Decimal256
Portion of bAsset rewards used to purchase ANC
price_timeframe
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
owner_addr
*
String
Address of new contract owner
oracle_contract
*
String
Contract address of new Oracle
liquidation_contract
*
String
Contract address of new Liquidation Contract
threshold_deposit_rate
*
Decimal256
New threshold per-block deposit rate to trigger interest buffer distribution
target_deposit_rate
*
Decimal256
New target per-block stablecoin deposit rate of Anchor
buffer_distribution_factor
*
Decimal256
New maximum portion of interest buffer that can be distributed in an epoch
anc_purchase_factor
*
Decimal256
New portion of bAsset rewards used to purchase ANC
epoch_period
*
u64
New minimum time delay between epoch operations [blocks]
price_timeframe
*
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
name
String
Name of collateral bAsset
symbol
String
Token symbol of collateral bAsset
collateral_token
String
Cw20 token contract address of collateral
custody_contract
String
Custody contract address of collateral
max_ltv
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
collateral_token
String
Cw20 token contract address of collateral
custody_contract
*
String
New Custody contract address of collateral
max_ltv
*
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
interest_buffer
Uint256
Amount of yield reserve left after distributing subsidies
distributed_interest
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
collaterals
TokensHuman
List of collaterals and their lock amounts
Key
Type
Description
TokensHuman
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
collaterals
TokensHuman
List of collaterals and their unlock amounts
Key
Type
Description
TokensHuman
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
borrower
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
owner_addr
String
Address of contract owner
oracle_contract
String
Contract address of Oracle
market_contract
String
Contract address of Market
liquidation_contract
String
Contract address of Liquidation Contract
collector_contract
String
Contract address of Collector
threshold_deposit_rate
Decimal256
Threshold per-block deposit rate before triggering interest buffer distribution
target_deposit_rate
Decimal256
Target per-block stablecoin deposit rate of Anchor
buffer_distribution_factor
Decimal256
Maximum portion of interest buffer that can be distributed in an epoch
anc_purchase_factor
Decimal256
Portion of bAsset rewards used to purchase ANC
stable_denom
String
Native token denomination for stablecoin
epoch_period
u64
Minimum time delay between epoch operations [blocks]
price_timeframe
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
deposit_rate
Decimal256
Average per-block deposit rate during the last epoch
prev_aterra_supply
Uint256
Total aTerra supply at when epoch operations were last executed
prev_exchange_rate
Decimal256
aTerra exchange rate when epoch operations were last executed
prev_interest_buffer
Uint256
Amount of yield reserves when epoch operations were last executed
last_executed_height
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
collateral_token
*
String
Cw20 Token address of collateral to query information
start_after
*
String
Collateral Cw20 Token address to start query
limit
*
u32
Maximum number of query entries
* = optional
WhitelistResponse
WhitelistResponse
Key
Type
Description
elems
Vec<WhitelistResponseElem>
Vector of whitelisted collateral information
Key
Type
Description
name
String
Name of bAsset collateral
symbol
String
Token symbol of bAsset collateral
max_ltv
Decimal256
Loan-to-value ratio allowed for collateral
custody_contract
String
Custody contract address of this collateral
collateral_token
String
Cw20 Token contract address of this collateral
Collaterals
Collaterals
Gets locked collateral information for the specified borrower.
Key
Type
Description
borrower
String
Address of borrower that locked collateral
CollateralsResponse
CollateralsResponse
Key
Type
Description
borrower
String
Address of borrower that locked collateral
collaterals
TokensHuman
List of collaterals and locked amounts
Key
Type
Description
TokensHuman
Vec<(String, Uint256)>
Vector of (Collateral token address, Amount locked)
AllCollaterals
AllCollaterals
Gets locked collateral information for all borrowers.
Key
Type
Description
start_after
*
String
Borrower address of start query
limit
*
u32
Maximum number of query entries
* = optional
AllCollateralsResponse
AllCollateralsResponse
Key
Type
Description
all_collaterals
Vec<CollateralsResponse>
List of collaterals and locked amounts
Key
Type
Description
borrower
String
Address of user that locked collateral
collaterals
TokensHuman
List of collaterals and locked amounts
Key
Type
Description
TokensHuman
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
borrower
String
Address of borrower
block_time
*
u64
Current block timestamp
* = optional
BorrowLimitResponse
BorrowLimitResponse
Key
Type
Description
borrower
String
Address of borrower
borrow_limit
Uint256
Borrow limit of borrower
Last updated
Was this helpful?