Assume user has some aBNBc tokens.
aBNBc is ERC20 complaint contract.
- Approve aBNBc(token) with deposit amount against interaction contract
- Call
interaction.deposit(<participant>, <token>, <amount>)
- Call
interaction.borrow(<token>, <amount_to_borrow>)
Token
is the collateral token that you want to use Check that you have HAY present in the wallet
getTotalAuctionsCountForToken(<token>)
- gets total amount of auctions for collateralgetAllActiveAuctionsForToken(<token>)
- gets all active auctions for collateralstartAuction(<token>, <user_address>, <keeper_address>)
- starts an auction for a collateral, liquidates user and transfers incentives to keeper addressbuyFromAuction(<token>, <auctionId>, <collateral_amount>, <max_price>, <receiver_address>)
- buys collateral in auction(before this call user should approvecollateral_mount * max_price / ray
amount of HAY to DAOInteraction contract)token
- address of collateral tokenauctionId
- Id of auctioncollateral_amount
- the maximum amount of collateral user wants to buy [wad]max_price
- the maximum acceptable price in HAY per unit collateral [ray]receiver_address
- address that will receive the collateral
- Approve HAY (it is also ERC20 complaint contract) against interaction
- Call
interaction.payback(<token>, <amount_of_hay>)
Note: aBNBc will stay collaterized(locked) in the vault.
Unlock and transfer funds to the user
- Call
interaction.withdraw(<token>, <abnbc_amount_to_withdraw>)
locked(<token>, <user_address>)
- Amount of aBNBc in collateral for a userborrowed(<token>, <user_address>)
- Amount of HAY borrowed by usercollateralPrice(<token>)
- price of the collateral asset(aBNBc) from OraclehayPrice(<token>)
- HAY pricecollateralRate(<token>)
- how much HAY user can borrow for one token of collateral
i.e. 1 aBNBc worthcollateralRate
HAYdepositTVL(<token>)
- Total aBNBc deposited nominated in $collateralTVL(<token>)
- Total HAY borrowed by all usersavailableToBorrow(<token>, <user_address>)
- Collateral minus borrowed. In other words: free collateral (nominated in HAY)willBorrow(<token>, <user_address>, <amount>)
- Collateral minus borrowed with additional amount of aBNBc (amount
can be negative).currentLiquidationPrice(<token>, <user_address>)
- Price of aBNBc when user will be liquidatedestimatedLiquidationPrice(<token>, <user_address>, <amount>)
- Price of aBNBc when user will be liquidated with additional amount of aBNBc deposited/withdrawborrowApr(<token>)
- Percent value, yearly APY with 6 decimals
https://ethereum.stackexchange.com/a/23110
web3.utils.hexToAscii(val)
pendingRewards(<user_address>)
- Maximum amount of tokens that can be claimed by user.
claim(<user_address>, <amount>)
- Claim amount
of user tokens and transfer them to the user
wallet
distributionApy()
- rate in percent (like borrowApr)
- Provide collateral
- Borrow some hay, note the estimated liquidation price
- Set oracle price below your liquidation price
- Visit liquidation page on the frontend
- Note your address in the list and press
liquidate
button - Your hBNB will be burned and you will receive any leftover in hay after liquidation happened