Files
khadhroony-bobobot/idls/kamino_lending.KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD.json
2026-06-14 14:25:09 +02:00

1 line
133 KiB
JSON

{"version":"1.23.0","name":"kamino_lending","instructions":[{"name":"initLendingMarket","accounts":[{"name":"lendingMarketOwner","isMut":true,"isSigner":true},{"name":"lendingMarket","isMut":true,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"systemProgram","isMut":false,"isSigner":false},{"name":"rent","isMut":false,"isSigner":false}],"args":[{"name":"quoteCurrency","type":{"array":["u8",32]}}]},{"name":"updateLendingMarket","accounts":[{"name":"signer","isMut":false,"isSigner":true},{"name":"lendingMarket","isMut":true,"isSigner":false}],"args":[{"name":"mode","type":"u64"},{"name":"value","type":{"array":["u8",72]}}]},{"name":"updateLendingMarketOwner","accounts":[{"name":"lendingMarketOwnerCached","isMut":false,"isSigner":true},{"name":"lendingMarket","isMut":true,"isSigner":false}],"args":[]},{"name":"initReserve","accounts":[{"name":"signer","isMut":true,"isSigner":true},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"feeReceiver","isMut":true,"isSigner":false},{"name":"reserveCollateralMint","isMut":true,"isSigner":false},{"name":"reserveCollateralSupply","isMut":true,"isSigner":false},{"name":"initialLiquiditySource","isMut":true,"isSigner":false},{"name":"rent","isMut":false,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"systemProgram","isMut":false,"isSigner":false}],"args":[]},{"name":"cloneReserveConfig","accounts":[{"name":"signer","isMut":false,"isSigner":true},{"name":"targetLendingMarket","isMut":false,"isSigner":false,"docs":["The lending market of the [Self::target_reserve].","","The [Self::source_reserve] can come from a different market."]},{"name":"sourceReserve","isMut":false,"isSigner":false,"docs":["The reserve to be used as source for the configuration clone."]},{"name":"targetReserve","isMut":true,"isSigner":false,"docs":["The reserve to have its configuration replaced by a clone."]}],"args":[{"name":"customizations","type":{"defined":"ReserveConfigCustomizationArgs"}}]},{"name":"initFarmsForReserve","accounts":[{"name":"lendingMarketOwner","isMut":true,"isSigner":true},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"farmsProgram","isMut":false,"isSigner":false},{"name":"farmsGlobalConfig","isMut":false,"isSigner":false},{"name":"farmState","isMut":true,"isSigner":false},{"name":"farmsVaultAuthority","isMut":false,"isSigner":false},{"name":"rent","isMut":false,"isSigner":false},{"name":"systemProgram","isMut":false,"isSigner":false}],"args":[{"name":"mode","type":"u8"}]},{"name":"updateReserveConfig","accounts":[{"name":"signer","isMut":false,"isSigner":true},{"name":"globalConfig","isMut":false,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false}],"args":[{"name":"mode","type":{"defined":"UpdateConfigMode"}},{"name":"value","type":"bytes"},{"name":"skipConfigIntegrityValidation","type":"bool"}]},{"name":"redeemFees","accounts":[{"name":"reserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveLiquidityFeeReceiver","isMut":true,"isSigner":false},{"name":"reserveSupplyLiquidity","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false}],"args":[]},{"name":"withdrawProtocolFee","accounts":[{"name":"globalConfig","isMut":false,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"reserve","isMut":false,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"feeVault","isMut":true,"isSigner":false},{"name":"feeCollectorAta","isMut":true,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false}],"args":[{"name":"amount","type":"u64"}]},{"name":"seedDepositOnInitReserve","accounts":[{"name":"signer","isMut":false,"isSigner":true},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"initialLiquiditySource","isMut":true,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false}],"args":[]},{"name":"topupReserveRewards","docs":["Sponsor a reserve's rewards distribution by topping up its `rewards_amount_available` budget."],"accounts":[{"name":"signer","isMut":false,"isSigner":true},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"sourceLiquidity","isMut":true,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false}],"args":[{"name":"amount","type":"u64"}]},{"name":"socializeLoss","accounts":[{"name":"lendingMarketOwner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"}]},{"name":"socializeLossV2","accounts":[{"name":"socializeLossAccounts","accounts":[{"name":"lendingMarketOwner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"farmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"farmsProgram","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"}]},{"name":"markObligationForDeleveraging","accounts":[{"name":"lendingMarketOwner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false}],"args":[{"name":"autodeleverageTargetLtvPct","type":"u8"}]},{"name":"refreshReserve","accounts":[{"name":"reserve","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"pythOracle","isMut":false,"isSigner":false,"isOptional":true},{"name":"switchboardPriceOracle","isMut":false,"isSigner":false,"isOptional":true},{"name":"switchboardTwapOracle","isMut":false,"isSigner":false,"isOptional":true},{"name":"scopePrices","isMut":false,"isSigner":false,"isOptional":true}],"args":[]},{"name":"refreshReservesBatch","accounts":[],"args":[{"name":"skipPriceUpdates","type":"bool"}]},{"name":"depositReserveLiquidity","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"reserve","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"reserveCollateralMint","isMut":true,"isSigner":false},{"name":"userSourceLiquidity","isMut":true,"isSigner":false},{"name":"userDestinationCollateral","isMut":true,"isSigner":false},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"}]},{"name":"redeemReserveCollateral","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveCollateralMint","isMut":true,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"userSourceCollateral","isMut":true,"isSigner":false},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"collateralAmount","type":"u64"}]},{"name":"initObligation","accounts":[{"name":"obligationOwner","isMut":false,"isSigner":true},{"name":"feePayer","isMut":true,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"seed1Account","isMut":false,"isSigner":false},{"name":"seed2Account","isMut":false,"isSigner":false},{"name":"ownerUserMetadata","isMut":false,"isSigner":false},{"name":"rent","isMut":false,"isSigner":false},{"name":"systemProgram","isMut":false,"isSigner":false}],"args":[{"name":"args","type":{"defined":"InitObligationArgs"}}]},{"name":"initObligationFarmsForReserve","accounts":[{"name":"payer","isMut":true,"isSigner":true},{"name":"owner","isMut":false,"isSigner":false},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"reserveFarmState","isMut":true,"isSigner":false},{"name":"obligationFarm","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"farmsProgram","isMut":false,"isSigner":false},{"name":"rent","isMut":false,"isSigner":false},{"name":"systemProgram","isMut":false,"isSigner":false}],"args":[{"name":"mode","type":"u8"}]},{"name":"refreshObligationFarmsForReserve","accounts":[{"name":"crank","isMut":false,"isSigner":true},{"name":"baseAccounts","accounts":[{"name":"obligation","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"reserve","isMut":false,"isSigner":false},{"name":"reserveFarmState","isMut":true,"isSigner":false,"docs":["`obligation_farm_user_state`'s own `farm_state` field, in the handler.","(Cannot live as an Anchor constraint because the handler is also reached","via `cpi_refresh_farms` from v2 host instructions, which bypass Anchor.)"]},{"name":"obligationFarmUserState","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false}]},{"name":"farmsProgram","isMut":false,"isSigner":false},{"name":"rent","isMut":false,"isSigner":false},{"name":"systemProgram","isMut":false,"isSigner":false}],"args":[{"name":"mode","type":"u8"}]},{"name":"refreshObligation","accounts":[{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"obligation","isMut":true,"isSigner":false}],"args":[]},{"name":"depositObligationCollateral","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"depositReserve","isMut":true,"isSigner":false},{"name":"reserveDestinationCollateral","isMut":true,"isSigner":false},{"name":"userSourceCollateral","isMut":true,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"collateralAmount","type":"u64"}]},{"name":"depositObligationCollateralV2","accounts":[{"name":"depositAccounts","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"depositReserve","isMut":true,"isSigner":false},{"name":"reserveDestinationCollateral","isMut":true,"isSigner":false},{"name":"userSourceCollateral","isMut":true,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"farmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"farmsProgram","isMut":false,"isSigner":false}],"args":[{"name":"collateralAmount","type":"u64"}]},{"name":"withdrawObligationCollateral","accounts":[{"name":"owner","isMut":true,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"withdrawReserve","isMut":true,"isSigner":false},{"name":"reserveSourceCollateral","isMut":true,"isSigner":false},{"name":"userDestinationCollateral","isMut":true,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"collateralAmount","type":"u64"}]},{"name":"withdrawObligationCollateralV2","accounts":[{"name":"withdrawAccounts","accounts":[{"name":"owner","isMut":true,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"withdrawReserve","isMut":true,"isSigner":false},{"name":"reserveSourceCollateral","isMut":true,"isSigner":false},{"name":"userDestinationCollateral","isMut":true,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"farmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"farmsProgram","isMut":false,"isSigner":false}],"args":[{"name":"collateralAmount","type":"u64"}]},{"name":"borrowObligationLiquidity","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"borrowReserve","isMut":true,"isSigner":false},{"name":"borrowReserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveSourceLiquidity","isMut":true,"isSigner":false},{"name":"borrowReserveLiquidityFeeReceiver","isMut":true,"isSigner":false},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false},{"name":"referrerTokenState","isMut":true,"isSigner":false,"isOptional":true},{"name":"tokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"}]},{"name":"borrowObligationLiquidityV2","accounts":[{"name":"borrowAccounts","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"borrowReserve","isMut":true,"isSigner":false},{"name":"borrowReserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveSourceLiquidity","isMut":true,"isSigner":false},{"name":"borrowReserveLiquidityFeeReceiver","isMut":true,"isSigner":false},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false},{"name":"referrerTokenState","isMut":true,"isSigner":false,"isOptional":true},{"name":"tokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"farmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"farmsProgram","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"}]},{"name":"repayObligationLiquidity","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"repayReserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveDestinationLiquidity","isMut":true,"isSigner":false},{"name":"userSourceLiquidity","isMut":true,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"}]},{"name":"repayObligationLiquidityV2","accounts":[{"name":"repayAccounts","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"repayReserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveDestinationLiquidity","isMut":true,"isSigner":false},{"name":"userSourceLiquidity","isMut":true,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"farmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"farmsProgram","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"}]},{"name":"repayAndWithdrawAndRedeem","accounts":[{"name":"repayAccounts","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"repayReserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveDestinationLiquidity","isMut":true,"isSigner":false},{"name":"userSourceLiquidity","isMut":true,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"withdrawAccounts","accounts":[{"name":"owner","isMut":true,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"withdrawReserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveSourceCollateral","isMut":true,"isSigner":false},{"name":"reserveCollateralMint","isMut":true,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false},{"name":"placeholderUserDestinationCollateral","isMut":false,"isSigner":false,"isOptional":true},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"collateralFarmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"debtFarmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"farmsProgram","isMut":false,"isSigner":false}],"args":[{"name":"repayAmount","type":"u64"},{"name":"withdrawCollateralAmount","type":"u64"}]},{"name":"depositAndWithdraw","accounts":[{"name":"depositAccounts","accounts":[{"name":"owner","isMut":true,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"reserveCollateralMint","isMut":true,"isSigner":false},{"name":"reserveDestinationDepositCollateral","isMut":true,"isSigner":false},{"name":"userSourceLiquidity","isMut":true,"isSigner":false},{"name":"placeholderUserDestinationCollateral","isMut":false,"isSigner":false,"isOptional":true},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"withdrawAccounts","accounts":[{"name":"owner","isMut":true,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"withdrawReserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveSourceCollateral","isMut":true,"isSigner":false},{"name":"reserveCollateralMint","isMut":true,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false},{"name":"placeholderUserDestinationCollateral","isMut":false,"isSigner":false,"isOptional":true},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"depositFarmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"withdrawFarmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"farmsProgram","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"},{"name":"withdrawCollateralAmount","type":"u64"}]},{"name":"depositReserveLiquidityAndObligationCollateral","accounts":[{"name":"owner","isMut":true,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"reserveCollateralMint","isMut":true,"isSigner":false},{"name":"reserveDestinationDepositCollateral","isMut":true,"isSigner":false},{"name":"userSourceLiquidity","isMut":true,"isSigner":false},{"name":"placeholderUserDestinationCollateral","isMut":false,"isSigner":false,"isOptional":true},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"}]},{"name":"depositReserveLiquidityAndObligationCollateralV2","accounts":[{"name":"depositAccounts","accounts":[{"name":"owner","isMut":true,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"reserveCollateralMint","isMut":true,"isSigner":false},{"name":"reserveDestinationDepositCollateral","isMut":true,"isSigner":false},{"name":"userSourceLiquidity","isMut":true,"isSigner":false},{"name":"placeholderUserDestinationCollateral","isMut":false,"isSigner":false,"isOptional":true},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"farmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"farmsProgram","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"}]},{"name":"withdrawObligationCollateralAndRedeemReserveCollateral","accounts":[{"name":"owner","isMut":true,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"withdrawReserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveSourceCollateral","isMut":true,"isSigner":false},{"name":"reserveCollateralMint","isMut":true,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false},{"name":"placeholderUserDestinationCollateral","isMut":false,"isSigner":false,"isOptional":true},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"collateralAmount","type":"u64"}]},{"name":"withdrawObligationCollateralAndRedeemReserveCollateralV2","accounts":[{"name":"withdrawAccounts","accounts":[{"name":"owner","isMut":true,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"withdrawReserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveSourceCollateral","isMut":true,"isSigner":false},{"name":"reserveCollateralMint","isMut":true,"isSigner":false},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false},{"name":"placeholderUserDestinationCollateral","isMut":false,"isSigner":false,"isOptional":true},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"farmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"farmsProgram","isMut":false,"isSigner":false}],"args":[{"name":"collateralAmount","type":"u64"}]},{"name":"liquidateObligationAndRedeemReserveCollateral","accounts":[{"name":"liquidator","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"repayReserve","isMut":true,"isSigner":false},{"name":"repayReserveLiquidityMint","isMut":false,"isSigner":false},{"name":"repayReserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"withdrawReserve","isMut":true,"isSigner":false},{"name":"withdrawReserveLiquidityMint","isMut":false,"isSigner":false},{"name":"withdrawReserveCollateralMint","isMut":true,"isSigner":false},{"name":"withdrawReserveCollateralSupply","isMut":true,"isSigner":false},{"name":"withdrawReserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"withdrawReserveLiquidityFeeReceiver","isMut":true,"isSigner":false},{"name":"userSourceLiquidity","isMut":true,"isSigner":false},{"name":"userDestinationCollateral","isMut":true,"isSigner":false},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"repayLiquidityTokenProgram","isMut":false,"isSigner":false},{"name":"withdrawLiquidityTokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"},{"name":"minAcceptableReceivedLiquidityAmount","type":"u64"},{"name":"maxAllowedLtvOverridePercent","type":"u64"}]},{"name":"liquidateObligationAndRedeemReserveCollateralV2","accounts":[{"name":"liquidationAccounts","accounts":[{"name":"liquidator","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"repayReserve","isMut":true,"isSigner":false},{"name":"repayReserveLiquidityMint","isMut":false,"isSigner":false},{"name":"repayReserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"withdrawReserve","isMut":true,"isSigner":false},{"name":"withdrawReserveLiquidityMint","isMut":false,"isSigner":false},{"name":"withdrawReserveCollateralMint","isMut":true,"isSigner":false},{"name":"withdrawReserveCollateralSupply","isMut":true,"isSigner":false},{"name":"withdrawReserveLiquiditySupply","isMut":true,"isSigner":false},{"name":"withdrawReserveLiquidityFeeReceiver","isMut":true,"isSigner":false},{"name":"userSourceLiquidity","isMut":true,"isSigner":false},{"name":"userDestinationCollateral","isMut":true,"isSigner":false},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false},{"name":"collateralTokenProgram","isMut":false,"isSigner":false},{"name":"repayLiquidityTokenProgram","isMut":false,"isSigner":false},{"name":"withdrawLiquidityTokenProgram","isMut":false,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"collateralFarmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"debtFarmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"farmsProgram","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"},{"name":"minAcceptableReceivedLiquidityAmount","type":"u64"},{"name":"maxAllowedLtvOverridePercent","type":"u64"}]},{"name":"flashRepayReserveLiquidity","accounts":[{"name":"userTransferAuthority","isMut":false,"isSigner":true},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveDestinationLiquidity","isMut":true,"isSigner":false},{"name":"userSourceLiquidity","isMut":true,"isSigner":false},{"name":"reserveLiquidityFeeReceiver","isMut":true,"isSigner":false},{"name":"referrerTokenState","isMut":true,"isSigner":false,"isOptional":true},{"name":"referrerAccount","isMut":true,"isSigner":false,"isOptional":true},{"name":"sysvarInfo","isMut":false,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"},{"name":"borrowInstructionIndex","type":"u8"}]},{"name":"flashBorrowReserveLiquidity","accounts":[{"name":"userTransferAuthority","isMut":false,"isSigner":true},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveSourceLiquidity","isMut":true,"isSigner":false},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false},{"name":"reserveLiquidityFeeReceiver","isMut":true,"isSigner":false},{"name":"referrerTokenState","isMut":true,"isSigner":false,"isOptional":true},{"name":"referrerAccount","isMut":true,"isSigner":false,"isOptional":true},{"name":"sysvarInfo","isMut":false,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false}],"args":[{"name":"liquidityAmount","type":"u64"}]},{"name":"requestElevationGroup","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false}],"args":[{"name":"elevationGroup","type":"u8"}]},{"name":"initReferrerTokenState","accounts":[{"name":"payer","isMut":true,"isSigner":true},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"reserve","isMut":false,"isSigner":false},{"name":"referrer","isMut":false,"isSigner":false},{"name":"referrerTokenState","isMut":true,"isSigner":false},{"name":"rent","isMut":false,"isSigner":false},{"name":"systemProgram","isMut":false,"isSigner":false}],"args":[]},{"name":"initUserMetadata","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"feePayer","isMut":true,"isSigner":true},{"name":"userMetadata","isMut":true,"isSigner":false},{"name":"referrerUserMetadata","isMut":false,"isSigner":false,"isOptional":true},{"name":"rent","isMut":false,"isSigner":false},{"name":"systemProgram","isMut":false,"isSigner":false}],"args":[{"name":"userLookupTable","type":"publicKey"}]},{"name":"withdrawReferrerFees","accounts":[{"name":"referrer","isMut":true,"isSigner":true},{"name":"referrerTokenState","isMut":true,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveSupplyLiquidity","isMut":true,"isSigner":false},{"name":"referrerTokenAccount","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false},{"name":"tokenProgram","isMut":false,"isSigner":false}],"args":[]},{"name":"initReferrerStateAndShortUrl","accounts":[{"name":"referrer","isMut":true,"isSigner":true},{"name":"referrerState","isMut":true,"isSigner":false},{"name":"referrerShortUrl","isMut":true,"isSigner":false},{"name":"referrerUserMetadata","isMut":false,"isSigner":false},{"name":"rent","isMut":false,"isSigner":false},{"name":"systemProgram","isMut":false,"isSigner":false}],"args":[{"name":"shortUrl","type":"string"}]},{"name":"deleteReferrerStateAndShortUrl","accounts":[{"name":"referrer","isMut":true,"isSigner":true},{"name":"referrerState","isMut":true,"isSigner":false},{"name":"shortUrl","isMut":true,"isSigner":false},{"name":"rent","isMut":false,"isSigner":false},{"name":"systemProgram","isMut":false,"isSigner":false}],"args":[]},{"name":"setObligationOrder","accounts":[{"name":"owner","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false}],"args":[{"name":"index","type":"u8"},{"name":"order","type":{"defined":"ObligationOrder"}}]},{"name":"setBorrowOrder","accounts":[{"name":"owner","isMut":false,"isSigner":true,"docs":["The [Self::obligation]'s owner."]},{"name":"obligation","isMut":true,"isSigner":false,"docs":["The obligation to set the [BorrowOrder] on."]},{"name":"lendingMarket","isMut":false,"isSigner":false,"docs":["The [Self::obligation]'s market - needed to validate feature flags and minimum order value."]},{"name":"reserve","isMut":false,"isSigner":false,"docs":["The reserve matching the [Self::debt_liquidity_mint] - needed for the minimum order value","check. On cancellation, this account is ignored (but still must belong to the same market)."]},{"name":"filledDebtDestination","isMut":false,"isSigner":false,"docs":["The [BorrowOrder::filled_debt_destination] to set on order creation. Not editable on order","updates.","Ignored when cancelling the order."]},{"name":"debtLiquidityMint","isMut":false,"isSigner":false,"docs":["The [BorrowOrder::debt_liquidity_mint] to set on order creation. Not editable on order","updates.","Ignored when cancelling the order."]},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false},{"name":"eventAuthority","isMut":false,"isSigner":false},{"name":"program","isMut":false,"isSigner":false}],"args":[{"name":"orderConfig","type":{"defined":"BorrowOrderConfigArgs"}},{"name":"minExpectedCurrentRemainingDebtAmount","type":"u64"}]},{"name":"updateObligationConfig","accounts":[{"name":"owner","isMut":false,"isSigner":true,"docs":["Obligation's owner (signer - only the owner can modify the obligation's configuration)."]},{"name":"obligation","isMut":true,"isSigner":false,"docs":["The obligation to update."]},{"name":"borrowReserve","isMut":false,"isSigner":false,"isOptional":true,"docs":["The reserve of a selected one among the [Obligation::borrows].","","Required only if the config update affects a single borrow (for validating its new config)."]},{"name":"depositReserve","isMut":false,"isSigner":false,"isOptional":true,"docs":["The reserve of a selected one among the [Obligation::deposits].","","Required only if the config update affects a single deposit (for validating its new config)."]},{"name":"lendingMarket","isMut":false,"isSigner":false,"docs":["The lending market (for validating the obligation's new config)."]}],"args":[{"name":"mode","type":{"defined":"UpdateObligationConfigMode"}},{"name":"value","type":"bytes"}]},{"name":"rolloverFixedTermBorrow","accounts":[{"name":"rolloverAccounts","accounts":[{"name":"payer","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false,"docs":["The obligation with a borrow to be rolled over (or migrated)."]},{"name":"lendingMarket","isMut":false,"isSigner":false,"docs":["The [Self::obligation]'s market, needed for validations against the market-wide","configuration."]},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false,"docs":["The [Self::lending_market]'s authority, needed to transfer the newly-borrowed funds out of","the [Self::reserve_source_liquidity]."]},{"name":"sourceBorrowReserve","isMut":true,"isSigner":false,"docs":["The reserve used by the existing [Self::obligation]'s borrow that needs to rollover from."]},{"name":"targetBorrowReserve","isMut":true,"isSigner":false,"docs":["The reserve to rollover the borrow into - possibly (but not necessarily) the same as","[Self::source_borrow_reserve]'s (but definitely of the same liquidity mint)."]},{"name":"liquidityMint","isMut":false,"isSigner":false,"docs":["The mint of [Self::source_borrow_reserve] and [Self::target_borrow_reserve], needed to","transfer funds between them."]},{"name":"sourceBorrowReserveLiquidity","isMut":true,"isSigner":false,"docs":["The vault of [Self::source_borrow_reserve], from which the funds are transferred."]},{"name":"targetBorrowReserveLiquidity","isMut":true,"isSigner":false,"docs":["The vault of [Self::target_borrow_reserve], from which the funds are transferred."]},{"name":"tokenProgram","isMut":false,"isSigner":false,"docs":["The token program of [Self::liquidity_mint] - needed to execute the transfer."]}]},{"name":"sourceFarmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"targetFarmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"farmsProgram","isMut":false,"isSigner":false}],"args":[]},{"name":"fillBorrowOrder","accounts":[{"name":"borrowAccounts","accounts":[{"name":"payer","isMut":false,"isSigner":true},{"name":"obligation","isMut":true,"isSigner":false,"docs":["The obligation with a [BorrowOrder]."]},{"name":"lendingMarket","isMut":false,"isSigner":false,"docs":["The [Self::obligation]'s market - needed for borrowing-related configuration."]},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false,"docs":["The [Self::lending_market]'s authority, needed to transfer the newly-borrowed funds out of","the [Self::reserve_source_liquidity]."]},{"name":"borrowReserve","isMut":true,"isSigner":false,"docs":["The reserve to borrow from.","","Its mint must match the asset requested by the [BorrowOrder::debt_liquidity_mint]."]},{"name":"borrowReserveLiquidityMint","isMut":false,"isSigner":false,"docs":["The mint of [Self::borrow_reserve] - needed to execute the transfer."]},{"name":"reserveSourceLiquidity","isMut":true,"isSigner":false,"docs":["The vault of [Self::borrow_reserve], from which the funds are transferred."]},{"name":"borrowReserveLiquidityFeeReceiver","isMut":true,"isSigner":false,"docs":["The fee vault of [Self::borrow_reserve], to which the fees are transferred."]},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false,"docs":["The destination token account that should receive the newly borrowed funds.","","It must match [BorrowOrder::filled_debt_destination], owner and mint.","","**Warning:** An altered destination account will prevent an order from being filled."]},{"name":"referrerTokenState","isMut":true,"isSigner":false,"isOptional":true,"docs":["The referrer's account, for accumulating fees - needed if the [Obligation::has_referrer]."]},{"name":"tokenProgram","isMut":false,"isSigner":false,"docs":["The token program of [Self::borrow_reserve] - needed to execute the transfer."]},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}]},{"name":"farmsAccounts","accounts":[{"name":"obligationFarmUserState","isMut":true,"isSigner":false,"isOptional":true},{"name":"reserveFarmState","isMut":true,"isSigner":false,"isOptional":true}]},{"name":"farmsProgram","isMut":false,"isSigner":false},{"name":"eventAuthority","isMut":false,"isSigner":false},{"name":"program","isMut":false,"isSigner":false}],"args":[]},{"name":"initiateObligationOwnershipTransfer","accounts":[{"name":"owner","isMut":false,"isSigner":true,"docs":["Current owner must sign this transaction"]},{"name":"obligation","isMut":true,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"newOwner","type":"publicKey"}]},{"name":"approveObligationOwnershipTransfer","accounts":[{"name":"globalAdmin","isMut":false,"isSigner":true,"docs":["Global admin must sign this transaction"]},{"name":"globalConfig","isMut":false,"isSigner":false},{"name":"obligation","isMut":true,"isSigner":false},{"name":"pendingOwner","isMut":false,"isSigner":false,"docs":["The pending owner that will receive ownership after acceptance.","Must match the pending_owner stored in the obligation."]}],"args":[]},{"name":"acceptObligationOwnership","accounts":[{"name":"pendingOwner","isMut":false,"isSigner":true,"docs":["Pending owner must sign this transaction"]},{"name":"obligation","isMut":true,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[]},{"name":"abortObligationOwnershipTransfer","accounts":[{"name":"owner","isMut":false,"isSigner":true,"docs":["Current owner must sign this transaction"]},{"name":"obligation","isMut":true,"isSigner":false},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[]},{"name":"enqueueToWithdraw","accounts":[{"name":"owner","isMut":true,"isSigner":true,"docs":["The depositor holding ctokens."]},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false,"docs":["The market's authority, needed to initialize the [Self::owner_queued_collateral_vault]."]},{"name":"reserve","isMut":true,"isSigner":false},{"name":"userSourceCollateralTa","isMut":true,"isSigner":false,"docs":["The source of collateral to be enqueued."]},{"name":"userDestinationLiquidityTa","isMut":false,"isSigner":false,"docs":["The account to which the liquidity should be finally transferred later (to be recorded in","the ticket)."]},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false},{"name":"reserveCollateralMint","isMut":false,"isSigner":false},{"name":"collateralTokenProgram","isMut":false,"isSigner":false,"docs":["The collateral's program - needed for invoking the transfer to the vault *and* (implicitly)","for handling the `init_if_needed`."]},{"name":"withdrawTicket","isMut":true,"isSigner":false,"docs":["The new account to be initialized with the issued ticket's data."]},{"name":"ownerQueuedCollateralVault","isMut":true,"isSigner":false,"docs":["The per-owner \"this reserve's queued collateral\" vault (in which the collateral will be","locked)."]},{"name":"systemProgram","isMut":false,"isSigner":false,"docs":["The System program - needed only for `init` / `init_if_needed` of the accounts above."]},{"name":"progressCallbackCustomAccount0","isMut":false,"isSigner":false,"isOptional":true,"docs":["The first one out of maximum 2 custom accounts that may be required if the optional \"ticket","progress callback\" is configured for this ticket.","","The expected custom accounts are validated based on the `progress_callback_type` instruction","argument. The currently supported ones are:","- for [ProgressCallbackType::None] no custom accounts are expected (this is the default","behavior, when the instruction data is zeroed or absent).","- for [ProgressCallbackType::KlendQueueAccountingHandlerOnKvault], only the `_0` custom","account is required:","- the `_0` custom account must represent the `VaultState` which disinvests from the","reserve (readonly; needed to be later passed as an input to the Kvault's handler);","- the `_1` custom account is ignored;","- the `owner` account (i.e. the signer) must be a Kvault-owned PDA base authority","associated with the vault indicated by `_0` (needed to prove that Kvault is CPI'ing this","handler)."]},{"name":"progressCallbackCustomAccount1","isMut":false,"isSigner":false,"isOptional":true,"docs":["The second possible account (see the `progress_callback_custom_account_0` above)."]},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"collateralAmount","type":"u64"},{"name":"progressCallbackType","type":{"defined":"ProgressCallbackType"}}]},{"name":"withdrawQueuedLiquidity","accounts":[{"name":"payer","isMut":true,"isSigner":true,"docs":["The executor of the permissionless tx (not necessarily the ticket owner)."]},{"name":"lendingMarket","isMut":false,"isSigner":false,"docs":["The lending market."]},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false,"docs":["The market's authority, needed for burning the collateral (from","[Self::owner_queued_collateral_vault]) and transferring the liquidity (from","[Self::reserve_liquidity_supply])."]},{"name":"reserve","isMut":true,"isSigner":false,"docs":["The reserve."]},{"name":"reserveLiquidityMint","isMut":false,"isSigner":false,"docs":["The liquidity mint, needed to invoke the transfer."]},{"name":"reserveCollateralMint","isMut":true,"isSigner":false,"docs":["The collateral mint, needed to burn (`mut`!) the queued collateral."]},{"name":"reserveLiquiditySupply","isMut":true,"isSigner":false,"docs":["The liquidity supply vault (to withdraw the liquidity from)."]},{"name":"ownerQueuedCollateralVault","isMut":true,"isSigner":false,"docs":["The per-owner \"this reserve's queued collateral\" vault (from which the collateral will be","burnt)."]},{"name":"userDestinationLiquidity","isMut":true,"isSigner":false,"docs":["The token account to which the liquidity should be transferred (the one recorded in the","ticket)."]},{"name":"collateralTokenProgram","isMut":false,"isSigner":false,"docs":["The program of [Self::reserve_collateral_mint], needed for transfer."]},{"name":"liquidityTokenProgram","isMut":false,"isSigner":false,"docs":["The program of [Self::reserve_liquidity_mint], needed for transfer."]},{"name":"withdrawTicket","isMut":true,"isSigner":false,"docs":["The ticket's data itself.","","Note: in case of complete withdrawal, this account will be closed. In case of partial","withdrawal, its [WithdrawTicket::queued_collateral_amount] will simply be reduced, and the","ticket will maintain its position in the queue."]},{"name":"withdrawTicketOwner","isMut":true,"isSigner":false,"docs":["The owner of the [Self::withdraw_ticket]; needed only to return the rent of the","[WithdrawTicket] account (if it is getting fully-consumed and closed here)."]},{"name":"associatedTokenProgram","isMut":false,"isSigner":false,"docs":["The ATA program - needed for potential destination ATA creation."]},{"name":"systemProgram","isMut":false,"isSigner":false,"docs":["The System program - needed for potential destination ATA creation."]},{"name":"progressCallbackProgram","isMut":false,"isSigner":false,"isOptional":true,"docs":["The progress callback program (if configured by the withdraw ticket)."]},{"name":"progressCallbackCustomAccount0","isMut":false,"isSigner":false,"isOptional":true,"docs":["The first one out of maximum 2 custom accounts that may be required if the withdraw ticket","defines a callback.","Please note that the constraints defined here do not mention `mut`, but a specific","[WithdrawTicket::progress_callback_type] may require it."]},{"name":"progressCallbackCustomAccount1","isMut":false,"isSigner":false,"isOptional":true,"docs":["The second possibly-required account (see the `progress_callback_custom_account_0` above)."]},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[],"returns":"bool"},{"name":"recoverInvalidTicketCollateral","accounts":[{"name":"payer","isMut":false,"isSigner":true,"docs":["The transaction executor.","","This instruction is, in principle, permissionless. However, only the ticket owner can use","arbitrary token account as destination for recovered collateral. Other signers can only","transfer the collateral to the ticket owner's ATA (see [Self::user_source_collateral])."]},{"name":"lendingMarket","isMut":false,"isSigner":false,"docs":["The lending market."]},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false,"docs":["The market's authority, needed for transferring the collateral (from","[Self::owner_queued_collateral_vault])."]},{"name":"reserve","isMut":false,"isSigner":false,"docs":["The reserve, needed only to validate the other accounts."]},{"name":"reserveCollateralMint","isMut":false,"isSigner":false,"docs":["The collateral mint, needed to invoke the transfer."]},{"name":"ownerQueuedCollateralVault","isMut":true,"isSigner":false,"docs":["The per-owner \"this reserve's queued collateral\" vault (from which the collateral will be","recovered)."]},{"name":"userSourceCollateral","isMut":true,"isSigner":false,"docs":["The ticket's owner token account to which the ticket-locked collateral should be returned.","","Only the ticket's owner can indicate an arbitrary token account here. Permissionless","executors must indicate the ticket's owner ATA."]},{"name":"collateralTokenProgram","isMut":false,"isSigner":false,"docs":["The program of [Self::reserve_collateral_mint], needed for transfer."]},{"name":"withdrawTicket","isMut":true,"isSigner":false,"docs":["The ticket's account, necessarily marked as [WithdrawTicket::invalid] first (by the","`handler_withdraw_queued_liquidity`)."]},{"name":"withdrawTicketOwner","isMut":true,"isSigner":false,"docs":["The owner of the [Self::withdraw_ticket]; needed only to return the rent of the","[WithdrawTicket] account."]},{"name":"instructionSysvarAccount","isMut":false,"isSigner":false}],"args":[{"name":"ticketSequenceNumber","type":"u64"}]},{"name":"cancelWithdrawTicket","accounts":[{"name":"owner","isMut":false,"isSigner":true,"docs":["The ticket owner (i.e. the only allowed to cancel their ticket)."]},{"name":"lendingMarket","isMut":false,"isSigner":false,"docs":["The lending market."]},{"name":"lendingMarketAuthority","isMut":false,"isSigner":false,"docs":["The market's authority, needed for transferring the collateral (from","[Self::owner_queued_collateral_vault])."]},{"name":"reserve","isMut":true,"isSigner":false,"docs":["The reserve."]},{"name":"reserveCollateralMint","isMut":false,"isSigner":false,"docs":["The collateral mint, needed to invoke the transfer."]},{"name":"ownerQueuedCollateralVault","isMut":true,"isSigner":false,"docs":["The per-owner \"this reserve's queued collateral\" vault (from which the collateral will be","transferred back to the owner)."]},{"name":"userDestinationCollateral","isMut":true,"isSigner":false,"docs":["Destination for returned ctokens (owner's token account)."]},{"name":"collateralTokenProgram","isMut":false,"isSigner":false,"docs":["The program of [Self::reserve_collateral_mint], needed for transfer."]},{"name":"withdrawTicket","isMut":true,"isSigner":false,"docs":["Ticket to cancel - remains as tombstone until queue processes it."]}],"args":[{"name":"ticketSequenceNumber","type":"u64"},{"name":"collateralAmountToCancel","type":"u64"}]},{"name":"initGlobalConfig","accounts":[{"name":"payer","isMut":true,"isSigner":true},{"name":"globalConfig","isMut":true,"isSigner":false},{"name":"programData","isMut":false,"isSigner":false},{"name":"systemProgram","isMut":false,"isSigner":false},{"name":"rent","isMut":false,"isSigner":false}],"args":[]},{"name":"updateGlobalConfig","accounts":[{"name":"globalAdmin","isMut":false,"isSigner":true},{"name":"globalConfig","isMut":true,"isSigner":false}],"args":[{"name":"mode","type":{"defined":"UpdateGlobalConfigMode"}},{"name":"value","type":"bytes"}]},{"name":"updateGlobalConfigAdmin","accounts":[{"name":"pendingAdmin","isMut":false,"isSigner":true},{"name":"globalConfig","isMut":true,"isSigner":false}],"args":[]},{"name":"idlMissingTypes","accounts":[{"name":"signer","isMut":false,"isSigner":true},{"name":"globalConfig","isMut":false,"isSigner":false},{"name":"lendingMarket","isMut":false,"isSigner":false},{"name":"reserve","isMut":true,"isSigner":false}],"args":[{"name":"reserveFarmKind","type":{"defined":"ReserveFarmKind"}},{"name":"feeCalculation","type":{"defined":"FeeCalculation"}},{"name":"reserveStatus","type":{"defined":"ReserveStatus"}},{"name":"updateConfigMode","type":{"defined":"UpdateConfigMode"}},{"name":"updateLendingMarketConfigValue","type":{"defined":"UpdateLendingMarketConfigValue"}},{"name":"updateLendingMarketConfigMode","type":{"defined":"UpdateLendingMarketMode"}}]}],"accounts":[{"name":"UserState","type":{"kind":"struct","fields":[{"name":"userId","type":"u64"},{"name":"farmState","type":"publicKey"},{"name":"owner","type":"publicKey"},{"name":"isFarmDelegated","type":"u8"},{"name":"padding0","type":{"array":["u8",7]}},{"name":"rewardsTallyScaled","type":{"array":["u128",10]}},{"name":"rewardsIssuedUnclaimed","type":{"array":["u64",10]}},{"name":"lastClaimTs","type":{"array":["u64",10]}},{"name":"activeStakeScaled","type":"u128"},{"name":"pendingDepositStakeScaled","type":"u128"},{"name":"pendingDepositStakeTs","type":"u64"},{"name":"pendingWithdrawalUnstakeScaled","type":"u128"},{"name":"pendingWithdrawalUnstakeTs","type":"u64"},{"name":"bump","type":"u64"},{"name":"delegatee","type":"publicKey"},{"name":"lastStakeTs","type":"u64"},{"name":"padding1","type":{"array":["u64",50]}}]}},{"name":"GlobalConfig","type":{"kind":"struct","fields":[{"name":"globalAdmin","docs":["Global admin of the program"],"type":"publicKey"},{"name":"pendingAdmin","docs":["Pending admin must sign a specific transaction to become the global admin"],"type":"publicKey"},{"name":"feeCollector","docs":["Fee collector is the only allowed owner of token accounts receiving protocol fees"],"type":"publicKey"},{"name":"padding","docs":["Padding to make the struct size 1024 bytes"],"type":{"array":["u8",928]}}]}},{"name":"LendingMarket","type":{"kind":"struct","fields":[{"name":"version","docs":["Version of lending market"],"type":"u64"},{"name":"bumpSeed","docs":["Bump seed for derived authority address"],"type":"u64"},{"name":"lendingMarketOwner","docs":["Owner authority which can add new reserves"],"type":"publicKey"},{"name":"lendingMarketOwnerCached","docs":["Temporary cache of the lending market owner, used in update_lending_market_owner"],"type":"publicKey"},{"name":"quoteCurrency","docs":["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 pubkey"],"type":{"array":["u8",32]}},{"name":"referralFeeBps","docs":["Referral fee for the lending market, as bps out of the total protocol fee"],"type":"u16"},{"name":"emergencyMode","type":"u8"},{"name":"autodeleverageEnabled","docs":["Whether the obligations on this market should be subject to auto-deleveraging after deposit","or borrow limit is crossed.","Besides this flag, the particular reserve's flag also needs to be enabled (logical `AND`).","**NOTE:** this also affects the individual \"target LTV\" deleveraging."],"type":"u8"},{"name":"borrowDisabled","type":"u8"},{"name":"priceRefreshTriggerToMaxAgePct","docs":["Refresh price from oracle only if it's older than this percentage of the price max age.","e.g. if the max age is set to 100s and this is set to 80%, the price will be refreshed if it's older than 80s.","Price is always refreshed if this set to 0."],"type":"u8"},{"name":"liquidationMaxDebtCloseFactorPct","docs":["Percentage of the total borrowed value in an obligation available for liquidation"],"type":"u8"},{"name":"insolvencyRiskUnhealthyLtvPct","docs":["Minimum acceptable unhealthy LTV before max_debt_close_factor_pct becomes 100%"],"type":"u8"},{"name":"minFullLiquidationValueThreshold","docs":["Minimum liquidation value threshold triggering full liquidation for an obligation, in full","units of the quote currency (e.g. `2` means \"$2\", not \"2 lamports of USDC\")."],"type":"u64"},{"name":"maxLiquidatableDebtMarketValueAtOnce","docs":["Max allowed liquidation value in one ix call"],"type":"u64"},{"name":"reserved0","docs":["[DEPRECATED] Global maximum unhealthy borrow value allowed for any obligation"],"type":{"array":["u8",8]}},{"name":"globalAllowedBorrowValue","docs":["Global maximum allowed borrow value allowed for any obligation"],"type":"u64"},{"name":"emergencyCouncil","docs":["The address of the emergency council, in charge of taking emergency actions on the market (e.g., enabling emergency mode)"],"type":"publicKey"},{"name":"reserved1","docs":["[DEPRECATED] Reward points multiplier per obligation type"],"type":{"array":["u8",8]}},{"name":"elevationGroups","docs":["Elevation groups are used to group together reserves that have the same risk parameters and can bump the ltv and liquidation threshold"],"type":{"array":[{"defined":"ElevationGroup"},32]}},{"name":"elevationGroupPadding","type":{"array":["u64",90]}},{"name":"minNetValueInObligationSf","docs":["Min net value accepted to be found in a position after any lending action in an obligation (scaled by quote currency decimals)"],"type":"u128"},{"name":"minValueSkipLiquidationLtvChecks","docs":["Minimum value to enforce smallest ltv priority checks on the collateral reserves on liquidation"],"type":"u64"},{"name":"name","docs":["Market name, zero-padded."],"type":{"array":["u8",32]}},{"name":"minValueSkipLiquidationBfChecks","docs":["Minimum value to enforce highest borrow factor priority checks on the debt reserves on liquidation"],"type":"u64"},{"name":"individualAutodeleverageMarginCallPeriodSecs","docs":["Time (in seconds) that must pass before liquidation is allowed on an obligation that has","been individually marked for auto-deleveraging."],"type":"u64"},{"name":"minInitialDepositAmount","docs":["Minimum amount of deposit at creation of a reserve to prevent artificial inflation","Note: this amount cannot be recovered, the ctoken associated are never minted"],"type":"u64"},{"name":"obligationOrderExecutionEnabled","docs":["Whether the obligation orders should be evaluated during liquidations."],"type":"u8"},{"name":"immutable","docs":["Whether the lending market is set as immutable."],"type":"u8"},{"name":"obligationOrderCreationEnabled","docs":["Whether new obligation orders can be created.","Note: updating or cancelling existing orders is *not* affected by this flag."],"type":"u8"},{"name":"priceTriggeredLiquidationDisabled","docs":["Whether the liquidation operations that are triggered by price changes should be disabled.","This includes regular liquidation (i.e. LTV exceeding the unhealthy threshold) and some","obligation orders' execution.","","*Caution:* this flag is *disabling* the liquidations when `1` - contrary to all the other","liquidation-driving flags (see e.g. [Self::autodeleverage_enabled])."],"type":"u8"},{"name":"matureReserveDebtLiquidationEnabled","docs":["Whether the debts that reached their reserve's [ReserveConfig::debt_maturity_timestamp] can","be liquidated."],"type":"u8"},{"name":"obligationBorrowDebtTermLiquidationEnabled","docs":["Whether the [Obligation::borrows] that reached their [ReserveConfig::debt_term_seconds] can","be liquidated."],"type":"u8"},{"name":"borrowOrderCreationEnabled","docs":["Whether new borrow orders can be created.","Note: updating or cancelling existing orders is *not* affected by this flag."],"type":"u8"},{"name":"borrowOrderExecutionEnabled","docs":["Whether the existing borrow orders can be filled."],"type":"u8"},{"name":"proposerAuthority","docs":["Authority that can propose creating of new reserves but cannot enable them."],"type":"publicKey"},{"name":"minBorrowOrderFillValue","docs":["Minimum value that can be filled in a single `fill_borrow_order()` call, in full units of","the quote currency (e.g. `2` means \"$2\", not \"2 lamports of USDC\")."],"type":"u64"},{"name":"withdrawTicketIssuanceEnabled","docs":["Whether any new withdraw tickets can be issued (i.e. whether new requests can enter the","withdraw queue)."],"type":"u8"},{"name":"withdrawTicketRedemptionEnabled","docs":["Whether the existing withdraw tickets can be redeemed (i.e. whether the tickets can be used","to transfer accumulated pending liquidity to destination accounts)."],"type":"u8"},{"name":"obligationBorrowRolloverConfigurationEnabled","docs":["Whether the owners can enable the borrow rollover/migration on their obligations.","","*Note 1:* the actual execution of (different kinds of) rollovers are enabled/disabled by:","- [Self::fixed_term_rollover_window_duration_seconds],","- [Self::open_term_rollover_window_duration_seconds],","- [Self::obligation_borrow_migration_to_fixed_execution_enabled].","","*Note 2:* when this configuration is disabled, the obligation owners can still disable their","rollover (i.e. set the obligation's flags to zeroes)."],"type":"u8"},{"name":"obligationBorrowMigrationToFixedExecutionEnabled","docs":["Whether the actual execution of a \"migration to fixed\" rollover flavor is allowed.","","See [FixedTermBorrowRolloverConfig::migration_to_fixed_enabled]."],"type":"u8"},{"name":"withdrawTicketCancellationEnabled","docs":["Whether the ticket owners can cancel their withdraw tickets (i.e. recover ctokens from the","queued collateral vault back to their wallet)."],"type":"u8"},{"name":"padding2","type":{"array":["u8",1]}},{"name":"reserveRewardsMaxAprBps","docs":["Maximum APR (in basis points; `FULL_BPS = 10_000` = 100%) at which reserves on this market","may distribute their `rewards_amount_per_slot`. `0` disables rewards on this market","entirely (`topup_reserve_rewards` is rejected). Bounded by `FULL_BPS` (100% APR) when set.","See [ReserveConfig::rewards_amount_per_slot] for the depositor-cap interaction."],"type":"u16"},{"name":"minWithdrawQueuedLiquidityValue","docs":["Minimum value that can be withdrawn in a single `withdraw_queued_liquidity()` call, in full","units of the quote currency (e.g. `2` means \"$2\", not \"2 lamports of USDC\")."],"type":"u64"},{"name":"fixedTermRolloverWindowDurationSeconds","docs":["A configurable time window (right before the end of a fixed debt term) during which an","auto-rollover into another *fixed* rate/term can happen.","","When zeroed, this rollover mode is effectively disabled.","Can only be enabled when [Self::min_partial_rollover_value] is configured.","","See [FixedTermBorrowRolloverConfig]."],"type":"u64"},{"name":"openTermRolloverWindowDurationSeconds","docs":["A configurable time window (right before the end of a fixed debt term) during which an","auto-rollover into a *variable* (indefinite) rate/term can happen.","","When zeroed, this rollover mode is effectively disabled.","Can only be enabled when [Self::min_partial_rollover_value] is configured.","","This will typically be shorter than [Self::fixed_term_rollover_window_duration_seconds],","acting as a fallback if a fixed reserve liquidity remains unavailable for considerable time."],"type":"u64"},{"name":"minPartialRolloverValue","docs":["Minimum dollar value for a partial rollover into a different reserve.","When the achievable rollover amount is below this threshold (and it's not a full rollover),","the rollover is rejected.","","In full units of the quote currency (e.g. `2` means \"$2\")."],"type":"u64"},{"name":"termBasedFullLiquidationDurationSecs","docs":["The time that must pass before an entire expired debt becomes liquidatable.","","For example:","Let's assume this duration is configured as 100 seconds; then:","- right after fixed-term debt expiration, effectively no debt can be liquidated.","- 30 seconds after expiration, we allow to 30% of the expired debt to be liquidated","- to be specific: at this point in time, we \"protect\" from liquidation 70% of the","[ObligationLiquidity::borrowed_amount_at_expiration] (regardless of how much interest","was accrued or how much debt was repaid while expired).","- 100 seconds after expiration we allow the entire debt to be liquidated.","","Only effective when [Self::obligation_borrow_debt_term_liquidation_enabled].","","Motivation note: this throttling feature gives an opportunity to execute a configured","auto-rollover (after a partial liquidation brings the debt size down so that there is enough","available liquidity in some compatible reserve).","","When zeroed, an entire expired debt can be liquidated right after expiration (i.e. no","throttling)."],"type":"u64"},{"name":"permissioningAuthority","docs":["If not NULL, operations encoded in permissioned_ops require a signature from this authority"],"type":"publicKey"},{"name":"permissionedOps","docs":["Bitmap of operations that require permissioning authority signature"],"type":"u64"},{"name":"padding1","type":{"array":["u64",153]}}]}},{"name":"Obligation","docs":["Lending market obligation state"],"type":{"kind":"struct","fields":[{"name":"tag","docs":["Version of the struct"],"type":"u64"},{"name":"lastUpdate","docs":["Last update to collateral, liquidity, or their market values"],"type":{"defined":"LastUpdate"}},{"name":"lendingMarket","docs":["Lending market address"],"type":"publicKey"},{"name":"owner","docs":["Owner authority which can borrow liquidity"],"type":"publicKey"},{"name":"deposits","docs":["Deposited collateral for the obligation, unique by deposit reserve address"],"type":{"array":[{"defined":"ObligationCollateral"},8]}},{"name":"lowestReserveDepositLiquidationLtv","docs":["Worst LTV for the collaterals backing the loan, represented as a percentage"],"type":"u64"},{"name":"depositedValueSf","docs":["Market value of deposits (scaled fraction)"],"type":"u128"},{"name":"borrows","docs":["Borrowed liquidity for the obligation, unique by borrow reserve address"],"type":{"array":[{"defined":"ObligationLiquidity"},5]}},{"name":"borrowFactorAdjustedDebtValueSf","docs":["Risk adjusted market value of borrows/debt (sum of price * borrowed_amount * borrow_factor) (scaled fraction)"],"type":"u128"},{"name":"borrowedAssetsMarketValueSf","docs":["Market value of borrows - used for max_liquidatable_borrowed_amount (scaled fraction)"],"type":"u128"},{"name":"allowedBorrowValueSf","docs":["The maximum borrow value at the weighted average loan to value ratio (scaled fraction)"],"type":"u128"},{"name":"unhealthyBorrowValueSf","docs":["The dangerous borrow value at the weighted average liquidation threshold (scaled fraction)"],"type":"u128"},{"name":"paddingDeprecatedAssetTiers","docs":["The asset tier of the deposits"],"type":{"array":["u8",13]}},{"name":"elevationGroup","docs":["The elevation group id the obligation opted into."],"type":"u8"},{"name":"numOfObsoleteDepositReserves","docs":["The number of obsolete reserves the obligation has a deposit in"],"type":"u8"},{"name":"hasDebt","docs":["Marked = 1 if borrows array is not empty, 0 = borrows empty"],"type":"u8"},{"name":"referrer","docs":["Wallet address of the referrer"],"type":"publicKey"},{"name":"borrowingDisabled","docs":["Marked = 1 if borrowing disabled, 0 = borrowing enabled"],"type":"u8"},{"name":"autodeleverageTargetLtvPct","docs":["A target LTV set by the market owner when marking this obligation for deleveraging.","Only effective when `deleveraging_margin_call_started_slot != 0`."],"type":"u8"},{"name":"lowestReserveDepositMaxLtvPct","docs":["The lowest max LTV found amongst the collateral deposits"],"type":"u8"},{"name":"numOfObsoleteBorrowReserves","docs":["The number of obsolete reserves the obligation has a borrow in"],"type":"u8"},{"name":"ownershipTransferState","docs":["State of ownership transfer, see [OwnershipTransferState]"],"type":"u8"},{"name":"reserved","type":{"array":["u8",3]}},{"name":"highestBorrowFactorPct","type":"u64"},{"name":"autodeleverageMarginCallStartedTimestamp","docs":["A timestamp at which the market owner most-recently marked this obligation for deleveraging.","Zero if not currently subject to deleveraging."],"type":"u64"},{"name":"obligationOrders","docs":["Owner-defined, permissionlessly-executed repay orders.","Typical use-cases would be a stop-loss and a take-profit (possibly co-existing)."],"type":{"array":[{"defined":"ObligationOrder"},2]}},{"name":"borrowOrder","docs":["Owner-defined, permissionlessly-executed borrow order applicable to this obligation.","Non-zeroed only on a newly-initialized fixed-rate, fixed-term obligation."],"type":{"defined":"BorrowOrder"}},{"name":"pendingOwner","docs":["Pending owner during ownership transfer process.","Pubkey::default() means no pending owner (similar to Option::None)"],"type":"publicKey"},{"name":"padding3","type":{"array":["u64",69]}}]}},{"name":"ReferrerState","type":{"kind":"struct","fields":[{"name":"shortUrl","type":"publicKey"},{"name":"owner","type":"publicKey"}]}},{"name":"ReferrerTokenState","docs":["Referrer account -> each owner can have multiple accounts for specific reserves"],"type":{"kind":"struct","fields":[{"name":"referrer","docs":["Pubkey of the referrer/owner"],"type":"publicKey"},{"name":"mint","docs":["Token mint for the account"],"type":"publicKey"},{"name":"amountUnclaimedSf","docs":["Amount that has been accumulated and not claimed yet -> available to claim (scaled fraction)"],"type":"u128"},{"name":"amountCumulativeSf","docs":["Amount that has been accumulated in total -> both already claimed and unclaimed (scaled fraction)"],"type":"u128"},{"name":"bump","docs":["Referrer token state bump, used for address validation"],"type":"u64"},{"name":"padding","type":{"array":["u64",31]}}]}},{"name":"ShortUrl","type":{"kind":"struct","fields":[{"name":"referrer","type":"publicKey"},{"name":"shortUrl","type":"string"}]}},{"name":"UserMetadata","docs":["Referrer account -> each owner can have multiple accounts for specific reserves"],"type":{"kind":"struct","fields":[{"name":"referrer","docs":["Pubkey of the referrer/owner - pubkey::default if no referrer"],"type":"publicKey"},{"name":"bump","docs":["Bump used for validation of account address"],"type":"u64"},{"name":"userLookupTable","docs":["User lookup table - used to store all user accounts - atas for each reserve mint, each obligation PDA, UserMetadata itself and all referrer_token_states if there is a referrer"],"type":"publicKey"},{"name":"owner","docs":["User metadata account owner"],"type":"publicKey"},{"name":"padding1","type":{"array":["u64",51]}},{"name":"padding2","type":{"array":["u64",64]}}]}},{"name":"Reserve","type":{"kind":"struct","fields":[{"name":"version","docs":["Version of the reserve"],"type":"u64"},{"name":"lastUpdate","docs":["Last slot when supply and rates updated"],"type":{"defined":"LastUpdate"}},{"name":"lendingMarket","docs":["Lending market address"],"type":"publicKey"},{"name":"farmCollateral","type":"publicKey"},{"name":"farmDebt","type":"publicKey"},{"name":"liquidity","docs":["Reserve liquidity"],"type":{"defined":"ReserveLiquidity"}},{"name":"reserveLiquidityPadding","type":{"array":["u64",150]}},{"name":"collateral","docs":["Reserve collateral"],"type":{"defined":"ReserveCollateral"}},{"name":"reserveCollateralPadding","type":{"array":["u64",150]}},{"name":"config","docs":["Reserve configuration values"],"type":{"defined":"ReserveConfig"}},{"name":"configPadding","type":{"array":["u64",112]}},{"name":"borrowedAmountOutsideElevationGroup","type":"u64"},{"name":"borrowedAmountsAgainstThisReserveInElevationGroups","docs":["Amount of token borrowed in lamport of debt asset in the given","elevation group when this reserve is part of the collaterals."],"type":{"array":["u64",32]}},{"name":"withdrawQueue","docs":["The tracker of ticket-based withdrawals."],"type":{"defined":"WithdrawQueue"}},{"name":"padding","type":{"array":["u64",204]}}]}},{"name":"WithdrawTicket","docs":["A finite-lifecycle account representing a specific depositor's place in the withdraw queue of","a specific reserve.","","The lifecycle:","1. The depositor holding ctokens wants to withdraw funds from the reserve, and finds out that","the required amount is not available (due to high utilization).","2. The depositor calls the `enqueue_to_withdraw` handler.","3. The handler transfers the depositor's ctokens to the reserve's internal \"pending\" vault.","4. The handler initializes a new [WithdrawTicket] account, with the next available sequence","number.","5. The depositor waits until his ticket is the next expected one for actual withdraw, and until","the reserve has enough liquidity.","6. Anyone (the depositor or a bot) calls the permissionless `withdraw_queued_liquidity`","handler. If the ticket became invalid (e.g. destination account no longer exists), then the","depositor can call the `recover_invalid_ticket_collateral` handler instead.","7. The handler transfers the liquidity amount according to the current exchange rate.","8. The handler closes the ticket account."],"type":{"kind":"struct","fields":[{"name":"sequenceNumber","docs":["This ticket's place in the queue; the same as used for PDA derivation."],"type":"u64"},{"name":"owner","docs":["The funds' owner (the user who called the `enqueue_to_withdraw` handler)."],"type":"publicKey"},{"name":"reserve","docs":["The reserve to withdraw from."],"type":"publicKey"},{"name":"userDestinationLiquidityTa","docs":["The token account to which the finally-available liquidity should be transferred (by the","`withdraw_queued_liquidity` handler)."],"type":"publicKey"},{"name":"queuedCollateralAmount","docs":["The amount of collateral still waiting to be withdrawn using this ticket."],"type":"u64"},{"name":"createdAtTimestamp","docs":["The timestamp at which the queue was entered.","","This is currently only a piece of metadata, not used by the logic."],"type":"u64"},{"name":"invalid","docs":["Whether the ticket has been found to be invalid (e.g. the [Self::user_destination_liquidity]","has been repurposed) by the `withdraw_queued_liquidity` handler.","To be specific: valid = `0`, invalid = `1`.","","An invalid ticket cannot be made valid again, and can only be passed to the","`recover_invalid_ticket_collateral` handler."],"type":"u8"},{"name":"progressCallbackType","docs":["One of the valid [ProgressCallbackType] representations."],"type":"u8"},{"name":"alignmentPadding","docs":["Inner padding, for alignment."],"type":{"array":["u8",6]}},{"name":"progressCallbackCustomAccounts","docs":["The (optional) accounts to be used by [Self::progress_callback_type]s."],"type":{"array":["publicKey",2]}},{"name":"endPadding","docs":["Trailing padding, for future developments."],"type":{"array":["u64",40]}}]}}],"types":[{"name":"ReserveConfigCustomizationArgs","docs":["A definition of optional customizations that should be applied after cloning the config."],"type":{"kind":"struct","fields":[{"name":"overrideFixedRateBps","docs":["A gate for [Self::fixed_borrow_rate_bps]."],"type":"u8"},{"name":"fixedBorrowRateBps","docs":["If [Self::override_fixed_rate_bps] is non-zero, this borrow rate will be used to override","the [ReserveConfig::borrow_rate_curve] with a fixed one."],"type":"u32"},{"name":"overrideDebtTermSeconds","docs":["A gate for [Self::debt_term_seconds]."],"type":"u8"},{"name":"debtTermSeconds","docs":["If [Self::override_debt_term_seconds] is non-zero, this value will be used to override the","[ReserveConfig::debt_term_seconds]."],"type":"u64"},{"name":"clearElevationGroups","docs":["Whether the target reserve should have zeroed [ReserveConfig::elevation_groups] (i.e. not","cloned from source).","","This customization is mandatory when cloning a reserve (with some elevation groups) into a","different market (where those elevation group indices would have different meaning)."],"type":"u8"}]}},{"name":"BorrowOrderConfigArgs","docs":["A subset of [BorrowOrderConfig] excluding the accounts passed via [SetBorrowOrder]."],"type":{"kind":"struct","fields":[{"name":"remainingDebtAmount","type":"u64"},{"name":"maxBorrowRateBps","type":"u32"},{"name":"minDebtTermSeconds","type":"u64"},{"name":"fillableUntilTimestamp","type":"u64"},{"name":"enableAutoRolloverOnFilledBorrows","type":"bool"}]}},{"name":"UpdateConfigMode","type":{"kind":"enum","variants":[{"name":"UpdateLoanToValuePct"},{"name":"UpdateMaxLiquidationBonusBps"},{"name":"UpdateLiquidationThresholdPct"},{"name":"UpdateProtocolLiquidationFee"},{"name":"UpdateProtocolTakeRate"},{"name":"UpdateFeesOriginationFee"},{"name":"UpdateFeesFlashLoanFee"},{"name":"DeprecatedUpdateFeesReferralFeeBps"},{"name":"UpdateDepositLimit"},{"name":"UpdateBorrowLimit"},{"name":"UpdateTokenInfoLowerHeuristic"},{"name":"UpdateTokenInfoUpperHeuristic"},{"name":"UpdateTokenInfoExpHeuristic"},{"name":"UpdateTokenInfoTwapDivergence"},{"name":"UpdateTokenInfoScopeTwap"},{"name":"UpdateTokenInfoScopeChain"},{"name":"UpdateTokenInfoName"},{"name":"UpdateTokenInfoPriceMaxAge"},{"name":"UpdateTokenInfoTwapMaxAge"},{"name":"UpdateScopePriceFeed"},{"name":"UpdatePythPrice"},{"name":"UpdateSwitchboardFeed"},{"name":"UpdateSwitchboardTwapFeed"},{"name":"UpdateBorrowRateCurve"},{"name":"DeprecatedUpdateEntireReserveConfig"},{"name":"UpdateDebtWithdrawalCap"},{"name":"UpdateDepositWithdrawalCap"},{"name":"DeprecatedUpdateDebtWithdrawalCapCurrentTotal"},{"name":"DeprecatedUpdateDepositWithdrawalCapCurrentTotal"},{"name":"UpdateBadDebtLiquidationBonusBps"},{"name":"UpdateMinLiquidationBonusBps"},{"name":"UpdateDeleveragingMarginCallPeriod"},{"name":"UpdateBorrowFactor"},{"name":"DeprecatedUpdateAssetTier"},{"name":"UpdateElevationGroup"},{"name":"UpdateDeleveragingThresholdDecreaseBpsPerDay"},{"name":"DeprecatedUpdateMultiplierSideBoost"},{"name":"DeprecatedUpdateMultiplierTagBoost"},{"name":"UpdateReserveStatus"},{"name":"UpdateFarmCollateral"},{"name":"UpdateFarmDebt"},{"name":"UpdateDisableUsageAsCollateralOutsideEmode"},{"name":"UpdateBlockBorrowingAboveUtilizationPct"},{"name":"UpdateBlockPriceUsage"},{"name":"UpdateBorrowLimitOutsideElevationGroup"},{"name":"UpdateBorrowLimitsInElevationGroupAgainstThisReserve"},{"name":"UpdateHostFixedInterestRateBps"},{"name":"UpdateAutodeleverageEnabled"},{"name":"UpdateDeleveragingBonusIncreaseBpsPerDay"},{"name":"UpdateProtocolOrderExecutionFee"},{"name":"UpdateProposerAuthorityLock"},{"name":"UpdateMinDeleveragingBonusBps"},{"name":"UpdateBlockCTokenUsage"},{"name":"UpdateDebtMaturityTimestamp"},{"name":"UpdateDebtTermSeconds"},{"name":"UpdateEarlyRepayRemainingInterestPct"},{"name":"UpdateReserveEmergencyMode"},{"name":"UpdateRewardsAmountPerSlot"},{"name":"UpdateReservePermissionedOps"}]}},{"name":"UpdateLendingMarketConfigValue","type":{"kind":"enum","variants":[{"name":"Bool","fields":["bool"]},{"name":"U8","fields":["u8"]},{"name":"U8Array","fields":[{"array":["u8",8]}]},{"name":"U16","fields":["u16"]},{"name":"U64","fields":["u64"]},{"name":"U128","fields":["u128"]},{"name":"Pubkey","fields":["publicKey"]},{"name":"ElevationGroup","fields":[{"defined":"ElevationGroup"}]},{"name":"Name","fields":[{"array":["u8",32]}]}]}},{"name":"UpdateLendingMarketMode","type":{"kind":"enum","variants":[{"name":"UpdateOwner"},{"name":"UpdateEmergencyMode"},{"name":"UpdateLiquidationCloseFactor"},{"name":"UpdateLiquidationMaxValue"},{"name":"DeprecatedUpdateGlobalUnhealthyBorrow"},{"name":"UpdateGlobalAllowedBorrow"},{"name":"UpdateEmergencyCouncil"},{"name":"UpdateMinFullLiquidationThreshold"},{"name":"UpdateInsolvencyRiskLtv"},{"name":"UpdateElevationGroup"},{"name":"UpdateReferralFeeBps"},{"name":"DeprecatedUpdateMultiplierPoints"},{"name":"UpdatePriceRefreshTriggerToMaxAgePct"},{"name":"UpdateAutodeleverageEnabled"},{"name":"UpdateBorrowingDisabled"},{"name":"UpdateMinNetValueObligationPostAction"},{"name":"UpdateMinValueLtvSkipPriorityLiqCheck"},{"name":"UpdateMinValueBfSkipPriorityLiqCheck"},{"name":"UpdatePaddingFields"},{"name":"UpdateName"},{"name":"UpdateIndividualAutodeleverageMarginCallPeriodSecs"},{"name":"UpdateInitialDepositAmount"},{"name":"UpdateObligationOrderExecutionEnabled"},{"name":"UpdateImmutableFlag"},{"name":"UpdateObligationOrderCreationEnabled"},{"name":"UpdateProposerAuthority"},{"name":"UpdatePriceTriggeredLiquidationDisabled"},{"name":"UpdateMatureReserveDebtLiquidationEnabled"},{"name":"UpdateObligationBorrowDebtTermLiquidationEnabled"},{"name":"UpdateBorrowOrderCreationEnabled"},{"name":"UpdateBorrowOrderExecutionEnabled"},{"name":"UpdateMinBorrowOrderFillValue"},{"name":"UpdateWithdrawTicketIssuanceEnabled"},{"name":"UpdateWithdrawTicketRedemptionEnabled"},{"name":"UpdateMinWithdrawQueuedLiquidityValue"},{"name":"UpdateFixedTermRolloverWindowDurationSeconds"},{"name":"UpdateOpenTermRolloverWindowDurationSeconds"},{"name":"UpdateObligationBorrowRolloverConfigurationEnabled"},{"name":"UpdateTermBasedFullLiquidationDurationSecs"},{"name":"UpdateObligationBorrowMigrationToFixedExecutionEnabled"},{"name":"UpdateMinPartialRolloverValue"},{"name":"UpdateWithdrawTicketCancellationEnabled"},{"name":"UpdatePermissioningAuthority"},{"name":"UpdatePermissionedOps"},{"name":"DeprecatedUpdateReserveRewardsMaxAprPct"},{"name":"UpdateReserveRewardsMaxAprBps"}]}},{"name":"UpdateGlobalConfigMode","type":{"kind":"enum","variants":[{"name":"PendingAdmin"},{"name":"FeeCollector"}]}},{"name":"LastUpdate","docs":["Last update state"],"type":{"kind":"struct","fields":[{"name":"slot","docs":["Last slot when updated"],"type":"u64"},{"name":"stale","docs":["True when marked stale, false when slot updated"],"type":"u8"},{"name":"priceStatus","docs":["Status of the prices used to calculate the last update"],"type":"u8"},{"name":"placeholder","type":{"array":["u8",6]}}]}},{"name":"ElevationGroup","type":{"kind":"struct","fields":[{"name":"maxLiquidationBonusBps","type":"u16"},{"name":"id","type":"u8"},{"name":"ltvPct","type":"u8"},{"name":"liquidationThresholdPct","type":"u8"},{"name":"allowNewLoans","type":"u8"},{"name":"maxReservesAsCollateral","type":"u8"},{"name":"padding0","type":"u8"},{"name":"debtReserve","docs":["Mandatory debt reserve for this elevation group"],"type":"publicKey"},{"name":"padding1","type":{"array":["u64",4]}}]}},{"name":"BorrowOrder","docs":["A borrow order.","","When the [Obligation::borrow_order] is populated (i.e. non-zeroed) on an Obligation, then the","permissionless \"fill\" operations may borrow liquidity to the owner according to this","specification."],"type":{"kind":"struct","fields":[{"name":"debtLiquidityMint","docs":["The asset to be borrowed.","The reserves used for [Obligation::borrows] *must* all provide exactly this asset."],"type":"publicKey"},{"name":"remainingDebtAmount","docs":["The amount of debt that still needs to be filled, in lamports."],"type":"u64"},{"name":"filledDebtDestination","docs":["The token account owned by the [Obligation::owner] and holding [Self::debt_liquidity_mint],","where the filled funds should be transferred to."],"type":"publicKey"},{"name":"minDebtTermSeconds","docs":["The minimum allowed debt term that the obligation owner agrees to.","The reserves used to fill this order *cannot* define their debt term *lower* than this.","","If zeroed, then only open-term reserves may be used."],"type":"u64"},{"name":"fillableUntilTimestamp","docs":["The time until which the borrow order can still be filled."],"type":"u64"},{"name":"placedAtTimestamp","docs":["The time at which this order was placed.","Currently, this is only a piece of metadata."],"type":"u64"},{"name":"lastUpdatedAtTimestamp","docs":["The time at which this order was most-recently updated (including: created).","Currently, this is only a piece of metadata."],"type":"u64"},{"name":"requestedDebtAmount","docs":["The amount of debt that was originally requested when this order was most-recently updated.","In other words: this field holds a value of [Self::remaining_debt_amount] captured at","[Self::last_updated_at_timestamp].","Currently, this is only a piece of metadata."],"type":"u64"},{"name":"maxBorrowRateBps","docs":["The maximum borrow rate that the obligation owner agrees to.","The reserves used for [Obligation::borrows] *cannot* define their maximum borrow rate","*higher* than this."],"type":"u32"},{"name":"active","docs":["Whether the [Self::remaining_debt_amount] is non-zero.","","This field is *not* used by smart contract logic (which prefers to treat the above","[Self::remaining_debt_amount]-based definition as the single source of truth). However, it","is useful for off-chain bots (order-searchers) to efficiently list (i.e. `memcmp` filter)","just the obligations that have active borrow orders."],"type":"u8"},{"name":"enableAutoRolloverOnFilledBorrows","docs":["When `1`, all [Obligation::borrows] that get filled by this order will have their","[FixedTermBorrowRolloverConfig::auto_rollover_enabled] flag set.","","Additionally, their rollover customizations:","- will exactly match this order's constraints regarding [Self::min_debt_term_seconds] and","[Self::max_borrow_rate_bps];","- will use the [FixedTermBorrowRolloverConfig::open_term_allowed] fallback.","","See [BorrowOrder::get_rollover_config_for_filled_borrow()].","","Clarification note: when `0`, this setting has no effect on any borrow (i.e. if an existing","borrow was independently marked for auto-rollover, it will *not* be unmarked when filled by","this order).","","Feature flag note: when [LendingMarket::obligation_borrow_rollover_configuration_enabled] is","disabled, this setting has no effect on any borrow (i.e. the fill will be successful, but","the borrow will not be marked for auto-rollover."],"type":"u8"},{"name":"padding1","docs":["Alignment padding."],"type":{"array":["u8",2]}},{"name":"endPadding","docs":["End padding."],"type":{"array":["u64",5]}}]}},{"name":"FixedTermBorrowRolloverConfig","docs":["Settings driving the auto-rollover (or migration) of an [ObligationLiquidity]'s borrow.","","This covers three flavors:","- *fixed-to-fixed*: a fixed-term borrow rolling into another fixed-term reserve,","- *fixed-to-open*: a fixed-term borrow rolling into an open-term reserve,","- *open-to-fixed*: an open-term borrow migrating into a fixed-term reserve.","","By its nature (not a special case), the zeroed struct means \"no auto-rollover/migration\"."],"type":{"kind":"struct","fields":[{"name":"autoRolloverEnabled","docs":["Whether this *fixed-term* borrow can be permissionlessly prolonged. The funds used to roll","over can come:","- either from a *fixed-term* reserve (same or a different one):","- This can only happen within [LendingMarket::fixed_term_rollover_window_duration_seconds].","- The target reserve must meet all the criteria defined in this config (see","[Self::max_borrow_rate_bps] and [Self::min_debt_term_seconds]).","- Note: not possible when [Self::min_debt_term_seconds] is `0` (open-term only).","- or from an *open-term* reserve:","- This can only happen within [LendingMarket::open_term_rollover_window_duration_seconds].","- The user must explicitly set [Self::open_term_allowed] here.","","This setting is not effective when the borrow is currently using an *open-term* reserve."],"type":"u8"},{"name":"openTermAllowed","docs":["When `1`, then [Self::auto_rollover_enabled] is allowed to roll this borrow over into any","open-term reserve.","","Please note that if such rollover actually happens, then [Self::max_borrow_rate_bps]","condition does not apply - technically, it could be evaluated, but open-term reserves","typically use float-rate (utilization-driven borrow rate curve) which has very high maximum","(when at 100% utilization) that would not meet any practical criteria here."],"type":"u8"},{"name":"migrationToFixedEnabled","docs":["Whether this *open-term* borrow can be permissionlessly migrated into a fixed-term reserve:","- This can happen at any moment (as soon as liquidity becomes available).","- The target fixed-term reserve must meet all the criteria defined in this config (see","[Self::max_borrow_rate_bps] and [Self::min_debt_term_seconds]).","","This setting is not effective when the borrow is currently using a *fixed-term* reserve.","","Cannot be enabled when [Self::min_debt_term_seconds] is `0` (open-term only), because","migrating into a fixed-term reserve contradicts the open-term-only intent."],"type":"u8"},{"name":"alignmentPadding","docs":["Internal alignment padding (free to reuse)."],"type":{"array":["u8",1]}},{"name":"maxBorrowRateBps","docs":["A maximum allowed borrow rate of a reserve that can be used for a rollover/migration.","","Note: this must be set (i.e. non-zero) when enabling any rollover/migration flavor, but is","of course not effective when rollover/migration is not enabled."],"type":"u32"},{"name":"minDebtTermSeconds","docs":["A minimum debt term (in seconds) of a fixed-term reserve that can be used for a","rollover/migration.","","When `0`, the owner only accepts open-term reserves as rollover targets — i.e. rolling over","(or migrating) into a fixed-term reserve is not allowed. This is consistent with the","semantics of [BorrowOrder::min_debt_term_seconds].","","This means that `0` is incompatible with [Self::migration_to_fixed_enabled] (which requires","a fixed-term target) — this combination is rejected at configuration time."],"type":"u64"}]}},{"name":"InitObligationArgs","type":{"kind":"struct","fields":[{"name":"tag","type":"u8"},{"name":"id","type":"u8"}]}},{"name":"ObligationCollateral","docs":["Obligation collateral state"],"type":{"kind":"struct","fields":[{"name":"depositReserve","docs":["Reserve collateral is deposited to"],"type":"publicKey"},{"name":"depositedAmount","docs":["Amount of collateral deposited"],"type":"u64"},{"name":"marketValueSf","docs":["Collateral market value in quote currency (scaled fraction)"],"type":"u128"},{"name":"borrowedAmountAgainstThisCollateralInElevationGroup","docs":["Debt amount (lamport) taken against this collateral.","(only meaningful if this obligation is part of an elevation group, otherwise 0)","This is only indicative of the debt computed on the last refresh obligation.","If the obligation have multiple collateral this value is the same for all of them."],"type":"u64"},{"name":"padding","type":{"array":["u64",9]}}]}},{"name":"ObligationLiquidity","docs":["Obligation liquidity state"],"type":{"kind":"struct","fields":[{"name":"borrowReserve","docs":["Reserve liquidity is borrowed from"],"type":"publicKey"},{"name":"cumulativeBorrowRateBsf","docs":["Borrow rate used for calculating interest (big scaled fraction)"],"type":{"defined":"BigFractionBytes"}},{"name":"lastBorrowedAtTimestamp","docs":["The timestamp at which this debt was taken.","","Conceptually, every borrow can be interpreted as \"closing the previous loan and starting a","new one\" (which would make a plain ` borrowed_at ` an even better name). But in terms of","implementation, this fields records when the *last* borrow operation from this reserve","happened (i.e. adding debt of the same reserve *does* move this timestamp).","","Note: this field is *not* only metadata: it is used in the logic, e.g. for enforcing the","fixed-term borrows (i.e. those induced by [ReserveConfig::debt_term_seconds])."],"type":"u64"},{"name":"borrowedAmountSf","docs":["Amount of liquidity borrowed plus interest (scaled fraction)"],"type":"u128"},{"name":"marketValueSf","docs":["Liquidity market value in quote currency (scaled fraction)"],"type":"u128"},{"name":"borrowFactorAdjustedMarketValueSf","docs":["Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead"],"type":"u128"},{"name":"borrowedAmountOutsideElevationGroups","docs":["Amount of liquidity borrowed outside of an elevation group"],"type":"u64"},{"name":"fixedTermBorrowRolloverConfig","docs":["The user's auto-rollover/migration opt-ins. Some settings are effective only for fixed-term","borrows, while others only for open-term borrows - see individual field docs."],"type":{"defined":"FixedTermBorrowRolloverConfig"}},{"name":"borrowedAmountAtExpiration","docs":["An amount of liquidity that was borrowed when this fixed-term borrow expired (i.e. zeroed if","this borrow is not fixed-term, or if it did not yet expire).","","Needed to honor the [LendingMarket::term_based_full_liquidation_duration_secs].","","This value is captured by [Self::capture_borrowed_amount_at_expiration] during obligation's","refresh - please see the method's docs for gotchas.","","Note on precision: we use a `u64` field, since the remaining space within this struct is","rather scarce, and we do not need sub-lamport precision for the liquidation throttling rate."],"type":"u64"},{"name":"padding2","type":{"array":["u64",4]}}]}},{"name":"ObligationOrder","docs":["A single obligation order.","See [Obligation::obligation_orders]."],"type":{"kind":"struct","fields":[{"name":"conditionThresholdSf","docs":["A threshold value used by the condition (scaled [Fraction]).","The exact meaning depends on the specific [Self::condition_type].","","Examples:","- when `condition_type == 2 (UserLtvBelow)`:","then a value of `0.455` here means that the order is active only when the obligation's","user LTV is less than `0.455` (i.e. < 45.5%).","- when `condition_type == 3 (DebtCollPriceRatioAbove)`:","assuming the obligation uses BTC collateral for SOL debt, then a value of `491.3` here","means that the order is active only when the BTC-SOL price is greater than `491.3` (i.e.","> 491.3 SOL per BTC)."],"type":"u128"},{"name":"opportunityParameterSf","docs":["A configuration parameter used by the opportunity (scaled [Fraction]).","The exact meaning depends on the specific [Self::opportunity_type].","","Examples:","- when `opportunity_type == 0 (DeleverageSingleDebtAmount)`:","Assuming the obligation uses BTC collateral for SOL debt, then a value of `1_234_000_000`","here means that a liquidator may repay up to 1234000000 lamports (i.e. 1.234 SOL) on this","obligation.","Note: the special value of [Fraction::MAX] is *not* allowed in this case.","- when `opportunity_type == 1 (DeleverageAllDebtAmount)`:","The only allowed value in this case is [Fraction::MAX] (to emphasize that *all* debt","should be repaid)."],"type":"u128"},{"name":"minExecutionBonusBps","docs":["A *minimum* additional fraction of collateral transferred to the liquidator, in bps.","","The minimum bonus is applied exactly when the [Self::condition_threshold_sf] is met, and","grows linearly towards the [Self::max_execution_bonus_bps].","","Example: a value of `50` here means 50bps == 0.5% bonus for an \"LTV > 65%\" order, when","executed precisely at the moment LTV exceeds 65%."],"type":"u16"},{"name":"maxExecutionBonusBps","docs":["A *maximum* additional fraction of collateral transferred to the liquidator, in bps.","","The maximum bonus is applied at the relevant \"extreme\" state of the obligation, i.e.:","- for a stop-loss condition, it is a point at which the obligation becomes liquidatable;","- for a take-profit condition, it is a point at which obligation has 0% LTV.","","In non-extreme states, the actual bonus value is interpolated linearly, starting from","[Self::min_execution_bonus_bps] (at the point specified by the order's condition).","","Example: a value of `300` here means 300bps == 3.0% bonus for a \"debt/coll price > 140\"","order, when executed at a higher price = 200, at which the obligation's LTV happens to","be equal to its liquidation LTV."],"type":"u16"},{"name":"conditionType","docs":["Serialized [ConditionType].","The entire order is void when this is zeroed (i.e. representing [ConditionType::Never]).","","Example: a value of `2` here denotes `UserLtvBelow` condition type. Of course, to","interpret this condition, we also need to take the [Self::condition_threshold_sf] into","account."],"type":"u8"},{"name":"opportunityType","docs":["Serialized [OpportunityType].","","Example: a value of `0` here denotes `DeleverageSingleDebtAmount` opportunity. Of course, to","interpret this opportunity, we also need to take the [Self::opportunity_parameter_sf] into","account."],"type":"u8"},{"name":"padding1","docs":["Alignment padding.","The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to","align with `u128`s."],"type":{"array":["u8",10]}},{"name":"padding2","docs":["End padding.","The total size of a single instance is 8*u128 = 128 bytes."],"type":{"array":["u128",5]}}]}},{"name":"UpdateObligationConfigMode","docs":["A discriminator of a user-configurable piece of [Obligation].","","Implementation note: due to TS-side codegen quirks (and a \"convention\" currently seen e.g.","within reserve and market update operations), this is not a true Rust enum. The new value of","a config item is provided in a separate handler argument (borsh-serialized), and its expected","type is defined by each discriminator here. Additionally, each update mode acts on a specific","[ObligationConfigUpdateSubject] (e.g. the auto-rollover of fixed-term borrows is configured on","a per-borrow basis), which is also specified by separate handler arguments."],"type":{"kind":"enum","variants":[{"name":"FixedTermRolloverEnabled"},{"name":"FixedTermRolloverMaxBorrowRateBps"},{"name":"FixedTermRolloverMinDebtTermSeconds"},{"name":"FixedTermRolloverOpenTermAllowed"},{"name":"MigrationToFixedEnabled"}]}},{"name":"BigFractionBytes","type":{"kind":"struct","fields":[{"name":"value","type":{"array":["u64",4]}},{"name":"padding","type":{"array":["u64",2]}}]}},{"name":"FeeCalculation","docs":["Calculate fees exlusive or inclusive of an amount"],"type":{"kind":"enum","variants":[{"name":"Exclusive"},{"name":"Inclusive"}]}},{"name":"ReserveCollateral","docs":["Reserve collateral"],"type":{"kind":"struct","fields":[{"name":"mintPubkey","docs":["Reserve collateral mint address"],"type":"publicKey"},{"name":"mintTotalSupply","docs":["Reserve collateral mint supply, used for exchange rate"],"type":"u64"},{"name":"supplyVault","docs":["Reserve collateral supply address"],"type":"publicKey"},{"name":"padding1","type":{"array":["u128",32]}},{"name":"padding2","type":{"array":["u128",32]}}]}},{"name":"ReserveConfig","docs":["Reserve configuration values"],"type":{"kind":"struct","fields":[{"name":"status","docs":["Status of the reserve Active/Obsolete/Hidden"],"type":"u8"},{"name":"paddingDeprecatedAssetTier","docs":["Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt"],"type":"u8"},{"name":"hostFixedInterestRateBps","docs":["Flat rate that goes to the host"],"type":"u16"},{"name":"minDeleveragingBonusBps","docs":["Starting bonus for deleveraging-related liquidations, in bps."],"type":"u16"},{"name":"blockCtokenUsage","docs":["Boolean flag to block minting/redeeming of ctokens","Blocks usage of ctokens (minting or withdrawing from obligation)","Effectively blocks deposit_reserve_liquidity and withdraw_obligation_collateral"],"type":"u8"},{"name":"earlyRepayRemainingInterestPct","docs":["The percentage of remaining interest over the debt term that is charged as early repay penalty.","Only meaningful when `debt_term_seconds > 0`."],"type":"u8"},{"name":"emergencyMode","docs":["Whether the reserve is in emergency mode.","Blocks most user operations involving this reserve, similar to [LendingMarket::emergency_mode]","but scoped to a single reserve. Also cascades to obligations using this reserve as","collateral or debt, blocking borrows and withdrawals on other reserves but still","allowing repays and deposits."],"type":"u8"},{"name":"reserved1","docs":["Past reserved space - feel free to reuse."],"type":{"array":["u8",4]}},{"name":"protocolOrderExecutionFeePct","docs":["Cut of the order execution bonus that the protocol receives, as a percentage"],"type":"u8"},{"name":"protocolTakeRatePct","docs":["Protocol take rate is the amount borrowed interest protocol receives, as a percentage"],"type":"u8"},{"name":"protocolLiquidationFeePct","docs":["Cut of the liquidation bonus that the protocol receives, as a percentage"],"type":"u8"},{"name":"loanToValuePct","docs":["Target ratio of the value of borrows to deposits, as a percentage","0 if use as collateral is disabled"],"type":"u8"},{"name":"liquidationThresholdPct","docs":["Loan to value ratio at which an obligation can be liquidated, as percentage"],"type":"u8"},{"name":"minLiquidationBonusBps","docs":["Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps"],"type":"u16"},{"name":"maxLiquidationBonusBps","docs":["Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps"],"type":"u16"},{"name":"badDebtLiquidationBonusBps","docs":["Bad debt liquidation bonus for an undercollateralized obligation, as bps"],"type":"u16"},{"name":"deleveragingMarginCallPeriodSecs","docs":["Time in seconds that must pass before redemptions are enabled after the deposit limit is","crossed.","Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case."],"type":"u64"},{"name":"deleveragingThresholdDecreaseBpsPerDay","docs":["The rate at which the deleveraging threshold decreases, in bps per day.","Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case."],"type":"u64"},{"name":"fees","docs":["Program owner fees assessed, separate from gains due to interest accrual"],"type":{"defined":"ReserveFees"}},{"name":"borrowRateCurve","docs":["Borrow rate curve based on utilization"],"type":{"defined":"BorrowRateCurve"}},{"name":"borrowFactorPct","docs":["Borrow factor in percentage - used for risk adjustment"],"type":"u64"},{"name":"depositLimit","docs":["Maximum deposit limit of liquidity in native units, u64::MAX for inf"],"type":"u64"},{"name":"borrowLimit","docs":["Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits)"],"type":"u64"},{"name":"tokenInfo","docs":["Token id from TokenInfos struct"],"type":{"defined":"TokenInfo"}},{"name":"depositWithdrawalCap","docs":["Deposit withdrawal caps - deposit & redeem"],"type":{"defined":"WithdrawalCaps"}},{"name":"debtWithdrawalCap","docs":["Debt withdrawal caps - borrow & repay"],"type":{"defined":"WithdrawalCaps"}},{"name":"elevationGroups","type":{"array":["u8",20]}},{"name":"disableUsageAsCollOutsideEmode","type":"u8"},{"name":"utilizationLimitBlockBorrowingAbovePct","docs":["Utilization (in percentage) above which borrowing is blocked. 0 to disable."],"type":"u8"},{"name":"autodeleverageEnabled","docs":["Whether this reserve should be subject to auto-deleveraging after deposit or borrow limit is","crossed.","Besides this flag, the lending market's flag also needs to be enabled (logical `AND`).","**NOTE:** the manual \"target LTV\" deleveraging is NOT affected by this flag."],"type":"u8"},{"name":"proposerAuthorityLocked","docs":["Boolean flag indicating whether the reserve is locked for the proposer authority.","","Once the proposer have finished preparing the reserve, it must be locked to prevent","further changes to the reserve configuration allowing review and voting on the proposal","without alteration during the voting period."],"type":"u8"},{"name":"borrowLimitOutsideElevationGroup","docs":["Maximum amount liquidity of this reserve borrowed outside all elevation groups","- u64::MAX for inf","- 0 to disable borrows outside elevation groups"],"type":"u64"},{"name":"borrowLimitAgainstThisCollateralInElevationGroup","docs":["Defines the maximum amount (in lamports of elevation group debt asset)","that can be borrowed when this reserve is used as collateral.","- u64::MAX for inf","- 0 to disable borrows in this elevation group (expected value for the debt asset)"],"type":{"array":["u64",32]}},{"name":"deleveragingBonusIncreaseBpsPerDay","docs":["The rate at which the deleveraging-related liquidation bonus increases, in bps per day.","Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case."],"type":"u64"},{"name":"debtMaturityTimestamp","docs":["The timestamp at which all [Obligation::borrows] using this reserve become liquidatable","(on the same terms as reserve-wide deleveraging).","Inactive when zeroed (i.e. debt never matures).","","Note: this feature is independent of [Self::debt_term_seconds] - the liquidation mechanism","is based directly on the timestamp defined here, on Reserve's level."],"type":"u64"},{"name":"debtTermSeconds","docs":["The duration after which any debt coming from this Reserve must be repaid.","Inactive when zeroed (i.e. funds can be borrowed indefinitely).","","Note: this feature is independent of [Self::debt_maturity_timestamp] - the liquidation","mechanism is based on the [ObligationLiquidity::last_borrowed_at_timestamp]."],"type":"u64"},{"name":"rewardsAmountPerSlot","docs":["Rewards distributed per slot to depositors. Drained from","[ReserveLiquidity::rewards_amount_available] into","[ReserveLiquidity::total_available_amount] at each refresh, capped by the","market-level [LendingMarket::reserve_rewards_max_apr_bps]. `0` disables.","","**Note:** because rewards inflate `total_available_amount`, a non-zero RPS on a","reserve with [Self::autodeleverage_enabled] and a finite [Self::deposit_limit]","will eventually cross the cap and arm the autodeleverage countdown. Size","`deposit_limit` and RPS together."],"type":"u64"},{"name":"permissionedOps","docs":["Bitmask of [PermissionedOp]s gated by the parent market's `permissioning_authority`","when this reserve is the operation's target. `0` = no operation is restricted at the","reserve level. Use [Reserve::get_permissioned_ops] for a typed view."],"type":"u64"}]}},{"name":"ReserveFarmKind","type":{"kind":"enum","variants":[{"name":"Collateral"},{"name":"Debt"}]}},{"name":"ReserveFees","docs":["Additional fee information on a reserve","","These exist separately from interest accrual fees, and are specifically for the program owner","and referral fee. The fees are paid out as a percentage of liquidity token amounts during","repayments and liquidations."],"type":{"kind":"struct","fields":[{"name":"originationFeeSf","docs":["Fee assessed on `BorrowObligationLiquidity`, as scaled fraction (60 bits fractional part)","Must be between `0` and `2^60`, such that `2^60 = 1`. A few examples for","clarity:","1% = (1 << 60) / 100 = 11529215046068470","0.01% (1 basis point) = 115292150460685","0.00001% (Aave origination fee) = 115292150461"],"type":"u64"},{"name":"flashLoanFeeSf","docs":["Fee for flash loan, expressed as scaled fraction.","0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541"],"type":"u64"},{"name":"padding","docs":["Used for allignment"],"type":{"array":["u8",8]}}]}},{"name":"ReserveLiquidity","docs":["Reserve liquidity"],"type":{"kind":"struct","fields":[{"name":"mintPubkey","docs":["Reserve liquidity mint address"],"type":"publicKey"},{"name":"supplyVault","docs":["Reserve liquidity supply address"],"type":"publicKey"},{"name":"feeVault","docs":["Reserve liquidity fee collection address"],"type":"publicKey"},{"name":"totalAvailableAmount","docs":["Total reserve liquidity available.","","Note: not all of this liquidity can be freely used for any purpose. Production code should","use the specialized getters - see e.g. [Reserve::total_available_liquidity_amount()],","[Reserve::freely_available_liquidity_amount()]."],"type":"u64"},{"name":"borrowedAmountSf","docs":["Reserve liquidity borrowed (scaled fraction)"],"type":"u128"},{"name":"marketPriceSf","docs":["Reserve liquidity market price in quote currency (scaled fraction)"],"type":"u128"},{"name":"marketPriceLastUpdatedTs","docs":["Unix timestamp of the market price (from the oracle)"],"type":"u64"},{"name":"mintDecimals","docs":["Reserve liquidity mint decimals"],"type":"u64"},{"name":"depositLimitCrossedTimestamp","docs":["Timestamp when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.","If the threshold is not crossed, then the timestamp is set to 0"],"type":"u64"},{"name":"borrowLimitCrossedTimestamp","docs":["Timestamp when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.","If the threshold is not crossed, then the timestamp is set to 0"],"type":"u64"},{"name":"cumulativeBorrowRateBsf","docs":["Reserve liquidity cumulative borrow rate (scaled fraction)"],"type":{"defined":"BigFractionBytes"}},{"name":"accumulatedProtocolFeesSf","docs":["Reserve cumulative protocol fees (scaled fraction)"],"type":"u128"},{"name":"accumulatedReferrerFeesSf","docs":["Reserve cumulative referrer fees (scaled fraction)"],"type":"u128"},{"name":"pendingReferrerFeesSf","docs":["Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction)"],"type":"u128"},{"name":"absoluteReferralRateSf","docs":["Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction)"],"type":"u128"},{"name":"tokenProgram","docs":["Token program of the liquidity mint"],"type":"publicKey"},{"name":"rewardsAmountAvailable","docs":["Reserve rewards budget remaining for distribution.","","Tokens are deposited via `topup_reserve_rewards` and increase this counter (without","touching [Self::total_available_amount]). On every `refresh_reserve`, up to","`rewards_amount_per_slot * slots_elapsed` tokens are moved from this counter into","[Self::total_available_amount], inflating the cToken exchange rate, capped by the","market-level `reserve_rewards_max_apr_bps` cap."],"type":"u64"},{"name":"padding2","type":{"array":["u64",50]}},{"name":"padding3","type":{"array":["u128",32]}}]}},{"name":"ReserveStatus","type":{"kind":"enum","variants":[{"name":"Active"},{"name":"Obsolete"},{"name":"Hidden"}]}},{"name":"WithdrawQueue","docs":["A tracker of ticket-based withdrawals."],"type":{"kind":"struct","fields":[{"name":"queuedCollateralAmount","docs":["The part of [ReserveLiquidity::total_available_amount] locked for ticketed withdrawals."],"type":"u64"},{"name":"nextIssuedTicketSequenceNumber","docs":["The sequence number of the next ticket to be issued when enqueueing to withdraw.","Note: it is also a number of tickets issued so far."],"type":"u64"},{"name":"nextWithdrawableTicketSequenceNumber","docs":["The sequence number of the next ticket to be used for actually transferring the withdrawn","liquidity (assuming it is available in the reserve).","Note: it is also a number of fully-consumed tickets so far."],"type":"u64"}]}},{"name":"WithdrawalCaps","docs":["Reserve Withdrawal Caps State"],"type":{"kind":"struct","fields":[{"name":"configCapacity","type":"i64"},{"name":"currentTotal","type":"i64"},{"name":"lastIntervalStartTimestamp","type":"u64"},{"name":"configIntervalLengthSeconds","type":"u64"}]}},{"name":"PriceHeuristic","type":{"kind":"struct","fields":[{"name":"lower","docs":["Lower value of acceptable price"],"type":"u64"},{"name":"upper","docs":["Upper value of acceptable price"],"type":"u64"},{"name":"exp","docs":["Number of decimals of the previously defined values"],"type":"u64"}]}},{"name":"PythConfiguration","type":{"kind":"struct","fields":[{"name":"price","docs":["Pubkey of the base price feed (disabled if `null` or `default`)"],"type":"publicKey"}]}},{"name":"ScopeConfiguration","type":{"kind":"struct","fields":[{"name":"priceFeed","docs":["Pubkey of the scope price feed (disabled if `null` or `default`)"],"type":"publicKey"},{"name":"priceChain","docs":["This is the scope_id price chain that results in a price for the token"],"type":{"array":["u16",4]}},{"name":"twapChain","docs":["This is the scope_id price chain for the twap"],"type":{"array":["u16",4]}}]}},{"name":"SwitchboardConfiguration","type":{"kind":"struct","fields":[{"name":"priceAggregator","docs":["Pubkey of the base price feed (disabled if `null` or `default`)"],"type":"publicKey"},{"name":"twapAggregator","type":"publicKey"}]}},{"name":"TokenInfo","type":{"kind":"struct","fields":[{"name":"name","docs":["UTF-8 encoded name of the token (null-terminated)"],"type":{"array":["u8",32]}},{"name":"heuristic","docs":["Heuristics limits of acceptable price"],"type":{"defined":"PriceHeuristic"}},{"name":"maxTwapDivergenceBps","docs":["Max divergence between twap and price in bps"],"type":"u64"},{"name":"maxAgePriceSeconds","type":"u64"},{"name":"maxAgeTwapSeconds","type":"u64"},{"name":"scopeConfiguration","docs":["Scope price configuration"],"type":{"defined":"ScopeConfiguration"}},{"name":"switchboardConfiguration","docs":["Switchboard configuration"],"type":{"defined":"SwitchboardConfiguration"}},{"name":"pythConfiguration","docs":["Pyth configuration"],"type":{"defined":"PythConfiguration"}},{"name":"blockPriceUsage","type":"u8"},{"name":"reserved","type":{"array":["u8",7]}},{"name":"padding","type":{"array":["u64",19]}}]}},{"name":"ProgressCallbackType","docs":["A callback to be notified when the ticket is being processed.","","## Why an enum?","","Only reliable programs may be used for callbacks (since any error or panic returned from a CPI","aborts an entire transaction, which would stall the queue progress). Hence, we need a whitelist,","and the simplest initial implementation is a hardcoded enum. If we want to be able to add new","whitelist items without SC updates, we can implement such support using a special enum value","(e.g. `SPECIFIED_BY_PDA = 255`)."],"type":{"kind":"enum","variants":[{"name":"None"},{"name":"KlendQueueAccountingHandlerOnKvault"}]}},{"name":"BorrowRateCurve","type":{"kind":"struct","fields":[{"name":"points","type":{"array":[{"defined":"CurvePoint"},11]}}]}},{"name":"CurvePoint","type":{"kind":"struct","fields":[{"name":"utilizationRateBps","type":"u32"},{"name":"borrowRateBps","type":"u32"}]}}],"events":[{"name":"BorrowOrderCancelEvent","fields":[{"name":"before","type":{"defined":"BorrowOrder"},"index":false}]},{"name":"BorrowOrderFullFillEvent","fields":[{"name":"before","type":{"defined":"BorrowOrder"},"index":false}]},{"name":"BorrowOrderPartialFillEvent","fields":[{"name":"before","type":{"defined":"BorrowOrder"},"index":false},{"name":"after","type":{"defined":"BorrowOrder"},"index":false}]},{"name":"BorrowOrderPlaceEvent","fields":[{"name":"after","type":{"defined":"BorrowOrder"},"index":false}]},{"name":"BorrowOrderUpdateEvent","fields":[{"name":"before","type":{"defined":"BorrowOrder"},"index":false},{"name":"after","type":{"defined":"BorrowOrder"},"index":false}]}],"errors":[{"code":6000,"name":"InvalidMarketAuthority","msg":"Market authority is invalid"},{"code":6001,"name":"InvalidMarketOwner","msg":"Market owner is invalid"},{"code":6002,"name":"InvalidAccountOwner","msg":"Input account owner is not the program address"},{"code":6003,"name":"InvalidAmount","msg":"Input amount is invalid"},{"code":6004,"name":"InvalidConfig","msg":"Input config value is invalid"},{"code":6005,"name":"InvalidSigner","msg":"Signer is not allowed to perform this action"},{"code":6006,"name":"InvalidAccountInput","msg":"Invalid account input"},{"code":6007,"name":"MathOverflow","msg":"Math operation overflow"},{"code":6008,"name":"InsufficientLiquidity","msg":"Insufficient liquidity available"},{"code":6009,"name":"ReserveStale","msg":"Reserve state needs to be refreshed"},{"code":6010,"name":"WithdrawTooSmall","msg":"Withdraw amount too small"},{"code":6011,"name":"WithdrawTooLarge","msg":"Withdraw amount too large"},{"code":6012,"name":"BorrowTooSmall","msg":"Borrow amount too small to receive liquidity after fees"},{"code":6013,"name":"BorrowTooLarge","msg":"Borrow amount too large for deposited collateral"},{"code":6014,"name":"RepayTooSmall","msg":"Repay amount too small to transfer liquidity"},{"code":6015,"name":"LiquidationTooSmall","msg":"Liquidation amount too small to receive collateral"},{"code":6016,"name":"ObligationHealthy","msg":"Cannot liquidate healthy obligations"},{"code":6017,"name":"ObligationStale","msg":"Obligation state needs to be refreshed"},{"code":6018,"name":"ObligationReserveLimit","msg":"Obligation reserve limit exceeded"},{"code":6019,"name":"InvalidObligationOwner","msg":"Obligation owner is invalid"},{"code":6020,"name":"ObligationDepositsEmpty","msg":"Obligation deposits are empty"},{"code":6021,"name":"ObligationBorrowsEmpty","msg":"Obligation borrows are empty"},{"code":6022,"name":"ObligationDepositsZero","msg":"Obligation deposits have zero value"},{"code":6023,"name":"ObligationBorrowsZero","msg":"Obligation borrows have zero value"},{"code":6024,"name":"InvalidObligationCollateral","msg":"Invalid obligation collateral"},{"code":6025,"name":"InvalidObligationLiquidity","msg":"Invalid obligation liquidity"},{"code":6026,"name":"ObligationCollateralEmpty","msg":"Obligation collateral is empty"},{"code":6027,"name":"ObligationLiquidityEmpty","msg":"Obligation liquidity is empty"},{"code":6028,"name":"NegativeInterestRate","msg":"Interest rate is negative"},{"code":6029,"name":"InvalidOracleConfig","msg":"Input oracle config is invalid"},{"code":6030,"name":"InsufficientProtocolFeesToRedeem","msg":"Insufficient protocol fees to claim or no liquidity available"},{"code":6031,"name":"FlashBorrowCpi","msg":"No cpi flash borrows allowed"},{"code":6032,"name":"NoFlashRepayFound","msg":"No corresponding repay found for flash borrow"},{"code":6033,"name":"InvalidFlashRepay","msg":"Invalid repay found"},{"code":6034,"name":"FlashRepayCpi","msg":"No cpi flash repays allowed"},{"code":6035,"name":"MultipleFlashBorrows","msg":"Multiple flash borrows not allowed in the same transaction"},{"code":6036,"name":"FlashLoansDisabled","msg":"Flash loans are disabled for this reserve"},{"code":6037,"name":"SwitchboardV2Error","msg":"Switchboard error"},{"code":6038,"name":"CouldNotDeserializeScope","msg":"Cannot deserialize the scope price account"},{"code":6039,"name":"PriceTooOld","msg":"Price too old"},{"code":6040,"name":"PriceTooDivergentFromTwap","msg":"Price too divergent from twap"},{"code":6041,"name":"InvalidTwapPrice","msg":"Invalid twap price"},{"code":6042,"name":"GlobalEmergencyMode","msg":"Emergency mode is enabled"},{"code":6043,"name":"InvalidFlag","msg":"Invalid lending market config"},{"code":6044,"name":"PriceNotValid","msg":"Price is not valid"},{"code":6045,"name":"PriceIsBiggerThanHeuristic","msg":"Price is bigger than allowed by heuristic"},{"code":6046,"name":"PriceIsLowerThanHeuristic","msg":"Price lower than allowed by heuristic"},{"code":6047,"name":"PriceIsZero","msg":"Price is zero"},{"code":6048,"name":"PriceConfidenceTooWide","msg":"Price confidence too wide"},{"code":6049,"name":"IntegerOverflow","msg":"Conversion between integers failed"},{"code":6050,"name":"NoFarmForReserve","msg":"This reserve does not have a farm"},{"code":6051,"name":"IncorrectInstructionInPosition","msg":"Wrong instruction at expected position"},{"code":6052,"name":"NoPriceFound","msg":"No price found"},{"code":6053,"name":"InvalidTwapConfig","msg":"Invalid Twap configuration: Twap is enabled but one of the enabled price doesn't have a twap"},{"code":6054,"name":"InvalidPythPriceAccount","msg":"Pyth price account does not match configuration"},{"code":6055,"name":"InvalidSwitchboardAccount","msg":"Switchboard account(s) do not match configuration"},{"code":6056,"name":"InvalidScopePriceAccount","msg":"Scope price account does not match configuration"},{"code":6057,"name":"ObligationCollateralLtvZero","msg":"The obligation has one collateral with an LTV set to 0. Withdraw it before withdrawing other collaterals"},{"code":6058,"name":"InvalidObligationSeedsValue","msg":"Seeds must be default pubkeys for tag 0, and mint addresses for tag 1 or 2"},{"code":6059,"name":"DeprecatedInvalidObligationId","msg":"[DEPRECATED] Obligation id must be 0"},{"code":6060,"name":"InvalidBorrowRateCurvePoint","msg":"Invalid borrow rate curve point"},{"code":6061,"name":"InvalidUtilizationRate","msg":"Invalid utilization rate"},{"code":6062,"name":"CannotSocializeObligationWithCollateral","msg":"Obligation hasn't been fully liquidated and debt cannot be socialized."},{"code":6063,"name":"ObligationEmpty","msg":"Obligation has no borrows or deposits."},{"code":6064,"name":"WithdrawalCapReached","msg":"Withdrawal cap is reached"},{"code":6065,"name":"LastTimestampGreaterThanCurrent","msg":"The last interval start timestamp is greater than the current timestamp"},{"code":6066,"name":"LiquidationRewardTooSmall","msg":"The reward amount is less than the minimum acceptable received liquidity"},{"code":6067,"name":"IsolatedAssetTierViolation","msg":"Isolated Asset Tier Violation"},{"code":6068,"name":"InconsistentElevationGroup","msg":"The obligation's elevation group and the reserve's are not the same"},{"code":6069,"name":"InvalidElevationGroup","msg":"The elevation group chosen for the reserve does not exist in the lending market"},{"code":6070,"name":"InvalidElevationGroupConfig","msg":"The elevation group updated has wrong parameters set"},{"code":6071,"name":"UnhealthyElevationGroupLtv","msg":"The current obligation must have most or all its debt repaid before changing the elevation group"},{"code":6072,"name":"ElevationGroupNewLoansDisabled","msg":"Elevation group does not accept any new loans or any new borrows/withdrawals"},{"code":6073,"name":"ReserveDeprecated","msg":"Reserve was deprecated, no longer usable"},{"code":6074,"name":"ReferrerAccountNotInitialized","msg":"Referrer account not initialized"},{"code":6075,"name":"ReferrerAccountMintMissmatch","msg":"Referrer account mint does not match the operation reserve mint"},{"code":6076,"name":"ReferrerAccountWrongAddress","msg":"Referrer account address is not a valid program address"},{"code":6077,"name":"ReferrerAccountReferrerMissmatch","msg":"Referrer account referrer does not match the owner referrer"},{"code":6078,"name":"ReferrerAccountMissing","msg":"Referrer account missing for obligation with referrer"},{"code":6079,"name":"InsufficientReferralFeesToRedeem","msg":"Insufficient referral fees to claim or no liquidity available"},{"code":6080,"name":"CpiDisabled","msg":"CPI disabled for this instruction"},{"code":6081,"name":"ShortUrlNotAsciiAlphanumeric","msg":"Referrer short_url is not ascii alphanumeric"},{"code":6082,"name":"ReserveObsolete","msg":"Reserve is marked as obsolete"},{"code":6083,"name":"ElevationGroupAlreadyActivated","msg":"Obligation already part of the same elevation group"},{"code":6084,"name":"ObligationInObsoleteReserve","msg":"Obligation has a deposit or borrow in an obsolete reserve"},{"code":6085,"name":"ReferrerStateOwnerMismatch","msg":"Referrer state owner does not match the given signer"},{"code":6086,"name":"UserMetadataOwnerAlreadySet","msg":"User metadata owner is already set"},{"code":6087,"name":"CollateralNonLiquidatable","msg":"This collateral cannot be liquidated (LTV set to 0)"},{"code":6088,"name":"BorrowingDisabled","msg":"Borrowing is disabled"},{"code":6089,"name":"BorrowLimitExceeded","msg":"Cannot borrow above borrow limit"},{"code":6090,"name":"DepositLimitExceeded","msg":"Cannot deposit above deposit limit"},{"code":6091,"name":"BorrowingDisabledOutsideElevationGroup","msg":"Reserve does not accept any new borrows outside elevation group"},{"code":6092,"name":"NetValueRemainingTooSmall","msg":"Net value remaining too small"},{"code":6093,"name":"WorseLtvBlocked","msg":"Cannot get the obligation in a worse position"},{"code":6094,"name":"LiabilitiesBiggerThanAssets","msg":"Cannot have more liabilities than assets in a position"},{"code":6095,"name":"ReserveTokenBalanceMismatch","msg":"Reserve state and token account cannot drift"},{"code":6096,"name":"ReserveVaultBalanceMismatch","msg":"Reserve token account has been unexpectedly modified"},{"code":6097,"name":"ReserveAccountingMismatch","msg":"Reserve internal state accounting has been unexpectedly modified"},{"code":6098,"name":"BorrowingAboveUtilizationRateDisabled","msg":"Borrowing above set utilization rate is disabled"},{"code":6099,"name":"LiquidationBorrowFactorPriority","msg":"Liquidation must prioritize the debt with the highest borrow factor"},{"code":6100,"name":"LiquidationLowestLiquidationLtvPriority","msg":"Liquidation must prioritize the collateral with the lowest liquidation LTV"},{"code":6101,"name":"ElevationGroupBorrowLimitExceeded","msg":"Elevation group borrow limit exceeded"},{"code":6102,"name":"ElevationGroupWithoutDebtReserve","msg":"The elevation group does not have a debt reserve defined"},{"code":6103,"name":"ElevationGroupMaxCollateralReserveZero","msg":"The elevation group does not allow any collateral reserves"},{"code":6104,"name":"ElevationGroupHasAnotherDebtReserve","msg":"In elevation group attempt to borrow from a reserve that is not the debt reserve"},{"code":6105,"name":"ElevationGroupDebtReserveAsCollateral","msg":"The elevation group's debt reserve cannot be used as a collateral reserve"},{"code":6106,"name":"ObligationCollateralExceedsElevationGroupLimit","msg":"Obligation have more collateral than the maximum allowed by the elevation group"},{"code":6107,"name":"ObligationElevationGroupMultipleDebtReserve","msg":"Obligation is an elevation group but have more than one debt reserve"},{"code":6108,"name":"UnsupportedTokenExtension","msg":"Mint has a token (2022) extension that is not supported"},{"code":6109,"name":"InvalidTokenAccount","msg":"Can't have an spl token mint with a t22 account"},{"code":6110,"name":"DepositDisabledOutsideElevationGroup","msg":"Can't deposit into this reserve outside elevation group"},{"code":6111,"name":"CannotCalculateReferralAmountDueToSlotsMismatch","msg":"Cannot calculate referral amount due to slots mismatch"},{"code":6112,"name":"ObligationOwnersMustMatch","msg":"Obligation owners must match"},{"code":6113,"name":"ObligationsMustMatch","msg":"Obligations must match"},{"code":6114,"name":"LendingMarketsMustMatch","msg":"Lending markets must match"},{"code":6115,"name":"ObligationCurrentlyMarkedForDeleveraging","msg":"Obligation is already marked for deleveraging"},{"code":6116,"name":"MaximumWithdrawValueZero","msg":"Maximum withdrawable value of this collateral is zero, LTV needs improved"},{"code":6117,"name":"ZeroMaxLtvAssetsInDeposits","msg":"No max LTV 0 assets allowed in deposits for repay and withdraw"},{"code":6118,"name":"LowestLtvAssetsPriority","msg":"Withdrawing must prioritize the collateral with the lowest reserve max-LTV"},{"code":6119,"name":"WorseLtvThanUnhealthyLtv","msg":"Cannot get the obligation liquidatable"},{"code":6120,"name":"FarmAccountsMissing","msg":"Farm accounts to refresh are missing"},{"code":6121,"name":"RepayTooSmallForFullLiquidation","msg":"Repay amount is too small to satisfy the mandatory full liquidation"},{"code":6122,"name":"InsufficientRepayAmount","msg":"Liquidator provided repay amount lower than required by liquidation rules"},{"code":6123,"name":"OrderIndexOutOfBounds","msg":"Obligation order of the given index cannot exist"},{"code":6124,"name":"InvalidOrderConfiguration","msg":"Given order configuration has wrong parameters"},{"code":6125,"name":"OrderConfigurationNotSupportedByObligation","msg":"Given order configuration cannot be used with the current state of the obligation"},{"code":6126,"name":"OperationNotPermittedWithCurrentObligationOrders","msg":"Single debt, single collateral obligation orders have to be cancelled before changing the deposit/borrow count"},{"code":6127,"name":"OperationNotPermittedMarketImmutable","msg":"Cannot update lending market because it is set as immutable"},{"code":6128,"name":"OrderCreationDisabled","msg":"Creation of new orders is disabled"},{"code":6129,"name":"NoUpgradeAuthority","msg":"Cannot initialize global config because there is no upgrade authority to the program"},{"code":6130,"name":"InitialAdminDepositExecuted","msg":"Initial admin deposit in reserve already executed"},{"code":6131,"name":"ReserveHasNotReceivedInitialDeposit","msg":"Reserve has not received the initial deposit, cannot update config"},{"code":6132,"name":"CTokenUsageBlocked","msg":"CToken minting/redeeming is blocked for this reserve"},{"code":6133,"name":"CannotUseSameReserve","msg":"Cannot call ix with same reserve"},{"code":6134,"name":"TransactionIncludesRestrictedPrograms","msg":"Transaction includes restricted programs"},{"code":6135,"name":"BorrowOrderDebtLiquidityMintMismatch","msg":"There is no borrow order requesting debt in the given asset"},{"code":6136,"name":"BorrowOrderMaxBorrowRateExceeded","msg":"Reserve used for fill exceeds the maximum borrow rate specified by the order"},{"code":6137,"name":"BorrowOrderMinDebtTermInsufficient","msg":"Reserve used for fill defines a debt term shorter than specified by the order"},{"code":6138,"name":"BorrowOrderFillTimeLimitExceeded","msg":"Borrow order can no longer be filled"},{"code":6139,"name":"ReserveDebtMaturityReached","msg":"Cannot borrow from a reserve that reached its debt maturity timestamp"},{"code":6140,"name":"NonUpdatableOrderConfiguration","msg":"Some piece of the order's configuration cannot be updated (the order should be cancelled and placed again)"},{"code":6141,"name":"BorrowOrderExecutionDisabled","msg":"Execution of borrow orders is disabled"},{"code":6142,"name":"DebtReachedReserveDebtTerm","msg":"Cannot increase the debt that has reached its end of term configured by the reserve"},{"code":6143,"name":"ExpectationNotMet","msg":"The on-chain state does not meet expectation specified by the caller, so the operation must be aborted (to avoid race conditions)"},{"code":6144,"name":"BorrowOrderFillValueTooSmall","msg":"Available liquidity could not satisfy the minimum required borrow order fill value"},{"code":6145,"name":"WithdrawTicketIssuanceDisabled","msg":"Issuing new withdraw tickets is disabled by the market"},{"code":6146,"name":"WithdrawTicketRedemptionDisabled","msg":"Redeeming withdraw tickets is disabled by the market"},{"code":6147,"name":"WithdrawTicketStillValid","msg":"Recovering collateral is only available after the withdraw ticket has been marked invalid"},{"code":6148,"name":"WithdrawTicketRequiresFullRedemption","msg":"The withdraw ticket's current state requires that it is fully redeemed (e.g. due to owner ATA creation), but there is not enough liquidity"},{"code":6149,"name":"UserTokenBalanceMismatch","msg":"The user's token account has changed its balance in an unexpected way"},{"code":6150,"name":"WithdrawQueuedLiquidityValueTooSmall","msg":"Available liquidity could not satisfy the minimum required ticketed withdrawal value"},{"code":6151,"name":"InvalidTokenAccountState","msg":"Token account is in a state preventing the handler's operation (e.g. frozen or delegate)"},{"code":6152,"name":"WithdrawTicketInvalid","msg":"Cannot use ticket that was already marked invalid"},{"code":6153,"name":"BorrowOrderValueTooSmall","msg":"Borrow order's value would be below the market-configured minimum"},{"code":6154,"name":"WithdrawTicketValueTooSmall","msg":"Withdraw ticket's value would be below the market-configured minimum"},{"code":6155,"name":"InvalidWithdrawTicketProgressCallbackConfig","msg":"Invalid configuration or required custom accounts for the requested withdraw ticket callback type"},{"code":6156,"name":"WithdrawTicketProgressCallbackAccountsMissing","msg":"One or more accounts required by the ticket's configured progress callback are missing"},{"code":6157,"name":"BorrowRolloverConfigurationDisabled","msg":"Configuring auto-rollover on loans is disabled by market owner"},{"code":6158,"name":"InvalidObligationConfigUpdateSubject","msg":"Invalid specification of the Obligation's part to be configured"},{"code":6159,"name":"BorrowRolloverLiquidityMintMismatch","msg":"Auto-rollover must use a target reserve of the same token"},{"code":6160,"name":"ObligationBorrowRolloverNotApplicable","msg":"The given borrow is not fixed-term and does not require rolling over"},{"code":6161,"name":"ObligationBorrowOutsideRolloverWindow","msg":"The given borrow is outside the corresponding market-configured rollover window"},{"code":6162,"name":"ObligationBorrowRolloverNotEnabledByOwner","msg":"Obligation's owner did not opt-in for auto-rollover of the given borrow"},{"code":6163,"name":"ObligationBorrowRolloverTargetReserveMismatch","msg":"Obligation's owner did not allow to roll over into terms offered by the given reserve"},{"code":6164,"name":"BorrowRolloverExecutionDisabled","msg":"Executing auto-rollover is disabled by market owner"},{"code":6165,"name":"ObligationAccountingMismatch","msg":"Obligation internal state accounting has been unexpectedly modified"},{"code":6166,"name":"PartialRolloverValueTooSmall","msg":"Partial rollover amount is below the market-configured minimum value"},{"code":6167,"name":"ObligationBorrowRolloverConfigMismatch","msg":"Pre-existing rollover configuration of the loan cannot be overwritten by the operation"},{"code":6168,"name":"ObligationBorrowRolloverMustProlongDebtTerm","msg":"Rollover into existing borrow must prolong the remaining debt term"},{"code":6169,"name":"RolloverNotSupportedInElevationGroup","msg":"Rollover is not supported for obligations in an elevation group"},{"code":6170,"name":"WithdrawTicketCancellationDisabled","msg":"Cancelling withdraw tickets is disabled by the market"},{"code":6171,"name":"WithdrawTicketFullyCancelled","msg":"Cannot use ticket that was already fully-cancelled"},{"code":6172,"name":"CloneSourceReserveDisabled","msg":"Cannot clone config from a reserve that is disabled"},{"code":6173,"name":"CloneTargetReserveAlreadyInUse","msg":"Cannot clone config into a reserve that has been in use"},{"code":6174,"name":"ClonedReserveLiquidityMintMismatch","msg":"Cannot clone config between reserves of different mints"},{"code":6175,"name":"ReserveEmergencyMode","msg":"Reserve emergency mode is enabled"},{"code":6176,"name":"ObligationOwnershipTransferInProgress","msg":"Obligation ownership transfer is in progress"},{"code":6177,"name":"ObligationOwnershipTransferNotInInitiatedState","msg":"Obligation ownership transfer is not in initiated state"},{"code":6178,"name":"ObligationPendingOwnerNotSet","msg":"Obligation pending owner not set"},{"code":6179,"name":"ObligationInvalidPendingOwner","msg":"Invalid pending owner address"},{"code":6180,"name":"ObligationOwnershipTransferNotApproved","msg":"Obligation ownership transfer not approved by admin"},{"code":6181,"name":"ObligationHasActiveBorrowOrders","msg":"Obligation has active borrow orders"},{"code":6182,"name":"OnlyComputeBudgetCompanionIxsAllowed","msg":"Only ComputeBudget instructions may accompany this instruction"},{"code":6183,"name":"MissingPermissioner","msg":"Required permissioning account is missing"},{"code":6184,"name":"ReserveRewardsDisabled","msg":"Reserve rewards are disabled on this market (reserve_rewards_max_apr_bps is 0)"}]}