Account Methods
Trading
batchBalanceAction
Similar to batchBalanceAndTradeAction except the encoded BalanceAction only allows deposits, withdraws and minting / redeeming of nTokens. No trades are executed.
batchBalanceAndTradeAction
Described in depth in Batch Trades.
batchLend
Described in depth in Batch Trades.
depositAssetToken
Deposits some amount of asset tokens (i.e. cTokens or aTokens) for currencyId
into account
. Will transfer tokens from msg.sender
, allowing anyone to add collateral to an account.
Depositing tokens is not the same as lending at fixed rates! Deposits will earn money market variable interest rates.
depositUnderlyingToken
Deposits some amount of underlying tokens (i.e. DAI or USDC) for currencyId
into account
. Will transfer tokens from msg.sender
, allowing anyone to add collateral to an account. The deposited tokens will always be used to mint asset tokens on behalf of the account.
Depositing tokens is not the same as lending at fixed rates! Deposits will earn money market variable interest rates.
withdraw
Withdraws cash from the account of msg.sender
. amountInternalPrecision
is the amount of cash balance an account is holding, can be viewed by calling getAccountBalance(currencyId)
on Notional. Set redeemToUnderlying
to true if the msg.sender
should receive underlying tokens instead of asset tokens.
nTokenRedeem
Redeems tokensToRedeem
balance of nTokens manually for redeemer. If sellTokenAssets
is set to true then will attempt to sell residual fCash balances back to cash and leave the cash in the account's cash balance. If acceptResidualAssets
is set to true, any fCash that was unable to be sold to cash will be left in the redeemer's portfolio. If acceptResidualAssets is false, then will revert if there are any fCash assets that are left unsold.
Miscellaneous
enableBitmapCurrency
settleAccount
Settles matured fCash positions on an account. Calling this method is normally not required since settlement will occur automatically whenever required inside other methods.
batchBalanceAndTradeActionWithCallback
Similar to batchBalanceAndTradeAction except can only be called by whitelisted contracts. The whitelisted contract will receive a callback prior to the free collateral check which allows the contract to perform some arbitrary execution (i.e. trade tokens on a DEX before re-depositing to Notional).
Last updated