Custody [bLUNA]
The Custody contract is where supplied bAsset collaterals are managed. Users can make collateral deposits and withdrawals to and from this contract. The Custody contract is also responsible for claiming bAsset rewards and converting them to Terra stablecoins, which is then sent to the Overseer contract for eventual distribution.
Config
Key | Type | Description |
| CanonicalAddr | Address of contract owner |
| CanonicalAddr | Contract address of bLuna Token |
| CanonicalAddr | Contract address of Overseer |
| CanonicalAddr | Contract address of Market |
| CanonicalAddr | Contract address of bLuna Reward |
| CanonicalAddr | Contract address of Liquidation Contract |
| String | Native token denomination for stablecoin |
| BAssetInfo | bAsset token information |
InstantiateMsg
Key | Type | Description |
| String | Address of contract owner |
| String | Contract address of bLuna Token |
| String | Contract address of Overseer |
| String | Contract address of Market |
| String | Contract address of bLuna Reward |
| String | Contract address of Liquidation Contract |
| String | Native token denomination for stablecoin |
| BAssetInfo | bAsset token information |
Key | Type | Description |
| String | Name of bAsset |
| String | Symbol of bAsset |
| u8 | Number of decimals of bAsset token |
ExecuteMsg
Receive
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.
Key | Type | Description |
| String | Sender of the token transfer |
| Uint128 | Amount of tokens received |
| Binary | Base64-encoded string of JSON of Receive Hook |
UpdateConfig
UpdateConfig
Updates the configuration of the Custody contract.
Key | Type | Description |
| String | New address of contract owner |
| String | New contract address of Liquidation Contract |
* = optional
[Internal] LockCollateral
[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
.
Key | Type | Description |
| String | Address of borrower locking collateral |
| Uint256 | Amount of collateral to lock |
[Internal] UnlockCollateral
[Internal] UnlockCollateral
Unlocks borrower's collateral from their loan position, increasing the amount of spendable collateral. Can only be issued by Overseer
.
Key | Type | Description |
| String | Address of borrower unlocking collateral |
| Uint256 | Amount of collateral to unlock |
[Internal] DistributeRewards
[Internal] DistributeRewards
Withdraws accrued rewards from the bLuna Contract, swaps rewards to the appropriate stablecoin denomination. 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
.
Key | Type | Description |
[Internal] LiquidateCollateral
[Internal] LiquidateCollateral
Liquidates specified amount of locked collateral. Can only be issued by Overseer
.
Key | Type | Description |
| String | Address of user that triggered liquidations |
| String | Address of borrower being liquidated |
| Uint256 | Amount of collateral to liquidate |
WithdrawCollateral
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.
Key | Type | Description |
| Uint256 | Amount of collateral to withdraw |
* = optional
Receive Hooks
DepositCollateral
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.
Key | Type | Description |
QueryMsg
Config
Config
Gets the contract configuration of the Custody contract.
Key | Type | Description |
ConfigResponse
ConfigResponse
Key | Type | Description |
| String | Address of contract owner |
| String | Contract address of bLuna Token |
| String | Contract address of Overseer |
| String | Contract address of Market |
| String | Contract address bLuna Reward |
| String | Contract address of Liquidation Contract |
| String | Native token denomination for stablecoin |
| BAssetInfo | bAsset token information |
Key | Type | Description |
| String | Name of bAsset token |
| String | Symbol of bAsset token |
| u8 | Number of decimals of bAsset Token |
Borrower
Borrower
Gets the collateral balance of the specified borrower.
Key | Type | Description |
| String | Address of borrower that deposited collateral |
BorrowerResponse
BorrowerResponse
Key | Type | Description |
| String | Address of borrower that deposited collateral |
| Uint256 | Total amount of deposited collateral |
| Uint256 | Amount of spendable collateral |
Borrowers
Borrowers
Get the collateral balance of all borrowers.
Key | Type | Description |
| String | Borrower address to start query |
| u32 | Maximum number of query entries |
* = optional
BorrowersResponse
BorrowersResponse
Key | Type | Description |
| Vec<BorrowerResponse> | Collateral balance information of borrowers |
Key | Type | Description |
| String | Address of borrower that deposited collateral |
| Uint256 | Total amount of deposited collateral |
| Uint256 | Amount of spendable collateral |
Last updated