borrow
params of yAssetParams -> (list(op), storage upd)
Last updated
params of yAssetParams -> (list(op), storage upd)
Last updated
Take a loan from protocol. Accepts amount
of wanted token and it's related yToken's tokenId
.
Borrowing new market could fail if user already borrowed from maxMarkets
of other markets.
The yToken
contract expects that underlying token info of tokenId
and all borrowed by user before tokenId
s are updated by calling and in the same block before this contract method
tokenId
nat
yToken identifier
amount
nat
amount of underlying tokens to be borrowed from protocol
yToken/max-market-limit
- limit of borrow markets exceeded.
yToken/forbidden-for-borrow
- market is paused for borrow.
yToken/exceeds-the-permissible-debt
- raised when outstanding borrow value greater than max collateral value.
yToken/not-enough-liquidity
- not enough liquidity of tokens to send amount
wanted by user.
token/cant-get-contract-token
- FA12 token contract address does not contain transfer
entrypoint from FA12 interface.
token/cant-get-contract-fa2-token
- FA2 token contract address does not contain transfer
entrypoint from FA2 interface.
underflow/liquidity - reserves
- liquidity more than reserves.
yToken/amount-is-zero
- passed zero amount
.
ceil-div-error
- division of two numbers fails.
yToken/need-update
- token price and interest not updated (see warning above)
yToken/yToken-undefined
- token identifier is not assigned to any known yTokens.