Module loans::pallet::dispatchables
source · Expand description
Auto-generated docs-only module listing all defined dispatchables for this pallet.
Warning: Doc-Only
Members of this module cannot be used directly and are only provided for documentation
purposes. To see the real version of each dispatchable, look for them in Pallet
or
Call
.
Functions
- Activates a market. Returns
Err
if the market does not exist. - Creates a new lending market for a given currency. Returns
Err
if a market already exists for the given currency. - Add reserves by transferring from payer. TODO: This extrinsic currently does nothing useful. See the TODO comment of the
ensure_enough_cash
function for more details. Based on that TODO, decide whether this extrinsic should be kept. - Deposit incentive reward currency into the pallet account.
- The caller borrows
borrow_amount
ofasset_id
from the protocol, using their supplied assets as collateral. - Claim incentive rewards for all markets.
- Claim inceitve reward for the specified market.
- Caller enables their lend token balance as borrow collateral. This operation locks the lend tokens, so they are no longer transferrable. Any incoming lend tokens into the caller’s account (either by direct transfer or minting) are automatically locked as well, such that locking and unlocking borrow collateral is an atomic state (a “collateral toggle”). If any of the caller’s lend token balance is locked elsewhere (for instance, as bridge vault collateral), this operation will fail. If this operation is successful, the caller’s maximum allowed debt increases.
- Force updates a stored market. Returns
Err
if the market currency does not exist. - The caller liquidates the borrower’s collateral. This extrinsic may need to be called multiple times to completely clear the borrower’s bad debt, because of the
close_factor
parameter in the market. See theclose_factor_may_require_multiple_liquidations_to_clear_bad_debt
unit test for an example of this. - The caller supplies (lends) assets into the market and receives a corresponding amount of lend tokens, at the current internal exchange rate.
- The caller redeems lend tokens for the underlying asset, at the current internal exchange rate.
- The caller redeems their entire lend token balance in exchange for the underlying asset. Note: this will fail if the account needs some of the collateral for backing open borrows, or if any of the lend tokens are used by other pallets (e.g. used as vault collateral)
- Sender redeems some of internal supplies in exchange for the underlying asset.
- Reduces reserves (treasury’s share of accrued interest) by transferring to receiver.
- The caller repays some of their debts.
- The caller repays all of their debts.
- Updates a stored market. Returns
Err
if the market currency does not exist. - Updates reward speed for the specified market
- Updates the rate model of a stored market. Returns
Err
if the market currency does not exist or the rate model is invalid. - Caller disables their lend token balance as borrow collateral. This operation unlocks the lend tokens, so they become transferrable. This operation can only succeed if the caller’s debt is backed by sufficient collateral excluding this currency.