Deposit (Prime Lend)

Deposit a single Currency to a Notional account

To deposit underlying tokens to Notional, users can use the depositUnderlyingToken method:

# Deposit DAI on Notional. DAI external precision is 1e18.
notional.depositUnderlyingToken(account.address, 2, 10e18, {'from': account})

# Deposit 100 USDC on Notional. USDC external precision is 1e6.
notional.depositUnderlyingToken(account.address, 2, 100e6, {'from': account})

# Deposit 1 ETH on Notional
notional.depositUnderlyingToken(account.address, 1, 1e18, {'from': account, 'value':1e18})

Deposit Prime Cash to a Notional Account

To deposit Prime Cash to Notional, users can use the depositAssetToken method:

# Deposit 10 pDAI to a Notional Account. pCash external precision is 1e8.
notional.depositAssetToken(account.address, 2, 10e8, {'from': account})

# Deposit 100 pUSDC to a Notional Account. pCash external precision is 1e8.
notional.depositAssetToken(account.address, 3, 100e8, {'from': account})

# Deposit 1 pETH to a Notional Account. pCash external precision is 1e8.
notional.depositAssetToken(account.address, 1, 1e8, {'from': account})

Batch deposit to a Notional Account

To deposit multiple tokens to Notional at once, users can use the batchBalanceAction method:

from helpers import get_balance_action

# Deposit 100 DAI & 10 USDC
depositActionDAI = get_balance_action(2, "DepositUnderlying", depositActionAmount=100e18)
depositActionUSDC = get_balance_action(3, "DepositUnderlying", depositActionAmount=10e6)

tx = notional.batchBalanceAction(account.address, [depositActionDAI, depositActionUSDC], {'from': account})

Note that the array of actions must be sorted by currency ids when using batch functions.

Last updated