Instruction
- Description: Initializes a new lending market.
- Tag: 0
- Accounts
0. `[signer]` Init lending market authority1. `[writable]` Lending market account - uninitialized.2. `[]` Rent sysvar.3. `[]` Token program id.4. `[]` Pyth oracle program id.5. `[]` Larix oracle program id.6. `[]` Larix oracle id.
- Parameters
/// Owner authority which can add new reservesowner: Pubkey,/// Currency market prices are quoted in/// e.g. "USD" null padded (`*b"USD\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0\0\0\0\0\0\0\0\0"`) or a SPL token mint pubkeyquote_currency: [u8; 32],
- Description: Sets the new owner of a lending market
- Tag: 1
- Accounts
0. `[writable]` Lending market account.1. `[signer]` Current owner.
- Parameters
/// The new ownernew_owner: Pubkey,
- Description: Initializes a new lending market reserve
- Tag: 2
- Accounts
0. `[writable]` Reserve account - uninitialized.1. `[]` Reserve liquidity SPL Token mint.2. `[]` Reserve liquidity supply SPL Token account.3. `[]` Reserve liquidity fee receiver.4. `[]` Pyth product account when is_lp is falseAny account when is_lp is true5. `[]` Reserve liquidity pyth oracle account when is_lp isfalse; BridgePool account of bridge program whenis_lp is true6. `[]` Reserve liquidity larix oracle account whenis_lp is falseLpPrice account of bridge program when is_lp is true7. `[]` Reserve collateral SPL Token mint.8. `[]` Reserve collateral token supply.9 `[]` Lending market account.10 `[signer]` Lending market owner.11 `[]` Un_coll_supply_account12 `[]` Clock sysvar.13 `[]` Rent sysvar.14 `[]` Token program id.
- Parameters
/// Reserve configuration valuesconfig: ReserveConfig,total_mining_speed: u64,kink_util_rate: u64,use_pyth_oracle:bool,is_lp:bool,
- Description: Accrue interest and update market price of liquidity on a reserve.
- Tag: 3
- Accounts:
0. `[writable]` Reserve account.1. `[]` Reserve liquidity oracle account.Must be the Pyth price account specified atInitReserve.2. `[]` Larix oracle
- Description: Deposit liquidity into a reserve in exchange for collateral. Collateral represents a share
- Tag: 4
- Accounts
0. `[writable]` Source liquidity token account.$authority can transfer $liquidity_amount.1. `[writable]` Destination collateral token account.2. `[writable]` Reserve account.3. `[writable]` Reserve collateral SPL Token mint.4. `[writable]` Reserve liquidity supply SPL Token account.5. `[]` Lending market account.6. `[]` Derived lending market authority.7. `[signer]` User transfer authority ($authority).8. `[]` Token program id.
- Parameters
/// Amount of liquidity to deposit in exchange for collateral tokensliquidity_amount: u64,
- Description: Redeem collateral from a reserve in exchange for liquidity.
- Tag: 5
- Accounts
0. `[writable]` Source collateral token account.$authority can transfer $collateral_amount.1. `[writable]` Destination liquidity token account.2. `[writable]` Reserve account.3. `[writable]` Reserve collateral SPL Token mint.4. `[writable]` Reserve liquidity supply SPL Token account.5. `[]` Lending market account.6. `[]` Derived lending market authority.7. `[signer]` User transfer authority ($authority).8. `[]` Token program id.
- Parameters
/// Amount of collateral tokens to redeem in exchange for liquiditycollateral_amount: u64,
- Description: Initializes a new lending market obligation
- Tag: 6
- Accounts
0. `[writable]` Obligation account - uninitialized.1. `[]` Lending market account.2. `[signer]` Obligation owner.3. `[]` Token program id.
- Description: Refresh an obligation's accrued interest and collateral and liquidity prices. Requires refreshed reserves, as all obligation collateral deposit reserves in order, followed by all liquidity borrow reserves in order.
- Tag: 7
- Accounts
0. `[writable]` Obligation account.1. `[]` Collateral deposit reserve accounts - refreshed, all, in order.2. `[]` Liquidity borrow reserve accounts - refreshed, all, in order.
- Description: Deposit collateral to an obligation. Requires a refreshed reserve.
- Tag: 8
- Accounts
0. `[writable]` Source collateral token account.Minted by deposit reserve collateral mint.$authority can transfer $collateral_amount.1. `[writable]` Destination deposit reserve collateral supply SPL Token account.2. `[]` Deposit reserve account - refreshed.3. `[writable]` Obligation account.4. `[]` Lending market account.5. `[]` Derived lending market authority.6. `[signer]` Obligation owner.7. `[signer]` User transfer authority ($authority).8. `[]` Token program id.
- Parameters
/// Amount of collateral tokens to depositcollateral_amount: u64,
- Description: Withdraw collateral from an obligation. Requires a refreshed obligation and reserve.
- Tag: 9
- Accounts
0. `[writable]` Source withdraw reserve collateral supply SPL Token account.1. `[writable]` Destination collateral token account.Minted by withdraw reserve collateral mint.2. `[]` Withdraw reserve account - refreshed.3. `[writable]` Obligation account - refreshed.4. `[]` Lending market account.5. `[]` Derived lending market authority.6. `[signer]` Obligation owner.7. `[]` Token program id.
- parameters
/// Amount of collateral tokens to withdraw - u64::MAX for up to 100% of deposited amountcollateral_amount: u64,
- Description: Borrow liquidity from a reserve by depositing collateral tokens; Requires a refreshed obligation and reserve.
- Tag: 10
- Accounts
::UselessThe current account will not be used.It is used to make up the account number, in order to keep the size of the current instruction is equals to liquidate obligation instruction, to avoid the situation that the current transaction is successful but the liquidate cannot be performed.0. `[writable]` Source borrow reserve liquidity supply SPL Token account.1. `[writable]` Destination liquidity token account.Minted by borrow reserve liquidity mint.2. `[writable]` Borrow reserve account - refreshed.3. `[writable]` Obligation account - refreshed.4. `[]` Lending market account.5. `[]` Derived lending market authority.6. `[signer]` Obligation owner.7. `[]` Token program id.8. `[]` Larix oracle program account- Useless9. `[]` Mine mint account - Useless10.`[]` Mine supply account - Useless
- Parameters
/// Amount of liquidity to borrow - u64::MAX for 100% of borrowing powerliquidity_amount: u64,
- Description: Repay borrowed liquidity to a reserve; Requires a refreshed obligation and reserve.
- Tag: 11
- Accounts
0. `[writable]` Source liquidity token account.Minted by repay reserve liquidity mint.$authority can transfer $liquidity_amount.1. `[writable]` Destination repay reserve liquidity supply SPL Token account.2. `[writable]` Repay reserve account - refreshed.3. `[writable]` Obligation account - refreshed.4. `[]` Lending market account.5. `[signer]` User transfer authority ($authority).6. `[]` Token program id.
- Parameters
/// Amount of liquidity to repay - u64::MAX for 100% of borrowed amountliquidity_amount: u64,
- Description: Repay borrowed liquidity to a reserve to receive collateral at a discount from an unhealthy obligation; Requires a refreshed obligation and reserves.
- Tag: 12
- Accounts
0. `[writable]` Source liquidity token account.Minted by repay reserve liquidity mint.$authority can transfer $liquidity_amount.1. `[writable]` Destination collateral token account.Minted by withdraw reserve collateral mint.2. `[writable]` Repay reserve account - refreshed.3. `[writable]` Repay reserve liquidity supply SPL Token account.4. `[]` Withdraw reserve account - refreshed.5. `[writable]` Withdraw reserve collateral supply SPL Token account.6. `[writable]` Obligation account - refreshed.7. `[]` Lending market account.8. `[]` Derived lending market authority.9. `[signer]` User transfer authority ($authority).10 `[]` Clock sysvar.11 `[]` Token program id.
- Parameters
/// Amount of liquidity to repay - u64::MAX for up to 100% of borrowed amountliquidity_amount: u64,
- Description: Make a flash loan
- Tag: 13
- Accounts
0. `[writable]` Source liquidity token account.Minted by reserve liquidity mint.Must match the reserve liquidity supply.1. `[writable]` Destination liquidity token account.Minted by reserve liquidity mint.2. `[writable]` Reserve account.3. `[writable]` Flash loan fee receiver account.Must match the reserve liquidity fee receiver.4. `[writable]` Host fee receiver.5. `[]` Lending market account.6. `[]` Derived lending market authority.7. `[]` Token program id.8. `[]` Flash loan receiver program id.Must implement an instruction that has tag of 0 and a signatureof `(amount: u64)`This instruction must return the amount to the source liquidity account.9. `[signer]` Flash loan authority10. `[any]` Additional accounts expected by the receiving program's`ReceiveFlashLoan` instruction.The flash loan receiver program that is to be invoked should contain aninstruction with tag `0` and accept the total amount (including fee) thatneeds to be returned back after its execution has completed.Flash loan receiver should have an instruction with the following signature:0. `[writable]` Source liquidity (matching the destination from above).1. `[writable]` Destination liquidity (matching the source from above).2. `[]` Token program id3. `[any]` Additional accounts provided to the lending program's `FlashLoan`instruction aboveReceiveFlashLoan {// Amount that must be repaid by the receiver programamount: u64}
- Parameters
/// The amount that is to be borrowed - u64::MAX for up to 100% of available liquidityamount: u64,call_back_data: Vec<u8>
- Description: Set Configures
- Tag: 14
- Parameters
config_type:ConfigType
- Description: Initializes mining int he obligation account.
- Tag: 16
- Accounts
0. `[]` Mining account1. `[signer]` Mining owner2. `[]` Lending market account
- Description: Deposits the mining benefits to the obligation account.
- Tag: 18
- Account
0. `[Writable]` Source account1. `[Writable]` UnColl deposit supply SPL Token account.2. `[Writable]` Mining account3. `[]` Bonus account4. `[]` Lending market account.5. `[]` Derived lending market authority.6. `[]` Mining owner.7. `[signer]` User transfer authority ($authority).8. `[]` Token program id.
- Parameters
/// The amount of mining benefitsamount:u64
- Description: Withdraws mining benefits.
- Tag: 19
- Account
0. `[writable]` Source account1. `[writable]` UnColl deposit supply SPL Token account.2. `[writable]` Mining account3. `[writable]` Reserve account4. `[]` Lending market account.5. `[]` Derived lending market authority.6. `[]` Mining owner.7. `[]` Token program id.
- Parameters
/// The amount of mining benefitsamount:u64
- Description: Claims the owner of the mining benefits.
- Tag: 20
- Account
0. `[writable]` Mining account1. `[]` Mine supply2. `[]` Destination account3. `[Signer]` Mining owner4. `[]` Lending market info5. `[]` Lending market authority6. `[]` Token program id7. `[]`... Reserves
- Description: Claims the obligation.
- Tag: 21
- Account
0. `[writable]` Obligation account
1. `[]` Mine supply
2. `[]` Destination account
3. `[Signer]` Mining owner
4. `[]` Lending market info
5. `[]` Lending market authority
6. `[]` Token program id
7. `[]`
... Deposit reserves
8. `[]`
... Borrow reserves
- Description: Claim owner's fee.
- Tag: 22
- Account
0. `[]` Source account (liquidity supply account)
1. `[]` Destination account receive owner fee
2. `[]` Lending market account
3. `[singer]` Lending market owner
- Description: Receive pending owner.
- Tag: 23
- Account
0. `[Write]` Lending Market
1. `[Signer]` Pending owner
RefreshReserves
- Description: Refresh the current reserves
- Tag: 24
- Account
0. `[writable]` Reserve account.
1. `[]` Oracle account larix oracle or pyth price account .
LiquidateObligation2
- Description: Repay borrowed liquidity to a reserve to receive collateral at a discount from an unhealthy obligation. Requires a refreshed obligation and reserves.
- Tag: 25
- Account
0. `[writable]` Source liquidity token account.Minted by repay reserve liquidity mint.$authority can transfer $liquidity_amount.1. `[writable]` Destination collateral token account.Minted by withdraw reserve collateral mint.2. `[writable]` Repay reserve account - refreshed.3. `[writable]` Repay reserve liquidity supply SPL Token account.4. `[]` Withdraw reserve account - refreshed.5. `[writable]` Withdraw reserve collateral supply SPL Token account.6. `[writable]` Obligation account - refreshed.7. `[]` Lending market account.8. `[]` Derived lending market authority.9. `[signer]` User transfer authority ($authority).10 `[]` Token program id.
- Parameters
/// Amount of liquidity to repay - u64::MAX for up to 100% of borrowed amountliquidity_amount: u64,
Last modified 1yr ago