Messages
MsgLendAsset
A user lends assets the the module.
message MsgLendAsset {
string lender = 1;
cosmos.base.v1beta1.Coin amount = 2;
}
The message will fail under the following conditions:
amountis not a valid amount of an accepted assetlenderbalance is insufficient
MsgWithdrawAsset
A user withdraws lent assets.
message MsgWithdrawAsset {
string lender = 1;
cosmos.base.v1beta1.Coin amount = 2;
}
The message will fail under the following conditions:
amountis not a valid amount of an accepted asset's corresponding uToken- The sum of
lenderuToken balance and uToken collateral (if enabled) is insufficient
The following additional failures are only possible for collateral-enabled uTokens
- Withdrawing the required uToken collateral would reduce
lender'sBorrowLimitbelow their total borrowed value - Borrow value or borrow limit cannot be computed due to a missing
x/oracleprice
MsgSetCollateral
A user enables or disables a uToken denomination as collateral for their account.
message MsgSetCollateral {
string borrower = 1;
string denom = 2;
bool enable = 3;
}
The message will fail under the following conditions:
denomis not a valid uToken
The following additional failures are only possible for collateral-enabled uTokens
- Disabling the required uTokens as collateral would reduce
borrower'sBorrowLimitbelow their total borrowed value - Borrow value or borrow limit cannot be computed due to a missing
x/oracleprice
MsgBorrowAsset
A user borrows base assets from the module.
message MsgBorrowAsset {
string borrower = 1;
cosmos.base.v1beta1.Coin amount = 2;
}
The message will fail under the following conditions:
amountis not a valid amount of an accepted asset- Borrowing the requested amount would cause
borrowerto exceed theirBorrowLimit - Borrow value or borrow limit cannot be computed due to a missing
x/oracleprice
MsgRepayAsset
A user fully or partially repays one of their borrows. If the requested amount would overpay, it is reduced to the full repayment amount before attempting.
message MsgRepayAsset {
string borrower = 1;
cosmos.base.v1beta1.Coin amount = 2;
}
The message will fail under the following conditions:
amountis not a valid amount of an accepted assetborrowerbalance is insufficientborrowerhas not borrowed any of the specified asset
MsgLiquidate
A user liquidates all or part of an undercollateralized borrower's borrow positions in exchange for an equivalent value of the borrower's collateral, plus liquidation incentive. If the requested repayment amount would overpay or is limited by available collateral rewards or the dynamic CloseFactor, the repayment amount will be reduced to the maximum acceptable value before liquidation is attempted.
The user specifies a minimum reward amount (in a base token denom) that they would accept for the full repayment amount. This is used to compute a ratio of actual repayment (which could be lower than intended) to token equivalent of actual uToken reward. Transactions that would result in a reward:repayment amount lower than the minimum will fail instead.
A minimum reward amount of zero ignores this check and trusts oracle prices.
message MsgLiquidate {
string liquidator = 1;
string borrower = 2;
cosmos.base.v1beta1.Coin repayment = 3;
cosmos.base.v1beta1.Coin reward = 4;
}
The message will fail under the following conditions:
repaymentis not a valid amount of an accepted base assetrewardis not a valid amount of an accepted base assetborrowerhas not borrowed any of the specified asset to repayborrowerhas no collateral of the requested reward denomborrower's total borrowed value does not exceed theirLiquidationThresholdliquidatorbalance is insufficient- the message's ratio of
rewardtorepaymentis higher than the ratio that would result from liquidation at the current oracle prices and liquidation incentives - Borrowed value or
LiquidationThresholdcannot be computed due to a missingx/oracleprice