The Treasury / Vault is the main core contract in Autonomint. All the funds are transferred here, from Borrowing and CDS. External protocol deposits and yields are generated in treasury contract.
Asset type, the treasury contract needs to approve
spender
address
Address of the spender.
amount
uint256
Amount of tokens to approve.
Approves the asset to be spend by spender (mostly core contracts).
_calculateCumulativeRate
Param Name
Type
Description
_currentExchangeRate
uint256
Current ionWETH to WETH exchange rate.
_protocol
Protocol
External protocol name.
Calculates the cumulative rate for that protocol and store that.
depositToIonicByUser
Param Name
Type
Description
depositAmount
uint256
Collateral amount to deposit in Ionic.
Deposits the collateral amount to Ionicprotocol. Updates the cumulative rate(to calculate interest) for Ionic protocol.
depositToAaveByUser
Param Name
Type
Description
depositAmount
uint256
Collateral amount to deposit in Aave.
Deposits the collateral amount to Aave protocol. Updates the cumulative rate(to calculate interest) for Aave protocol.
depositToCompoundByUser
Param Name
Type
Description
depositAmount
uint256
Collateral amount to deposit in Compound.
Deposits the collateral amount to Compound protocol. Updates the cumulative rate(to calculate interest) for Compound protocol.
withdrawFromIonicByuser
Param Name
Type
Description
user
address
Address of the user.
aBondAmount
uint128
ABOND amount the user is redeeming.
Withdraws the collateral with interest from Ionic and transfer it to user. The initial deposited amount and interest gained is calculated by ABOND amount, collateral backed, cumulative rate for that ABOND and current cumulative rate.
withdrawFromAaveByuser
Param Name
Type
Description
user
address
Address of the user.
aBondAmount
uint128
ABOND amount the user is redeeming.
Withdraws the collateral with interest from Aave and transfer it to user. The initial deposited amount and interest gained is calculated by ABOND amount, collateral backed, cumulative rate for that ABOND and current cumulative rate.
withdrawFromCompoundByuser
Param Name
Type
Description
user
address
Address of the user.
aBondAmount
uint128
ABOND amount the user is redeeming.
Withdraws the collateral with interest from Compound and transfer it to user. The initial deposited amount and interest gained is calculated by ABOND amount, collateral backed, cumulative rate for that ABOND and current cumulative rate.
withdrawFromIonicDuringLiq
Param Name
Type
Description
user
address
Address of the user.
index
uint64
Index of the borrower position which is going to be liquidated.
Withdraws the collateral with interest from Ionic and kept it in treasury. The initial deposited amount and interest gained is calculated by cumulative rate during deposit and current cumulative rate.
withdrawInterest
Param Name
Type
Description
toAddress
address
Receiver's address to get interest.
amount
uint256
Interest amount to withdraw.
Withdraws the interest gained in protocol by owner.
transferEthToCdsLiquidators
Param Name
Type
Description
borrower
address
Address of the CDS user who opted for liquidation to transfer ETH.
amount
uint128
Amount of ETH to transfer.
Gets USDa and Native token from destination chain to this chain treasury.This function can only be called by Borrowing or CDS contracts.
transferFundsToGlobal
Param Name
Type
Description
transferAmount
uint256[4]
Array of amounts needs to transfer to global contract in the order of AssetName enum.
Transfers the respective amounts to the global contract.