yToken contract methods
Core lending contract
Yupana Protocol is a decentralized lending protocol for individuals and protocols to access financial services. The protocol is permissionless, transparent, and non-custodial.
This section describes the methods of the main protocol contract. We call it
Underlying asset is the real asset that is provided to the lending protocol.
yTokentoken is the single token with the specific
token idinside of the core Yupana FA2; represents specific underlying asset locked in the protocol.
Collateral is the
yTokentoken that can be used as the collateral to take the loan.
Borrow is the amount of the underlying asset borrowed by the user (loan).
Cash is the amount of the underlying asset present on the contract (not borrowed).
Reserves value is the amount of the underlying asset stored in the protocol.
Collateral Factor is the rate represents by which the borrow limit increases if the
Close Factor is the max portion of the loan that can be liquidated per single transaction.
Reserve Factor is the rate that represents what part of the interest goes to the protocol reserves.
Liquidation discount is the rate that the liquidator will earn if liquidate the asset.
User of protocol allowed to perform actions:
- mint - add a token as a collateral. It allows you to add a token to our system.
- redeem - designed to withdraw tokens from the platform.
- borrow - for borrowing a token. Implemented the logic of freezing collateral tokens when borrowing a token.
- repay - designed to repay debt.
- liquidate - allows another user to liquidate someone's debt.
- enterMarket - allows you to designate that this token will be used as collateral.
- exitMarket - allows you to indicate that this token is no longer used as collateral.
More detailed explanation of calling and using methods is described in the linked section.
FA2 token inteface consist of this entrypoints:
- transfer - for sending tokens.
- update_operators -for allowing other user or contract to be "
- balance_of - on-chain view to get balance by
token_idof a requested token.
- get_total_supply - on-chain view to get balance of all token supply by
FA2contract described in corresponding section.
yTokencontract is managed by
Admin is responsible for the initial setup of the contract, especially setting lambda functions, that contains the main codebase of the contract.
Also, admin adds new markets, adjust lending factors, pauses borrows, updates meta, etc.
adminabilities are explained in the related section.