Creates a Pool
Optional
infoThe APR borrowers pay, determined by the utilization curve.
Pool
The borrowed tokens of the vault
Pool
The token mint decimals
Pool
The APY depositors receive, determined by the utilization curve.
Pool
The continuous compounding deposit rate.
Pool
The management fee, a fraction of interest paid.
The long-form token name
Pool
The visual token precision for UI strings.
Pool
The token symbol, such as "BTC" or "SOL"
Pool
The token mint of the Pool. It is incorrect to register a MarginAccount position using the token mint.
Rather depositNoteMint
and loanNoteMint
positions should be registered
Pool
The token price in USD provided by Pyth.
Pool
The total tokens currently borrowed + available to borrow
Pool
The uncollected fees of the pool.
Pool
The borrow utilization rate, where 0 is no borrows and 1 is all tokens borrowed.
Pool
The vault token balance
Pool
Program Implementation
Send a transaction to deposit tokens into the pool.
This function will
source
param,The amount of tokens to be deposited in lamports.
The margin account that will receive the deposit.
Optional
source?: TokenAddress(Optional) The token account that the deposit will be transfered from. The wallet balance or associated token account will be used if unspecified.
Derive the address of a deposit position token account associated with a MarginAccount.
MarginAccount
Optional
destination?: TokenAddressSend a transaction to refresh all MarginAccount pool positions so that additional borrows or withdraws can occur.
Pool
pools, marginAccount }
Send a transaction to refresh all MarginAccount deposit or borrow positions associated with this Pool so that additional borrows or withdraws can occur.
Pool
Optional
closeOptional
signer?: AddressOptional
source?: TokenAddressOptional
minAmountOut: numberOptional
outputToken: PoolOptional
repayWithProceeds: booleanOptional
setupCheck: booleanTransaction to swap tokens
Create an instruction to deposit into the pool.
This function will wrap SOL according to the source
param.
It is required that
Pool
The amount of tokens to be deposited in lamports.
The array to append instructions to
The margin account that will receive the deposit.
Optional
source?: TokenAddress(Optional) The token account that the deposit will be transfered from. The wallet balance or associated token account will be used if unspecified.
Create instructions to refresh all MarginAccount pool positions so that additional borrows or withdraws can occur.
Pool
instructions, pools, marginAccount }
Create instructions to refresh all MarginAccount deposit or borrow positions associated with this Pool so that additional borrows or withdraws can occur.
Pool
instructions, marginAccount }
Create instructions to refresh MarginAccount pool positions in a prioritised manner so that additional borrows or withdraws can occur.
Pool
instructions, pools, marginAccount }
Get instruction to register new pool deposit position that is custodied by margin
// Load the pools
const poolManager = new PoolManager(programs, provider)
const pools = await poolManager.loadAll()
// Register the SOL deposit position
const pool = pools["SOL"]
await pool.withRegisterDepositPosition({ instructions, marginAccount })
Returns the instruction, and the address of the deposit note token account to be created for the position.
MarginAccount
Instructions array to append to.
The margin account that will custody the position.
Optional
sourceOptional
destination?: TokenAddressOptional
destination?: TokenAddressStatic
getStatic
getStatic
getStatic
getStatic
interpolateGenerated using TypeDoc
A pool in which a MarginAccount can register a deposit and/or a borrow position.
Export