Marginfi group address
Marginfi account authority address
Marginfi group address
Update instance data from provided data struct.
Marginfi account data struct
Withdraw collateral from the marginfi account.
Amount to withdraw (UI unit)
Bank to withdraw from
Transaction signature
Deposit collateral into the marginfi account.
Amount to deposit (UI unit)
Bank to deposit to
Transaction signature
Calculate the maximum amount of asset that can be withdrawn from a bank given existing deposits of the asset and the untied collateral of the margin account.
fc = free collateral ucb = untied collateral for bank
q = (min(fc, ucb) / (price_lowest_bias * deposit_weight)) + (fc - min(fc, ucb)) / (price_highest_bias * liab_weight)
NOTE FOR LIQUIDATORS This function doesn't take into account the collateral received when liquidating an account.
Calculate the maximum amount that can be withdrawn form a bank without borrowing.
Create transaction instruction to withdraw collateral from the marginfi account.
Amount to withdraw (mint native unit)
Bank to withdraw from
MarginWithdrawCollateral
transaction instruction
Create transaction instruction to deposit collateral into the marginfi account.
Amount to deposit (UI unit)
Bank to deposit to
MarginDepositCollateral
transaction instruction
Create transaction instruction to deposit collateral into the marginfi account.
Amount to deposit (UI unit)
Bank to deposit to
(optional) Repay all the liability
LendingPool
transaction instruction
Create transaction instruction to withdraw collateral from the marginfi account.
Amount to withdraw (mint native unit)
Bank to withdraw from
(optional) Withdraw all the asset
MarginWithdrawCollateral
transaction instruction
Update instance data by fetching and storing the latest on-chain state.
Deposit collateral into the marginfi account.
Amount to deposit (UI unit)
Bank to deposit to
(optional) Repay all the liability
Transaction signature
Withdraw collateral from the marginfi account.
Amount to withdraw (UI unit)
Bank to withdraw from
(optional) Withdraw all the asset
Transaction signature
Fetch marginfi account data. Check sanity against provided config.
account address
marginfi config
marginfi Anchor program
commitment override
Decoded marginfi account data struct
Decode marginfi account data according to the Anchor IDL.
Raw data buffer
Decoded marginfi account data struct
Decode marginfi account data according to the Anchor IDL.
Marginfi account data struct
Raw data buffer
MarginfiAccount network factory
Fetch account data according to the config and instantiate the corresponding MarginfiAccount.
Address of the target account
marginfi client
Commitment level override
MarginfiAccount instance
MarginfiAccount local factory (decoded)
Instantiate a MarginfiAccount according to the provided decoded data. Check sanity against provided config.
Address of the target account
marginfi client
Decoded marginfi marginfi account data
MarginfiGroup instance
MarginfiAccount instance
MarginfiAccount local factory (encoded)
Instantiate a MarginfiAccount according to the provided encoded data. Check sanity against provided config.
Address of the target account
marginfi client
Encoded marginfi marginfi account data
MarginfiGroup instance
MarginfiAccount instance
Generated using TypeDoc
Wrapper class around a specific marginfi account.