Custody [bETH]
Last updated
Last updated
The bETH Custody contract is where supplied bETH collaterals are managed. Users can make collateral deposits and withdrawals to and from this contract. The Custody contract is also responsible for claiming bETH rewards and converting them to Terra stablecoins, which is then sent to the Overseer contract for eventual distribution.
Stores information about the bETH Custody contract's config.
Stores information about a borrower.
Receive
Can be called during a CW20 token transfer when the Mint contract is the recipient. Allows the token transfer to execute a Receive Hook as a subsequent action within the same transaction.
UpdateConfig
Updates the configuration of the Custody contract.
* = optional
[Internal] LockCollateral
Locks borrower's collateral to be used in their loan position, decreasing the amount of spendable collateral. Can only be issued by Overseer
.
[Internal] UnlockCollateral
Unlocks borrower's collateral from their loan position, increasing the amount of spendable collateral. Can only be issued by Overseer
.
[Internal] DistributeRewards
Withdraws accrued rewards from the bETH Reward contract, swaps rewards to the appropriate stablecoin denomination (stable_denom
). Can only be issued by Overseer
.
Afterwards, distributes swapped rewards to depositors by sending swapped rewards to Market
. If the deposit rate during the last epoch is above the target deposit rate, then a portion of the rewards are set aside as a yield reserve, which are sent to Overseer
.
[Internal] LiquidateCollateral
Liquidates specified amount of locked collateral. Can only be issued by Overseer
.
WithdrawCollateral
Collaterals have to be first unlocked in the Overseer before they can be withdrawn by the user.
Withdraws specified amount of spendable collateral. Withdraws all spendable collateral if the amount
field is not filled.
* = optional
DepositCollateral
Deposited collaterals have to be locked in the Overseer before they can be utilized in a loan position.
Deposits collateral. Issued when a user sends bAsset tokens to the Custody contract.
Config
Gets the contract configuration of the Custody contract.
Borrower
Gets the collateral balance of the specified borrower.
Borrowers
Get the collateral balance of all borrowers.
Key
Type
Description
owner
CanonicalAddr
Address of contract owner
collateral_token
CanonicalAddr
Contract address of bETH Token
overseer_contract
CanonicalAddr
Contract address of Overseer
market_contract
CanonicalAddr
Contract address of Market
reward_contract
CanonicalAddr
Contract address of bETH Reward
liquidation_contract
CanonicalAddr
Contract address of Liquidation Contract
stable_denom
String
Native token denomination for stablecoin
basset_info
BAssetInfo
bAsset token information
Key
Type
Description
balance
Uint256
Amount of bETH deposited as collateral
spendable
Uint256
Amount of bETH that can be withdrawn (not locked in loan)
Key
Type
Description
owner
String
Address of contract owner
collateral_token
String
Contract address of bETH Token
overseer_contract
String
Contract address of Overseer
market_contract
String
Contract address of Market
reward_contract
String
Contract address of bETH Reward
liquidation_contract
String
Contract address of Liquidation Contract
stable_denom
String
Native token denomination for stablecoin
basset_info
BAssetInfo
bAsset token information
Key
Type
Description
name
String
Name of bAsset
symbol
String
Symbol of bAsset
decimals
u8
Number of decimals of bAsset token
Key
Type
Description
sender
String
Sender of the token transfer
amount
Uint128
Amount of tokens received
msg
Binary
Base64-encoded string of JSON of Receive Hook
Key
Type
Description
owner
*
String
New address of contract owner
liquidation_contract
*
String
New contract address of Liquidation Contract
Key
Type
Description
borrower
String
Address of borrower locking collateral
amount
Uint256
Amount of collateral to lock
Key
Type
Description
borrower
String
Address of borrower unlocking collateral
amount
Uint256
Amount of collateral to unlock
Key
Type
Description
Key
Type
Description
liquidator
String
Address of user that triggered liquidations
borrower
String
Address of borrower being liquidated
amount
Uint256
Amount of collateral to liquidate
Key
Type
Description
amount
*
Uint256
Amount of collateral to withdraw
Key
Type
Description
Key
Type
Description
Key
Type
Description
owner
String
Address of contract owner
collateral_token
String
Contract address of bETH Token
overseer_contract
String
Contract address of Overseer
market_contract
String
Contract address of Market
reward_contract
String
Contract address bETH Reward
liquidation_contract
String
Contract address of Liquidation Contract
stable_denom
String
Native token denomination for stablecoin
basset_info
BAssetInfo
bAsset token information
Key
Type
Description
name
String
Name of bAsset token
symbol
String
Symbol of bAsset token
decimals
u8
Number of decimals of bAsset Token
Key
Type
Description
Key
Type
Description
owner
String
Address of contract owner
collateral_token
String
Contract address of bETH Token
overseer_contract
String
Contract address of Overseer
market_contract
String
Contract address of Market
reward_contract
String
Contract address bETH Reward
liquidation_contract
String
Contract address of Liquidation Contract
stable_denom
String
Native token denomination for stablecoin
basset_info
BAssetInfo
bAsset token information
Key
Type
Description
name
String
Name of bAsset token
symbol
String
Symbol of bAsset token
decimals
u8
Number of decimals of bAsset Token
Key
Type
Description
address
String
Address of borrower that deposited collateral
Key
Type
Description
borrower
String
Address of borrower that deposited collateral
balance
Uint256
Total amount of deposited collateral
spendable
Uint256
Amount of spendable collateral
Key
Type
Description
address
String
Address of borrower that deposited collateral
Key
Type
Description
borrower
String
Address of borrower that deposited collateral
balance
Uint256
Total amount of deposited collateral
spendable
Uint256
Amount of spendable collateral
Key
Type
Description
start_after
*
String
Borrower address to start query
limit
*
u32
Maximum number of query entries
Key
Type
Description
borrowers
Vec<BorrowerResponse>
Collateral balance information of borrowers
Key
Type
Description
borrower
String
Address of borrower that deposited collateral
balance
Uint256
Total amount of deposited collateral
spendable
Uint256
Amount of spendable collateral
Key
Type
Description
start_after
*
String
Borrower address to start query
limit
*
u32
Maximum number of query entries
Key
Type
Description
borrowers
Vec<BorrowerResponse>
Collateral balance information of borrowers
Key
Type
Description
borrower
String
Address of borrower that deposited collateral
balance
Uint256
Total amount of deposited collateral
spendable
Uint256
Amount of spendable collateral