@0dotxyz/p0-ts-sdk 2.3.3 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dto-rate-model.types-CfqbDcgG.d.cts +869 -0
- package/dist/dto-rate-model.types-CfqbDcgG.d.ts +869 -0
- package/dist/index.cjs +272 -731
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +270 -729
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.cts +2 -2
- package/dist/instructions.d.ts +2 -2
- package/dist/{types-Cxl2AUvk.d.ts → types-BnW15JjT.d.cts} +10 -10
- package/dist/{types-DtUR-yHt.d.cts → types-CviIoob4.d.ts} +10 -10
- package/dist/vendor.cjs +262 -721
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.d.cts +605 -26
- package/dist/vendor.d.ts +605 -26
- package/dist/vendor.js +253 -712
- package/dist/vendor.js.map +1 -1
- package/package.json +1 -1
- package/dist/dto-rate-model.types-DveIB9Ll.d.cts +0 -1726
- package/dist/dto-rate-model.types-DveIB9Ll.d.ts +0 -1726
package/dist/vendor.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import { PublicKey, TransactionInstruction, Connection, Transaction, Commitment,
|
|
|
3
3
|
import BigNumber$1 from 'bignumber.js';
|
|
4
4
|
export { a as CrossbarSimulatePayload, C as CurrentResult, F as FeedResponse, O as OracleSubmission, P as PullFeedAccountData, S as SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, d as decodeSwitchboardPullFeedData, g as getSwitchboardProgram, s as switchboardAccountCoder } from './index-BDDVBMdM.js';
|
|
5
5
|
import { Program, BorshCoder, Address } from '@coral-xyz/anchor';
|
|
6
|
-
import {
|
|
7
|
-
export {
|
|
6
|
+
import { K as KaminoReserve, a as KaminoObligation, j as KaminoObligationJSON, i as KaminoReserveJSON, t as KaminoBorrowRateCurvePoint, u as KaminoFarmRewardInfo, b as KaminoFarmState, k as KaminoFarmStateJSON, H as HistoricalOracleData, v as HistoricalIndexData, P as PoolBalance, I as InsuranceFund, F as FeeStructureJSON, O as OracleGuardRailsJSON, w as FeeStructure, x as OracleGuardRails, S as SpotPosition, e as DriftUserStats, o as DriftUserStatsJSON, c as DriftUser, m as DriftUserJSON, D as DriftSpotMarket, l as DriftSpotMarketJSON, d as DriftRewards, n as DriftRewardsJSON, y as DriftSpotBalanceType, J as JupLendingState, p as JupLendingStateJSON, f as JupTokenReserve, q as JupTokenReserveJSON, g as JupLendingRewardsRateModel, r as JupLendingRewardsRateModelJSON, h as JupRateModel, s as JupRateModelJSON } from './dto-rate-model.types-CfqbDcgG.js';
|
|
7
|
+
export { ab as FeeTier, ac as FeeTierJSON, ak as HistoricalIndexDataJSON, aj as HistoricalOracleDataJSON, am as InsuranceFundJSON, C as KaminoBorrowRateCurve, T as KaminoBorrowRateCurveJSON, U as KaminoBorrowRateCurvePointJSON, a5 as KaminoFarmRewardInfoJSON, a1 as KaminoFarmTokenInfo, a4 as KaminoFarmTokenInfoJSON, Z as KaminoObligationCollateral, $ as KaminoObligationCollateralJSON, _ as KaminoObligationLiquidity, a0 as KaminoObligationLiquidityJSON, M as KaminoPythConfiguration, Y as KaminoPythConfigurationJSON, A as KaminoReserveCollateral, Q as KaminoReserveCollateralJSON, B as KaminoReserveConfig, R as KaminoReserveConfigJSON, z as KaminoReserveLiquidity, N as KaminoReserveLiquidityJSON, E as KaminoReserveTokenInfo, V as KaminoReserveTokenInfoJSON, a3 as KaminoRewardCurvePoint, a7 as KaminoRewardCurvePointJSON, a2 as KaminoRewardScheduleCurve, a6 as KaminoRewardScheduleCurveJSON, G as KaminoScopeConfiguration, W as KaminoScopeConfigurationJSON, L as KaminoSwitchboardConfiguration, X as KaminoSwitchboardConfigurationJSON, ad as OrderFillerRewardStructure, ae as OrderFillerRewardStructureJSON, al as PoolBalanceJSON, af as PriceDivergenceGuardRails, ag as PriceDivergenceGuardRailsJSON, an as SpotBalanceType, ao as SpotPositionJSON, a9 as UserFeesFields, a8 as UserFeesJSON, ah as ValidityGuardRails, ai as ValidityGuardRailsJSON, aa as isSpotBalanceTypeVariant } from './dto-rate-model.types-CfqbDcgG.js';
|
|
8
|
+
import BN from 'bn.js';
|
|
8
9
|
import Decimal from 'decimal.js';
|
|
9
10
|
import * as _solana_buffer_layout from '@solana/buffer-layout';
|
|
10
11
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
11
|
-
import BN from 'bn.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
@@ -8029,23 +8029,595 @@ declare const KFARMS_IDL: Farms;
|
|
|
8029
8029
|
type KlendIdlType = KaminoLending;
|
|
8030
8030
|
type KfarmsIdlType = Farms;
|
|
8031
8031
|
|
|
8032
|
+
interface LastUpdateFields {
|
|
8033
|
+
/** Last slot when updated */
|
|
8034
|
+
slot: BN;
|
|
8035
|
+
/** True when marked stale, false when slot updated */
|
|
8036
|
+
stale: number;
|
|
8037
|
+
/** Status of the prices used to calculate the last update */
|
|
8038
|
+
priceStatus: number;
|
|
8039
|
+
placeholder: Array<number>;
|
|
8040
|
+
}
|
|
8041
|
+
interface BigFractionBytesFields {
|
|
8042
|
+
value: Array<BN>;
|
|
8043
|
+
padding: Array<BN>;
|
|
8044
|
+
}
|
|
8045
|
+
|
|
8046
|
+
interface ReserveRaw {
|
|
8047
|
+
/** Version of the reserve */
|
|
8048
|
+
version: BN;
|
|
8049
|
+
/** Last slot when supply and rates updated */
|
|
8050
|
+
lastUpdate: LastUpdateFields;
|
|
8051
|
+
/** Lending market address */
|
|
8052
|
+
lendingMarket: PublicKey;
|
|
8053
|
+
farmCollateral: PublicKey;
|
|
8054
|
+
farmDebt: PublicKey;
|
|
8055
|
+
/** Reserve liquidity */
|
|
8056
|
+
liquidity: ReserveLiquidityFields;
|
|
8057
|
+
reserveLiquidityPadding: Array<BN>;
|
|
8058
|
+
/** Reserve collateral */
|
|
8059
|
+
collateral: ReserveCollateralFields;
|
|
8060
|
+
reserveCollateralPadding: Array<BN>;
|
|
8061
|
+
/** Reserve configuration values */
|
|
8062
|
+
config: ReserveConfigFields;
|
|
8063
|
+
configPadding: Array<BN>;
|
|
8064
|
+
borrowedAmountOutsideElevationGroup: BN;
|
|
8065
|
+
/**
|
|
8066
|
+
* Amount of token borrowed in lamport of debt asset in the given
|
|
8067
|
+
* elevation group when this reserve is part of the collaterals.
|
|
8068
|
+
*/
|
|
8069
|
+
borrowedAmountsAgainstThisReserveInElevationGroups: Array<BN>;
|
|
8070
|
+
padding: Array<BN>;
|
|
8071
|
+
}
|
|
8072
|
+
interface ReserveLiquidityFields {
|
|
8073
|
+
/** Reserve liquidity mint address */
|
|
8074
|
+
mintPubkey: PublicKey;
|
|
8075
|
+
/** Reserve liquidity supply address */
|
|
8076
|
+
supplyVault: PublicKey;
|
|
8077
|
+
/** Reserve liquidity fee collection address */
|
|
8078
|
+
feeVault: PublicKey;
|
|
8079
|
+
/** Reserve liquidity available */
|
|
8080
|
+
availableAmount: BN;
|
|
8081
|
+
/** Reserve liquidity borrowed (scaled fraction) */
|
|
8082
|
+
borrowedAmountSf: BN;
|
|
8083
|
+
/** Reserve liquidity market price in quote currency (scaled fraction) */
|
|
8084
|
+
marketPriceSf: BN;
|
|
8085
|
+
/** Unix timestamp of the market price (from the oracle) */
|
|
8086
|
+
marketPriceLastUpdatedTs: BN;
|
|
8087
|
+
/** Reserve liquidity mint decimals */
|
|
8088
|
+
mintDecimals: BN;
|
|
8089
|
+
/**
|
|
8090
|
+
* 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.
|
|
8091
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
8092
|
+
*/
|
|
8093
|
+
depositLimitCrossedTimestamp: BN;
|
|
8094
|
+
/**
|
|
8095
|
+
* 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.
|
|
8096
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
8097
|
+
*/
|
|
8098
|
+
borrowLimitCrossedTimestamp: BN;
|
|
8099
|
+
/** Reserve liquidity cumulative borrow rate (scaled fraction) */
|
|
8100
|
+
cumulativeBorrowRateBsf: BigFractionBytesFields;
|
|
8101
|
+
/** Reserve cumulative protocol fees (scaled fraction) */
|
|
8102
|
+
accumulatedProtocolFeesSf: BN;
|
|
8103
|
+
/** Reserve cumulative referrer fees (scaled fraction) */
|
|
8104
|
+
accumulatedReferrerFeesSf: BN;
|
|
8105
|
+
/** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
|
|
8106
|
+
pendingReferrerFeesSf: BN;
|
|
8107
|
+
/** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
|
|
8108
|
+
absoluteReferralRateSf: BN;
|
|
8109
|
+
/** Token program of the liquidity mint */
|
|
8110
|
+
tokenProgram: PublicKey;
|
|
8111
|
+
padding2: Array<BN>;
|
|
8112
|
+
padding3: Array<BN>;
|
|
8113
|
+
}
|
|
8114
|
+
interface ReserveCollateralFields {
|
|
8115
|
+
/** Reserve collateral mint address */
|
|
8116
|
+
mintPubkey: PublicKey;
|
|
8117
|
+
/** Reserve collateral mint supply, used for exchange rate */
|
|
8118
|
+
mintTotalSupply: BN;
|
|
8119
|
+
/** Reserve collateral supply address */
|
|
8120
|
+
supplyVault: PublicKey;
|
|
8121
|
+
padding1: Array<BN>;
|
|
8122
|
+
padding2: Array<BN>;
|
|
8123
|
+
}
|
|
8124
|
+
interface ReserveConfigFields {
|
|
8125
|
+
/** Status of the reserve Active/Obsolete/Hidden */
|
|
8126
|
+
status: number;
|
|
8127
|
+
/** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */
|
|
8128
|
+
assetTier: number;
|
|
8129
|
+
/** Flat rate that goes to the host */
|
|
8130
|
+
hostFixedInterestRateBps: number;
|
|
8131
|
+
/**
|
|
8132
|
+
* [DEPRECATED] Space that used to hold 2 fields:
|
|
8133
|
+
* - Boost for side (debt or collateral)
|
|
8134
|
+
* - Reward points multiplier per obligation type
|
|
8135
|
+
* Can be re-used after making sure all underlying production account data is zeroed.
|
|
8136
|
+
*/
|
|
8137
|
+
reserved2: Array<number>;
|
|
8138
|
+
/** Cut of the order execution bonus that the protocol receives, as a percentage */
|
|
8139
|
+
protocolOrderExecutionFeePct: number;
|
|
8140
|
+
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
8141
|
+
protocolTakeRatePct: number;
|
|
8142
|
+
/** Cut of the liquidation bonus that the protocol receives, as a percentage */
|
|
8143
|
+
protocolLiquidationFeePct: number;
|
|
8144
|
+
/**
|
|
8145
|
+
* Target ratio of the value of borrows to deposits, as a percentage
|
|
8146
|
+
* 0 if use as collateral is disabled
|
|
8147
|
+
*/
|
|
8148
|
+
loanToValuePct: number;
|
|
8149
|
+
/** Loan to value ratio at which an obligation can be liquidated, as percentage */
|
|
8150
|
+
liquidationThresholdPct: number;
|
|
8151
|
+
/** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */
|
|
8152
|
+
minLiquidationBonusBps: number;
|
|
8153
|
+
/** Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */
|
|
8154
|
+
maxLiquidationBonusBps: number;
|
|
8155
|
+
/** Bad debt liquidation bonus for an undercollateralized obligation, as bps */
|
|
8156
|
+
badDebtLiquidationBonusBps: number;
|
|
8157
|
+
/**
|
|
8158
|
+
* Time in seconds that must pass before redemptions are enabled after the deposit limit is
|
|
8159
|
+
* crossed.
|
|
8160
|
+
* Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case.
|
|
8161
|
+
*/
|
|
8162
|
+
deleveragingMarginCallPeriodSecs: BN;
|
|
8163
|
+
/**
|
|
8164
|
+
* The rate at which the deleveraging threshold decreases, in bps per day.
|
|
8165
|
+
* Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case.
|
|
8166
|
+
*/
|
|
8167
|
+
deleveragingThresholdDecreaseBpsPerDay: BN;
|
|
8168
|
+
/** Program owner fees assessed, separate from gains due to interest accrual */
|
|
8169
|
+
fees: ReserveFeesFields;
|
|
8170
|
+
/** Borrow rate curve based on utilization */
|
|
8171
|
+
borrowRateCurve: BorrowRateCurveFields;
|
|
8172
|
+
/** Borrow factor in percentage - used for risk adjustment */
|
|
8173
|
+
borrowFactorPct: BN;
|
|
8174
|
+
/** Maximum deposit limit of liquidity in native units, u64::MAX for inf */
|
|
8175
|
+
depositLimit: BN;
|
|
8176
|
+
/** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */
|
|
8177
|
+
borrowLimit: BN;
|
|
8178
|
+
/** Token id from TokenInfos struct */
|
|
8179
|
+
tokenInfo: TokenInfoFields$1;
|
|
8180
|
+
/** Deposit withdrawal caps - deposit & redeem */
|
|
8181
|
+
depositWithdrawalCap: WithdrawalCapsFields;
|
|
8182
|
+
/** Debt withdrawal caps - borrow & repay */
|
|
8183
|
+
debtWithdrawalCap: WithdrawalCapsFields;
|
|
8184
|
+
elevationGroups: Array<number>;
|
|
8185
|
+
disableUsageAsCollOutsideEmode: number;
|
|
8186
|
+
/** Utilization (in percentage) above which borrowing is blocked. 0 to disable. */
|
|
8187
|
+
utilizationLimitBlockBorrowingAbovePct: number;
|
|
8188
|
+
/**
|
|
8189
|
+
* Whether this reserve should be subject to auto-deleveraging after deposit or borrow limit is
|
|
8190
|
+
* crossed.
|
|
8191
|
+
* Besides this flag, the lending market's flag also needs to be enabled (logical `AND`).
|
|
8192
|
+
* **NOTE:** the manual "target LTV" deleveraging (enabled by the risk council for individual
|
|
8193
|
+
* obligations) is NOT affected by this flag.
|
|
8194
|
+
*/
|
|
8195
|
+
autodeleverageEnabled: number;
|
|
8196
|
+
reserved1: Array<number>;
|
|
8197
|
+
/**
|
|
8198
|
+
* Maximum amount liquidity of this reserve borrowed outside all elevation groups
|
|
8199
|
+
* - u64::MAX for inf
|
|
8200
|
+
* - 0 to disable borrows outside elevation groups
|
|
8201
|
+
*/
|
|
8202
|
+
borrowLimitOutsideElevationGroup: BN;
|
|
8203
|
+
/**
|
|
8204
|
+
* Defines the maximum amount (in lamports of elevation group debt asset)
|
|
8205
|
+
* that can be borrowed when this reserve is used as collateral.
|
|
8206
|
+
* - u64::MAX for inf
|
|
8207
|
+
* - 0 to disable borrows in this elevation group (expected value for the debt asset)
|
|
8208
|
+
*/
|
|
8209
|
+
borrowLimitAgainstThisCollateralInElevationGroup: Array<BN>;
|
|
8210
|
+
/**
|
|
8211
|
+
* The rate at which the deleveraging-related liquidation bonus increases, in bps per day.
|
|
8212
|
+
* Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case.
|
|
8213
|
+
*/
|
|
8214
|
+
deleveragingBonusIncreaseBpsPerDay: BN;
|
|
8215
|
+
}
|
|
8216
|
+
interface ReserveFeesFields {
|
|
8217
|
+
/**
|
|
8218
|
+
* Fee assessed on `BorrowObligationLiquidity`, as scaled fraction (60 bits fractional part)
|
|
8219
|
+
* Must be between `0` and `2^60`, such that `2^60 = 1`. A few examples for
|
|
8220
|
+
* clarity:
|
|
8221
|
+
* 1% = (1 << 60) / 100 = 11529215046068470
|
|
8222
|
+
* 0.01% (1 basis point) = 115292150460685
|
|
8223
|
+
* 0.00001% (Aave borrow fee) = 115292150461
|
|
8224
|
+
*/
|
|
8225
|
+
borrowFeeSf: BN;
|
|
8226
|
+
/**
|
|
8227
|
+
* Fee for flash loan, expressed as scaled fraction.
|
|
8228
|
+
* 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
|
|
8229
|
+
*/
|
|
8230
|
+
flashLoanFeeSf: BN;
|
|
8231
|
+
/** Used for allignment */
|
|
8232
|
+
padding: Array<number>;
|
|
8233
|
+
}
|
|
8234
|
+
interface BorrowRateCurveFields {
|
|
8235
|
+
points: Array<CurvePointFields>;
|
|
8236
|
+
}
|
|
8237
|
+
interface CurvePointFields {
|
|
8238
|
+
utilizationRateBps: number;
|
|
8239
|
+
borrowRateBps: number;
|
|
8240
|
+
}
|
|
8241
|
+
interface TokenInfoFields$1 {
|
|
8242
|
+
/** UTF-8 encoded name of the token (null-terminated) */
|
|
8243
|
+
name: Array<number>;
|
|
8244
|
+
/** Heuristics limits of acceptable price */
|
|
8245
|
+
heuristic: PriceHeuristicFields;
|
|
8246
|
+
/** Max divergence between twap and price in bps */
|
|
8247
|
+
maxTwapDivergenceBps: BN;
|
|
8248
|
+
maxAgePriceSeconds: BN;
|
|
8249
|
+
maxAgeTwapSeconds: BN;
|
|
8250
|
+
/** Scope price configuration */
|
|
8251
|
+
scopeConfiguration: ScopeConfigurationFields;
|
|
8252
|
+
/** Switchboard configuration */
|
|
8253
|
+
switchboardConfiguration: SwitchboardConfigurationFields;
|
|
8254
|
+
/** Pyth configuration */
|
|
8255
|
+
pythConfiguration: PythConfigurationFields;
|
|
8256
|
+
blockPriceUsage: number;
|
|
8257
|
+
reserved: Array<number>;
|
|
8258
|
+
padding: Array<BN>;
|
|
8259
|
+
}
|
|
8260
|
+
interface PriceHeuristicFields {
|
|
8261
|
+
/** Lower value of acceptable price */
|
|
8262
|
+
lower: BN;
|
|
8263
|
+
/** Upper value of acceptable price */
|
|
8264
|
+
upper: BN;
|
|
8265
|
+
/** Number of decimals of the previously defined values */
|
|
8266
|
+
exp: BN;
|
|
8267
|
+
}
|
|
8268
|
+
interface ScopeConfigurationFields {
|
|
8269
|
+
/** Pubkey of the scope price feed (disabled if `null` or `default`) */
|
|
8270
|
+
priceFeed: PublicKey;
|
|
8271
|
+
/** This is the scope_id price chain that results in a price for the token */
|
|
8272
|
+
priceChain: Array<number>;
|
|
8273
|
+
/** This is the scope_id price chain for the twap */
|
|
8274
|
+
twapChain: Array<number>;
|
|
8275
|
+
}
|
|
8276
|
+
interface SwitchboardConfigurationFields {
|
|
8277
|
+
/** Pubkey of the base price feed (disabled if `null` or `default`) */
|
|
8278
|
+
priceAggregator: PublicKey;
|
|
8279
|
+
twapAggregator: PublicKey;
|
|
8280
|
+
}
|
|
8281
|
+
interface PythConfigurationFields {
|
|
8282
|
+
/** Pubkey of the base price feed (disabled if `null` or `default`) */
|
|
8283
|
+
price: PublicKey;
|
|
8284
|
+
}
|
|
8285
|
+
interface WithdrawalCapsFields {
|
|
8286
|
+
configCapacity: BN;
|
|
8287
|
+
currentTotal: BN;
|
|
8288
|
+
lastIntervalStartTimestamp: BN;
|
|
8289
|
+
configIntervalLengthSeconds: BN;
|
|
8290
|
+
}
|
|
8291
|
+
|
|
8292
|
+
interface ObligationRaw {
|
|
8293
|
+
/** Version of the struct */
|
|
8294
|
+
tag: BN;
|
|
8295
|
+
/** Last update to collateral, liquidity, or their market values */
|
|
8296
|
+
lastUpdate: LastUpdateFields;
|
|
8297
|
+
/** Lending market address */
|
|
8298
|
+
lendingMarket: PublicKey;
|
|
8299
|
+
/** Owner authority which can borrow liquidity */
|
|
8300
|
+
owner: PublicKey;
|
|
8301
|
+
/** Deposited collateral for the obligation, unique by deposit reserve address */
|
|
8302
|
+
deposits: Array<ObligationCollateralFields>;
|
|
8303
|
+
/** Worst LTV for the collaterals backing the loan, represented as a percentage */
|
|
8304
|
+
lowestReserveDepositLiquidationLtv: BN;
|
|
8305
|
+
/** Market value of deposits (scaled fraction) */
|
|
8306
|
+
depositedValueSf: BN;
|
|
8307
|
+
/** Borrowed liquidity for the obligation, unique by borrow reserve address */
|
|
8308
|
+
borrows: Array<ObligationLiquidityFields>;
|
|
8309
|
+
/** Risk adjusted market value of borrows/debt (sum of price * borrowed_amount * borrow_factor) (scaled fraction) */
|
|
8310
|
+
borrowFactorAdjustedDebtValueSf: BN;
|
|
8311
|
+
/** Market value of borrows - used for max_liquidatable_borrowed_amount (scaled fraction) */
|
|
8312
|
+
borrowedAssetsMarketValueSf: BN;
|
|
8313
|
+
/** The maximum borrow value at the weighted average loan to value ratio (scaled fraction) */
|
|
8314
|
+
allowedBorrowValueSf: BN;
|
|
8315
|
+
/** The dangerous borrow value at the weighted average liquidation threshold (scaled fraction) */
|
|
8316
|
+
unhealthyBorrowValueSf: BN;
|
|
8317
|
+
/** The asset tier of the deposits */
|
|
8318
|
+
depositsAssetTiers: Array<number>;
|
|
8319
|
+
/** The asset tier of the borrows */
|
|
8320
|
+
borrowsAssetTiers: Array<number>;
|
|
8321
|
+
/** The elevation group id the obligation opted into. */
|
|
8322
|
+
elevationGroup: number;
|
|
8323
|
+
/** The number of obsolete reserves the obligation has a deposit in */
|
|
8324
|
+
numOfObsoleteDepositReserves: number;
|
|
8325
|
+
/** Marked = 1 if borrows array is not empty, 0 = borrows empty */
|
|
8326
|
+
hasDebt: number;
|
|
8327
|
+
/** Wallet address of the referrer */
|
|
8328
|
+
referrer: PublicKey;
|
|
8329
|
+
/** Marked = 1 if borrowing disabled, 0 = borrowing enabled */
|
|
8330
|
+
borrowingDisabled: number;
|
|
8331
|
+
/**
|
|
8332
|
+
* A target LTV set by the risk council when marking this obligation for deleveraging.
|
|
8333
|
+
* Only effective when `deleveraging_margin_call_started_slot != 0`.
|
|
8334
|
+
*/
|
|
8335
|
+
autodeleverageTargetLtvPct: number;
|
|
8336
|
+
/** The lowest max LTV found amongst the collateral deposits */
|
|
8337
|
+
lowestReserveDepositMaxLtvPct: number;
|
|
8338
|
+
/** The number of obsolete reserves the obligation has a borrow in */
|
|
8339
|
+
numOfObsoleteBorrowReserves: number;
|
|
8340
|
+
reserved: Array<number>;
|
|
8341
|
+
highestBorrowFactorPct: BN;
|
|
8342
|
+
/**
|
|
8343
|
+
* A timestamp at which the risk council most-recently marked this obligation for deleveraging.
|
|
8344
|
+
* Zero if not currently subject to deleveraging.
|
|
8345
|
+
*/
|
|
8346
|
+
autodeleverageMarginCallStartedTimestamp: BN;
|
|
8347
|
+
/**
|
|
8348
|
+
* Owner-defined, liquidator-executed orders applicable to this obligation.
|
|
8349
|
+
* Typical use-cases would be a stop-loss and a take-profit (possibly co-existing).
|
|
8350
|
+
*/
|
|
8351
|
+
orders: Array<ObligationOrderFields>;
|
|
8352
|
+
padding3: Array<BN>;
|
|
8353
|
+
}
|
|
8354
|
+
interface ObligationCollateralFields {
|
|
8355
|
+
/** Reserve collateral is deposited to */
|
|
8356
|
+
depositReserve: PublicKey;
|
|
8357
|
+
/** Amount of collateral deposited */
|
|
8358
|
+
depositedAmount: BN;
|
|
8359
|
+
/** Collateral market value in quote currency (scaled fraction) */
|
|
8360
|
+
marketValueSf: BN;
|
|
8361
|
+
/**
|
|
8362
|
+
* Debt amount (lamport) taken against this collateral.
|
|
8363
|
+
* (only meaningful if this obligation is part of an elevation group, otherwise 0)
|
|
8364
|
+
* This is only indicative of the debt computed on the last refresh obligation.
|
|
8365
|
+
* If the obligation have multiple collateral this value is the same for all of them.
|
|
8366
|
+
*/
|
|
8367
|
+
borrowedAmountAgainstThisCollateralInElevationGroup: BN;
|
|
8368
|
+
padding: Array<BN>;
|
|
8369
|
+
}
|
|
8370
|
+
interface ObligationLiquidityFields {
|
|
8371
|
+
/** Reserve liquidity is borrowed from */
|
|
8372
|
+
borrowReserve: PublicKey;
|
|
8373
|
+
/** Borrow rate used for calculating interest (big scaled fraction) */
|
|
8374
|
+
cumulativeBorrowRateBsf: BigFractionBytesFields;
|
|
8375
|
+
padding: BN;
|
|
8376
|
+
/** Amount of liquidity borrowed plus interest (scaled fraction) */
|
|
8377
|
+
borrowedAmountSf: BN;
|
|
8378
|
+
/** Liquidity market value in quote currency (scaled fraction) */
|
|
8379
|
+
marketValueSf: BN;
|
|
8380
|
+
/** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */
|
|
8381
|
+
borrowFactorAdjustedMarketValueSf: BN;
|
|
8382
|
+
/** Amount of liquidity borrowed outside of an elevation group */
|
|
8383
|
+
borrowedAmountOutsideElevationGroups: BN;
|
|
8384
|
+
padding2: Array<BN>;
|
|
8385
|
+
}
|
|
8386
|
+
interface ObligationOrderFields {
|
|
8387
|
+
/**
|
|
8388
|
+
* A threshold value used by the condition (scaled [Fraction]).
|
|
8389
|
+
* The exact meaning depends on the specific [Self::condition_type].
|
|
8390
|
+
*
|
|
8391
|
+
* Examples:
|
|
8392
|
+
* - when `condition_type == 2 (UserLtvBelow)`:
|
|
8393
|
+
* then a value of `0.455` here means that the order is active only when the obligation's
|
|
8394
|
+
* user LTV is less than `0.455` (i.e. < 45.5%).
|
|
8395
|
+
* - when `condition_type == 3 (DebtCollPriceRatioAbove)`:
|
|
8396
|
+
* assuming the obligation uses BTC collateral for SOL debt, then a value of `491.3` here
|
|
8397
|
+
* means that the order is active only when the BTC-SOL price is greater than `491.3` (i.e.
|
|
8398
|
+
* > 491.3 SOL per BTC).
|
|
8399
|
+
*/
|
|
8400
|
+
conditionThresholdSf: BN;
|
|
8401
|
+
/**
|
|
8402
|
+
* A configuration parameter used by the opportunity (scaled [Fraction]).
|
|
8403
|
+
* The exact meaning depends on the specific [Self::opportunity_type].
|
|
8404
|
+
*
|
|
8405
|
+
* Examples:
|
|
8406
|
+
* - when `opportunity_type == 0 (DeleverageSingleDebtAmount)`:
|
|
8407
|
+
* Assuming the obligation uses BTC collateral for SOL debt, then a value of `1_234_000_000`
|
|
8408
|
+
* here means that a liquidator may repay up to 1234000000 lamports (i.e. 1.234 SOL) on this
|
|
8409
|
+
* obligation.
|
|
8410
|
+
* Note: the special value of [Fraction::MAX] is *not* allowed in this case.
|
|
8411
|
+
* - when `opportunity_type == 1 (DeleverageAllDebtAmount)`:
|
|
8412
|
+
* The only allowed value in this case is [Fraction::MAX] (to emphasize that *all* debt
|
|
8413
|
+
* should be repaid).
|
|
8414
|
+
*/
|
|
8415
|
+
opportunityParameterSf: BN;
|
|
8416
|
+
/**
|
|
8417
|
+
* A *minimum* additional fraction of collateral transferred to the liquidator, in bps.
|
|
8418
|
+
*
|
|
8419
|
+
* The minimum bonus is applied exactly when the [Self::condition_threshold_sf] is met, and
|
|
8420
|
+
* grows linearly towards the [Self::max_execution_bonus_bps].
|
|
8421
|
+
*
|
|
8422
|
+
* Example: a value of `50` here means 50bps == 0.5% bonus for an "LTV > 65%" order, when
|
|
8423
|
+
* executed precisely at the moment LTV exceeds 65%.
|
|
8424
|
+
*/
|
|
8425
|
+
minExecutionBonusBps: number;
|
|
8426
|
+
/**
|
|
8427
|
+
* A *maximum* additional fraction of collateral transferred to the liquidator, in bps.
|
|
8428
|
+
*
|
|
8429
|
+
* The maximum bonus is applied at the relevant "extreme" state of the obligation, i.e.:
|
|
8430
|
+
* - for a stop-loss condition, it is a point at which the obligation becomes liquidatable;
|
|
8431
|
+
* - for a take-profit condition, it is a point at which obligation has 0% LTV.
|
|
8432
|
+
*
|
|
8433
|
+
* In non-extreme states, the actual bonus value is interpolated linearly, starting from
|
|
8434
|
+
* [Self::min_execution_bonus_bps] (at the point specified by the order's condition).
|
|
8435
|
+
*
|
|
8436
|
+
* Example: a value of `300` here means 300bps == 3.0% bonus for a "debt/coll price > 140"
|
|
8437
|
+
* order, when executed at a higher price = 200, at which the obligation's LTV happens to
|
|
8438
|
+
* be equal to its liquidation LTV.
|
|
8439
|
+
*/
|
|
8440
|
+
maxExecutionBonusBps: number;
|
|
8441
|
+
/**
|
|
8442
|
+
* Serialized [ConditionType].
|
|
8443
|
+
* The entire order is void when this is zeroed (i.e. representing [ConditionType::Never]).
|
|
8444
|
+
*
|
|
8445
|
+
* Example: a value of `2` here denotes `UserLtvBelow` condition type. Of course, to
|
|
8446
|
+
* interpret this condition, we also need to take the [Self::condition_threshold_sf] into
|
|
8447
|
+
* account.
|
|
8448
|
+
*/
|
|
8449
|
+
conditionType: number;
|
|
8450
|
+
/**
|
|
8451
|
+
* Serialized [OpportunityType].
|
|
8452
|
+
*
|
|
8453
|
+
* Example: a value of `0` here denotes `DeleverageSingleDebtAmount` opportunity. Of course, to
|
|
8454
|
+
* interpret this opportunity, we also need to take the [Self::opportunity_parameter_sf] into
|
|
8455
|
+
* account.
|
|
8456
|
+
*/
|
|
8457
|
+
opportunityType: number;
|
|
8458
|
+
/**
|
|
8459
|
+
* Internal padding.
|
|
8460
|
+
* The fields above take up 2+2+1+1 bytes = 48 bits, which means we need 80 bits = 10 bytes to
|
|
8461
|
+
* align with `u128`s.
|
|
8462
|
+
*/
|
|
8463
|
+
padding1: Array<number>;
|
|
8464
|
+
/**
|
|
8465
|
+
* End padding.
|
|
8466
|
+
* The total size of a single instance is 8*u128 = 128 bytes.
|
|
8467
|
+
*/
|
|
8468
|
+
padding2: Array<BN>;
|
|
8469
|
+
}
|
|
8470
|
+
|
|
8471
|
+
interface FarmStateRaw {
|
|
8472
|
+
farmAdmin: PublicKey;
|
|
8473
|
+
globalConfig: PublicKey;
|
|
8474
|
+
token: TokenInfoFields;
|
|
8475
|
+
rewardInfos: Array<RewardInfoFields>;
|
|
8476
|
+
numRewardTokens: BN;
|
|
8477
|
+
/** Data used to calculate the rewards of the user */
|
|
8478
|
+
numUsers: BN;
|
|
8479
|
+
/**
|
|
8480
|
+
* The number of token in the `farm_vault` staked (getting rewards and fees)
|
|
8481
|
+
* Set such as `farm_vault.amount = total_staked_amount + total_pending_amount`
|
|
8482
|
+
*/
|
|
8483
|
+
totalStakedAmount: BN;
|
|
8484
|
+
farmVault: PublicKey;
|
|
8485
|
+
farmVaultsAuthority: PublicKey;
|
|
8486
|
+
farmVaultsAuthorityBump: BN;
|
|
8487
|
+
/**
|
|
8488
|
+
* Only used for delegate farms
|
|
8489
|
+
* Set to `default()` otherwise
|
|
8490
|
+
*/
|
|
8491
|
+
delegateAuthority: PublicKey;
|
|
8492
|
+
/**
|
|
8493
|
+
* Raw representation of a `TimeUnit`
|
|
8494
|
+
* Seconds = 0, Slots = 1
|
|
8495
|
+
*/
|
|
8496
|
+
timeUnit: number;
|
|
8497
|
+
/**
|
|
8498
|
+
* Automatically set to true in case of a full authority withdrawal
|
|
8499
|
+
* If true, the farm is frozen and no more deposits are allowed
|
|
8500
|
+
*/
|
|
8501
|
+
isFarmFrozen: number;
|
|
8502
|
+
/**
|
|
8503
|
+
* Indicates if the farm is a delegate farm
|
|
8504
|
+
* If true, the farm is a delegate farm and the `delegate_authority` is set*
|
|
8505
|
+
*/
|
|
8506
|
+
isFarmDelegated: number;
|
|
8507
|
+
padding0: Array<number>;
|
|
8508
|
+
/**
|
|
8509
|
+
* Withdraw authority for the farm, allowed to lock deposited funds and withdraw them
|
|
8510
|
+
* Set to `default()` if unused (only the depositors can withdraw their funds)
|
|
8511
|
+
*/
|
|
8512
|
+
withdrawAuthority: PublicKey;
|
|
8513
|
+
/**
|
|
8514
|
+
* Delay between a user deposit and the moment it is considered as staked
|
|
8515
|
+
* 0 if unused
|
|
8516
|
+
*/
|
|
8517
|
+
depositWarmupPeriod: number;
|
|
8518
|
+
/** Delay between a user unstake and the ability to withdraw his deposit. */
|
|
8519
|
+
withdrawalCooldownPeriod: number;
|
|
8520
|
+
/** Total active stake of tokens in the farm (scaled from `Decimal` representation). */
|
|
8521
|
+
totalActiveStakeScaled: BN;
|
|
8522
|
+
/**
|
|
8523
|
+
* Total pending stake of tokens in the farm (scaled from `Decimal` representation).
|
|
8524
|
+
* (can be used by `withdraw_authority` but don't get rewards or fees)
|
|
8525
|
+
*/
|
|
8526
|
+
totalPendingStakeScaled: BN;
|
|
8527
|
+
/** Total pending amount of tokens in the farm */
|
|
8528
|
+
totalPendingAmount: BN;
|
|
8529
|
+
/** Slashed amounts from early withdrawal */
|
|
8530
|
+
slashedAmountCurrent: BN;
|
|
8531
|
+
slashedAmountCumulative: BN;
|
|
8532
|
+
slashedAmountSpillAddress: PublicKey;
|
|
8533
|
+
/** Locking stake */
|
|
8534
|
+
lockingMode: BN;
|
|
8535
|
+
lockingStartTimestamp: BN;
|
|
8536
|
+
lockingDuration: BN;
|
|
8537
|
+
lockingEarlyWithdrawalPenaltyBps: BN;
|
|
8538
|
+
depositCapAmount: BN;
|
|
8539
|
+
scopePrices: PublicKey;
|
|
8540
|
+
scopeOraclePriceId: BN;
|
|
8541
|
+
scopeOracleMaxAge: BN;
|
|
8542
|
+
pendingFarmAdmin: PublicKey;
|
|
8543
|
+
strategyId: PublicKey;
|
|
8544
|
+
delegatedRpsAdmin: PublicKey;
|
|
8545
|
+
vaultId: PublicKey;
|
|
8546
|
+
secondDelegatedAuthority: PublicKey;
|
|
8547
|
+
padding: Array<BN>;
|
|
8548
|
+
}
|
|
8549
|
+
interface TokenInfoFields {
|
|
8550
|
+
mint: PublicKey;
|
|
8551
|
+
decimals: BN;
|
|
8552
|
+
tokenProgram: PublicKey;
|
|
8553
|
+
padding: Array<BN>;
|
|
8554
|
+
}
|
|
8555
|
+
interface RewardInfoFields {
|
|
8556
|
+
token: TokenInfoFields;
|
|
8557
|
+
rewardsVault: PublicKey;
|
|
8558
|
+
rewardsAvailable: BN;
|
|
8559
|
+
rewardScheduleCurve: RewardScheduleCurveFields;
|
|
8560
|
+
minClaimDurationSeconds: BN;
|
|
8561
|
+
lastIssuanceTs: BN;
|
|
8562
|
+
rewardsIssuedUnclaimed: BN;
|
|
8563
|
+
rewardsIssuedCumulative: BN;
|
|
8564
|
+
rewardPerShareScaled: BN;
|
|
8565
|
+
placeholder0: BN;
|
|
8566
|
+
rewardType: number;
|
|
8567
|
+
rewardsPerSecondDecimals: number;
|
|
8568
|
+
padding0: Array<number>;
|
|
8569
|
+
padding1: Array<BN>;
|
|
8570
|
+
}
|
|
8571
|
+
interface RewardPerTimeUnitPointFields {
|
|
8572
|
+
tsStart: BN;
|
|
8573
|
+
rewardPerTimeUnit: BN;
|
|
8574
|
+
}
|
|
8575
|
+
interface RewardScheduleCurveFields {
|
|
8576
|
+
/**
|
|
8577
|
+
* This is a stepwise function, meaning that each point represents
|
|
8578
|
+
* how many rewards are issued per time unit since the beginning
|
|
8579
|
+
* of that point until the beginning of the next point.
|
|
8580
|
+
* This is not a linear curve, there is no interpolation going on.
|
|
8581
|
+
* A curve can be [[t0, 100], [t1, 50], [t2, 0]]
|
|
8582
|
+
* meaning that from t0 to t1, 100 rewards are issued per time unit,
|
|
8583
|
+
* from t1 to t2, 50 rewards are issued per time unit, and after t2 it stops
|
|
8584
|
+
* Another curve, can be [[t0, 100], [u64::max, 0]]
|
|
8585
|
+
* meaning that from t0 to u64::max, 100 rewards are issued per time unit
|
|
8586
|
+
*/
|
|
8587
|
+
points: Array<RewardPerTimeUnitPointFields>;
|
|
8588
|
+
}
|
|
8589
|
+
|
|
8032
8590
|
type MakeRefreshingIxsParams = {
|
|
8033
8591
|
klendProgram: Program<KlendIdlType>;
|
|
8034
|
-
reserve:
|
|
8592
|
+
reserve: KaminoReserve;
|
|
8035
8593
|
reserveKey: PublicKey;
|
|
8036
8594
|
obligationKey: PublicKey;
|
|
8037
8595
|
program: Program<KlendIdlType>;
|
|
8038
8596
|
};
|
|
8039
8597
|
declare function makeRefreshingIxs({ klendProgram, reserve, reserveKey, obligationKey, program, }: MakeRefreshingIxsParams): Promise<_solana_web3_js.TransactionInstruction[]>;
|
|
8040
8598
|
|
|
8041
|
-
|
|
8042
|
-
|
|
8599
|
+
/**
|
|
8600
|
+
* Serialize a Kamino Obligation to its JSON DTO.
|
|
8601
|
+
*
|
|
8602
|
+
* The parameter is typed as the curated {@link KaminoObligation}, so a
|
|
8603
|
+
* freshly decoded `ObligationRaw` is accepted structurally and trimmed
|
|
8604
|
+
* down to the curated shape here.
|
|
8605
|
+
*/
|
|
8606
|
+
declare function kaminoObligationToDto(obligation: KaminoObligation): KaminoObligationJSON;
|
|
8607
|
+
/**
|
|
8608
|
+
* Serialize a Kamino Reserve to its JSON DTO.
|
|
8609
|
+
*
|
|
8610
|
+
* The parameter is typed as the curated {@link KaminoReserve}, so a
|
|
8611
|
+
* freshly decoded `ReserveRaw` is accepted structurally and trimmed
|
|
8612
|
+
* down to the curated shape here.
|
|
8613
|
+
*/
|
|
8614
|
+
declare function kaminoReserveToDto(reserve: KaminoReserve): KaminoReserveJSON;
|
|
8043
8615
|
|
|
8044
8616
|
declare const KLEND_ACCOUNT_CODER: BorshCoder<string, string>;
|
|
8045
8617
|
declare function decodeKlendReserveData(data: Buffer): ReserveRaw;
|
|
8046
8618
|
declare function decodeKlendObligationData(data: Buffer): ObligationRaw;
|
|
8047
|
-
declare function
|
|
8048
|
-
declare function
|
|
8619
|
+
declare function dtoToKaminoObligation(obligationDto: KaminoObligationJSON): KaminoObligation;
|
|
8620
|
+
declare function dtoToKaminoReserve(reserveDto: KaminoReserveJSON): KaminoReserve;
|
|
8049
8621
|
|
|
8050
8622
|
declare const SEED_LENDING_MARKET_AUTH = "lma";
|
|
8051
8623
|
declare const SEED_RESERVE_LIQ_SUPPLY = "reserve_liq_supply";
|
|
@@ -8138,14 +8710,14 @@ declare function calculateAPYFromAPR(apr: number): number;
|
|
|
8138
8710
|
* @param reserve - The Kamino reserve
|
|
8139
8711
|
* @returns Total supply in lamports
|
|
8140
8712
|
*/
|
|
8141
|
-
declare function getKaminoTotalSupply(reserve:
|
|
8713
|
+
declare function getKaminoTotalSupply(reserve: KaminoReserve): Decimal;
|
|
8142
8714
|
/**
|
|
8143
8715
|
* Calculate utilization ratio of a reserve
|
|
8144
8716
|
* Formula: total borrowed / total supply
|
|
8145
8717
|
* @param reserve - The Kamino reserve
|
|
8146
8718
|
* @returns Utilization ratio (0-1, e.g., 0.75 = 75% utilized)
|
|
8147
8719
|
*/
|
|
8148
|
-
declare function calculateUtilizationRatio(reserve:
|
|
8720
|
+
declare function calculateUtilizationRatio(reserve: KaminoReserve): number;
|
|
8149
8721
|
/**
|
|
8150
8722
|
* Calculate slot adjustment factor based on recent slot duration
|
|
8151
8723
|
* Used to adjust rates based on actual blockchain performance
|
|
@@ -8157,14 +8729,14 @@ declare function slotAdjustmentFactor(recentSlotDurationMs?: number): number;
|
|
|
8157
8729
|
* Calculate slot adjustment factor (1:1 with KaminoReserve implementation)
|
|
8158
8730
|
* Source: klend-sdk/src/classes/reserve.ts line 672
|
|
8159
8731
|
*/
|
|
8160
|
-
declare function calculateSlotAdjustmentFactor(reserve:
|
|
8732
|
+
declare function calculateSlotAdjustmentFactor(reserve: KaminoReserve, recentSlotDurationMs: number): number;
|
|
8161
8733
|
/**
|
|
8162
8734
|
* Calculate estimated borrow rate for a reserve
|
|
8163
8735
|
* @param reserve - The reserve
|
|
8164
8736
|
* @param recentSlotDurationMs - Recent slot duration (optional)
|
|
8165
8737
|
* @returns Borrow rate as decimal (e.g., 0.05 = 5%)
|
|
8166
8738
|
*/
|
|
8167
|
-
declare function calculateKaminoEstimatedBorrowRate(reserve:
|
|
8739
|
+
declare function calculateKaminoEstimatedBorrowRate(reserve: KaminoReserve, recentSlotDurationMs?: number): number;
|
|
8168
8740
|
/**
|
|
8169
8741
|
* Calculate estimated supply rate for a reserve
|
|
8170
8742
|
* Formula: borrow rate × utilization × (1 - protocol take rate)
|
|
@@ -8172,7 +8744,7 @@ declare function calculateKaminoEstimatedBorrowRate(reserve: ReserveRaw, recentS
|
|
|
8172
8744
|
* @param recentSlotDurationMs - Recent slot duration (optional)
|
|
8173
8745
|
* @returns Supply rate as decimal (e.g., 0.03 = 3%)
|
|
8174
8746
|
*/
|
|
8175
|
-
declare function calculateKaminoEstimatedSupplyRate(reserve:
|
|
8747
|
+
declare function calculateKaminoEstimatedSupplyRate(reserve: KaminoReserve, recentSlotDurationMs?: number): number;
|
|
8176
8748
|
/**
|
|
8177
8749
|
* Calculate supply APY for a reserve
|
|
8178
8750
|
* APY includes compounding, making it higher than APR
|
|
@@ -8181,22 +8753,22 @@ declare function calculateKaminoEstimatedSupplyRate(reserve: ReserveRaw, recentS
|
|
|
8181
8753
|
* @param recentSlotDurationMs - Recent slot duration (defaults to 450ms)
|
|
8182
8754
|
* @returns Supply APY as decimal (e.g., 0.0512 = 5.12% APY)
|
|
8183
8755
|
*/
|
|
8184
|
-
declare function calculateKaminoSupplyAPY(reserve:
|
|
8185
|
-
declare function scaledSupplies(state:
|
|
8756
|
+
declare function calculateKaminoSupplyAPY(reserve: KaminoReserve, recentSlotDurationMs?: number): number;
|
|
8757
|
+
declare function scaledSupplies(state: KaminoReserve): [Decimal, Decimal];
|
|
8186
8758
|
/**
|
|
8187
8759
|
* Convert raw curve points to normalized [utilization, rate] pairs
|
|
8188
8760
|
* Truncates curve at 100% utilization
|
|
8189
8761
|
*/
|
|
8190
|
-
declare const truncateBorrowCurve: (points:
|
|
8762
|
+
declare const truncateBorrowCurve: (points: KaminoBorrowRateCurvePoint[]) => [number, number][];
|
|
8191
8763
|
/**
|
|
8192
8764
|
* Get fixed host interest rate from reserve config (1:1 with Kamino SDK)
|
|
8193
8765
|
* Source: klend-sdk/src/classes/reserve.ts line 209
|
|
8194
8766
|
*/
|
|
8195
|
-
declare function getFixedHostInterestRate(reserve:
|
|
8767
|
+
declare function getFixedHostInterestRate(reserve: KaminoReserve): number;
|
|
8196
8768
|
/**
|
|
8197
8769
|
* Get protocol take rate percentage from reserve config
|
|
8198
8770
|
*/
|
|
8199
|
-
declare function getProtocolTakeRatePct(reserve:
|
|
8771
|
+
declare function getProtocolTakeRatePct(reserve: KaminoReserve): number;
|
|
8200
8772
|
/**
|
|
8201
8773
|
* Generate complete interest rate curve for a reserve
|
|
8202
8774
|
* Creates 101 data points from 0% to 100% utilization
|
|
@@ -8206,23 +8778,30 @@ declare function getProtocolTakeRatePct(reserve: ReserveRaw): number;
|
|
|
8206
8778
|
* @param protocolTakeRatePct - Percentage kept by depositors (1 - protocol fee)
|
|
8207
8779
|
* @returns Array of curve points with utilization, borrow APY, and supply APY
|
|
8208
8780
|
*/
|
|
8209
|
-
declare function generateKaminoReserveCurve(curvePoints:
|
|
8781
|
+
declare function generateKaminoReserveCurve(curvePoints: KaminoBorrowRateCurvePoint[], slotAdjustmentFactor: number, fixedHostInterestRate: number, protocolTakeRatePct: number): KlendInterestRateCurvePoint[];
|
|
8210
8782
|
|
|
8211
|
-
declare function getRewardPerTimeUnitSecond(reward:
|
|
8212
|
-
declare function getReserveRewardsApy(priceByMint: Record<string, number>, farmState:
|
|
8783
|
+
declare function getRewardPerTimeUnitSecond(reward: KaminoFarmRewardInfo): Decimal;
|
|
8784
|
+
declare function getReserveRewardsApy(priceByMint: Record<string, number>, farmState: KaminoFarmState, reserveState: KaminoReserve): Promise<{
|
|
8213
8785
|
rewardApy: Decimal;
|
|
8214
|
-
rewardInfo:
|
|
8786
|
+
rewardInfo: KaminoFarmRewardInfo;
|
|
8215
8787
|
rewardApr: Decimal;
|
|
8216
8788
|
}[]>;
|
|
8217
|
-
declare function calculateRewardApy(priceByMint: Record<string, number>, reserve:
|
|
8789
|
+
declare function calculateRewardApy(priceByMint: Record<string, number>, reserve: KaminoReserve, rewardInfo: KaminoFarmRewardInfo): {
|
|
8218
8790
|
apr: Decimal;
|
|
8219
8791
|
apy: Decimal;
|
|
8220
8792
|
};
|
|
8221
8793
|
|
|
8222
|
-
|
|
8794
|
+
/**
|
|
8795
|
+
* Serialize a Kamino FarmState to its JSON DTO.
|
|
8796
|
+
*
|
|
8797
|
+
* The parameter is typed as the curated {@link KaminoFarmState}, so a
|
|
8798
|
+
* freshly decoded `FarmStateRaw` is accepted structurally and trimmed
|
|
8799
|
+
* down to the curated shape here.
|
|
8800
|
+
*/
|
|
8801
|
+
declare function kaminoFarmStateToDto(farmState: KaminoFarmState): KaminoFarmStateJSON;
|
|
8223
8802
|
|
|
8224
8803
|
declare function decodeFarmDataRaw(data: Buffer): FarmStateRaw;
|
|
8225
|
-
declare function
|
|
8804
|
+
declare function dtoToKaminoFarmState(dto: KaminoFarmStateJSON): KaminoFarmState;
|
|
8226
8805
|
|
|
8227
8806
|
declare const KLEND_PROGRAM_ID: PublicKey;
|
|
8228
8807
|
declare const FARMS_PROGRAM_ID: PublicKey;
|
|
@@ -29251,4 +29830,4 @@ declare function makeExponentClmmTradePtIx(accounts: ExponentClmmTradePtAccounts
|
|
|
29251
29830
|
priceSpotLimit: null;
|
|
29252
29831
|
}): TransactionInstruction;
|
|
29253
29832
|
|
|
29254
|
-
export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, type Account, AccountLayout, type AccountMeta, AccountState, AccountType, type ApproveInstructionData, type Base, type ClientRequest, type CloseAccountInstructionData, ConnectionClosed, CorpAction, CurvePointFields, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, type DriftIdlType, type DriftInterestRateCurvePoint, DriftRewards, DriftRewardsJSON, DriftSpotBalanceType, DriftSpotMarket, DriftSpotMarketJSON, type DriftSpotMarketRaw, type DriftState, type DriftStateJSON, DriftUser, DriftUserJSON, type DriftUserRaw, DriftUserStats, DriftUserStatsJSON, EXPONENT_CLMM_IDL, EXPONENT_CLMM_PROGRAM_ID, EXPONENT_CORE_IDL, EXPONENT_CORE_PROGRAM_ID, EXPONENT_EVENT_AUTHORITY_SEED, EXPONENT_GENERIC_SY_PROGRAM_ID, EXPONENT_JITO_RESTAKING_SY_PROGRAM_ID, EXPONENT_KAMINO_SY_PROGRAM_ID, EXPONENT_MARGINFI_SY_PROGRAM_ID, EXPONENT_NUMBER_DENOM, EXPONENT_ORDERBOOK_PROGRAM_ID, EXPONENT_PERENA_SY_PROGRAM_ID, EXPONENT_VAULTS_PROGRAM_ID, type Ema, ErrorResponse, type ExponentClmmTradePtAccounts, type ExponentClmmTradePtContext, type ExponentCpiInterfaceContext, type ExponentMarketThree, type ExponentMarketThreeCpiAccounts, type ExponentMarketTwo, type ExponentMarketTwoCpiAccounts, type ExponentMergeAccounts, type ExponentMergeContext, type ExponentStripAccounts, type ExponentStripContext, ExponentSwapDirection, type ExponentTradePtAccounts, type ExponentTradePtContext, type ExponentVault, type ExponentWrapperMergeAccounts, type ExponentWrapperMergeContext, ExtensionType, FARMS_PROGRAM_ID, FarmStateJSON, FarmStateRaw, FeeStructure, FeeStructureJSON, HistoricalIndexData, HistoricalOracleData, type InitializeAccountInstructionData, type Instruction, InsuranceFund, JUP_EXCHANGE_PRICES_PRECISION, JUP_LEND_IDL, JUP_LEND_PROGRAM_ID, JUP_LIQUIDITY_IDL, JUP_LIQUIDITY_PROGRAM_ID, JUP_MAX_REWARDS_RATE, JUP_REWARDS_PROGRAM_ID, JUP_SECONDS_PER_YEAR, type JupLendIdlType, type JupLendInterestRateCurvePoint, type JupLendRewardsResult, JupLendingRewardsRateModel, JupLendingRewardsRateModelJSON, type JupLendingRewardsRateModelRaw, JupLendingState, JupLendingStateJSON, type JupLendingStateRaw, type JupLiquidityIdlType, JupRateModel, JupRateModelJSON, type JupRateModelRaw, JupTokenReserve, JupTokenReserveJSON, type JupTokenReserveRaw, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, type KaminoReserveCurveData, type KfarmsIdlType, type KlendIdlType, type KlendInterestRateCurvePoint, LENGTH_SIZE, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, type Mint, MintLayout, type Multisig, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, ObligationJSON, ObligationRaw, OracleGuardRails, OracleGuardRailsJSON, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, type PlatformFee, PoolBalance, type Price, type PriceComponent, type PriceData, PriceStatus, PriceType, type Pubkey, type QuoteSwapStreamResponse, type QuoteUpdateParams, REFRESH_OBLIGATION_DISCRIMINATOR, type RawAccount, type RawMint, type RawMultisig, type RefreshObligationAccounts, type RequestData, ReserveJSON, ReserveRaw, type ResolveExponentClmmTradePtContextParams, type ResolveExponentMergeContextParams, type ResolveExponentStripContextParams, type ResolveExponentTradePtContextParams, type ResolveExponentWrapperMergeContextParams, type ResponseData, type ResponseError, type ResponseSuccess, type ResponseWithStream, RewardInfoFields, type RoutePlanStep, SEED_BASE_REFERRER_STATE, SEED_BASE_REFERRER_TOKEN_STATE, SEED_BASE_SHORT_URL, SEED_BASE_USER_METADATA, SEED_DRIFT_SIGNER, SEED_DRIFT_STATE, SEED_FEE_RECEIVER, SEED_F_TOKEN_MINT, SEED_LENDING, SEED_LENDING_ADMIN, SEED_LENDING_MARKET_AUTH, SEED_LENDING_REWARDS_RATE_MODEL, SEED_LIQUIDITY, SEED_RATE_MODEL, SEED_RESERVE, SEED_RESERVE_COLL_MINT, SEED_RESERVE_COLL_SUPPLY, SEED_RESERVE_LIQ_SUPPLY, SEED_SPOT_MARKET, SEED_SPOT_MARKET_VAULT, SEED_USER, SEED_USER_CLAIM, SEED_USER_STATE, SEED_USER_STATS, SEED_USER_SUPPLY_POSITION, SLOTS_PER_DAY, SLOTS_PER_HOUR, SLOTS_PER_MINUTE, SLOTS_PER_SECOND, SLOTS_PER_YEAR, SPOT_MARKET_RATE_PRECISION, SPOT_MARKET_RATE_PRECISION_EXP, SPOT_MARKET_UTILIZATION_PRECISION, SPOT_MARKET_UTILIZATION_PRECISION_EXP, type SerializedInstruction, type SerializedSwapRoute, type ServerMessage, SinglePoolInstruction, SplAccountType, SpotPosition, type StakeAccount, type StopStreamRequest, type StopStreamResponse, type StreamData, type StreamDataPayload, type StreamEnd, StreamError, type StreamStart, SwapMode, type SwapParams, type SwapQuoteRequest, type SwapQuotes, type SwapRoute, SwapVersion, type SyncNativeInstructionData, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, type TitanGatewayQuoteParams, type TitanGatewayQuoteResponse, type TitanProxyExactOutResponse, type TitanProxySwapQuoteResponse, type TitanSwapQuoteResult, type TitanTemplateLut, type TitanTransactionTemplate, TokenAccountNotFoundError, TokenError, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, type TransactionParams, type TransactionTemplate, type TransactionTemplateLut, type TransferCheckedInstructionData, type Uint64, V1Client, ZERO, addSigners, approveInstructionData, buildSwapQuoteResult, buildTitanTemplate, calculateAPYFromAPR, calculateDriftBorrowAPR, calculateDriftBorrowAPY, calculateDriftBorrowRate, calculateDriftDepositRate, calculateDriftInterestRate, calculateDriftLendingAPR, calculateDriftLendingAPY, calculateDriftUtilization, calculateJupLendBorrowRate, calculateJupLendLiquiditySupplyRate, calculateJupLendNewExchangePrice, calculateJupLendRewardsRate, calculateJupLendRewardsRateForExchangePrice, calculateJupLendSupplyAPY, calculateJupLendSupplyRate, calculateJupLendTotalAssets, calculateKaminoEstimatedBorrowRate, calculateKaminoEstimatedSupplyRate, calculateKaminoSupplyAPY, calculateRewardApy, calculateSlotAdjustmentFactor, calculateUtilizationRatio, closeAccountInstructionData, createAccountIx, createApproveInstruction, createAssociatedTokenAccountIdempotentInstruction, createAssociatedTokenAccountInstruction, createCloseAccountInstruction, createInitializeAccountInstruction, createMemoInstruction, createPoolOnrampIx, createSyncNativeInstruction, createTransferCheckedInstruction, decodeDriftSpotMarketData, decodeDriftStateData, decodeDriftUserData, decodeDriftUserStatsData, decodeExponentMarketThree, decodeExponentMarketTwo, decodeExponentMarketVault, decodeExponentVault, decodeFarmDataRaw, decodeJupLendingRewardsRateModelData, decodeJupLendingStateData, decodeJupRateModelData, decodeJupTokenReserveData, decodeKlendObligationData, decodeKlendReserveData, deriveBaseObligation, deriveDriftSigner, deriveDriftSpotMarket, deriveDriftSpotMarketVault, deriveDriftState, deriveDriftUser, deriveDriftUserStats, deriveExponentClmmEventAuthority, deriveExponentEventAuthority, deriveFeeReceiver, deriveJupLendClaimAccount, deriveJupLendFTokenMint, deriveJupLendLending, deriveJupLendLendingAdmin, deriveJupLendLendingPdas, deriveJupLendLendingRewardsRateModel, deriveJupLendLiquidity, deriveJupLendLiquiditySupplyPositionPda, deriveJupLendLiquidityVaultAta, deriveJupLendRateModel, deriveJupLendTokenReserve, deriveLendingMarketAuthority, deriveObligation, deriveReferrerState, deriveReferrerTokenState, deriveReserveCollateralMint, deriveReserveCollateralSupply, deriveReserveLiquiditySupply, deriveShortUrl, deriveUserMetadata, deriveUserState, deserializeSerializedInstruction, deserializeTitanWireInstruction, driftRewardsRawToDto, driftSpotMarketRawToDto, driftStateRawToDto, driftUserRawToDto, driftUserStatsRawToDto, dtoToDriftRewardsRaw, dtoToDriftSpotMarketRaw, dtoToDriftStateRaw, dtoToDriftUserRaw, dtoToDriftUserStatsRaw, dtoToFarmRaw, dtoToJupLendingRewardsRateModelRaw, dtoToJupLendingStateRaw, dtoToJupRateModelRaw, dtoToJupTokenReserveRaw, dtoToObligationRaw, dtoToReserveRaw, encodeTitanTemplate, exponentBuyPtArgs, exponentClmmBuyPtArgs, exponentNumberToBigNumber, farmRawToDto, fetchExponentMarketThree, fetchExponentMarketTwo, fetchExponentVault, fetchExponentVaultFromMarket, fetchTitanQuoteSwapV3, findMplMetadataAddress, findPoolAddress, findPoolMintAddress, findPoolMintAddressByVoteAccount, findPoolMintAuthorityAddress, findPoolMplAuthorityAddress, findPoolOnRampAddress, findPoolStakeAddress, findPoolStakeAuthorityAddress, generateDriftReserveCurve, generateJupLendSupplyCurve, generateKaminoReserveCurve, getAccount, getAccountLen, getAllDerivedDriftAccounts, getAllDerivedJupLendAccounts, getAllDerivedKaminoAccounts, getAllRequiredMarkets, getAssociatedTokenAddressSync, getDriftRewards, getDriftTokenAmount, getFixedHostInterestRate, getJupLendRewards, getKaminoBorrowRate, getKaminoTotalSupply, getMinimumBalanceForRentExemptAccount, getMinimumBalanceForRentExemptAccountWithExtensions, getMint, getMintDecimals, getMultipleAccounts, getProtocolTakeRatePct, getReserveRewardsApy, getRewardPerTimeUnitSecond, getStakeAccount, initializeAccountInstructionData, initializeStakedPoolIxs, initializeStakedPoolTx, instructionToTitanWire, interpolateLinear, isJitoDontFront, jupLendingRewardsRateModelRawToDto, jupLendingStateRawToDto, jupRateModelRawToDto, jupTokenReserveRawToDto, layout, lutToTitanWire, makeExponentClmmTradePtIx, makeExponentMergeIx, makeExponentStripIx, makeExponentTradePtIx, makeExponentWrapperMergeIx, makeRefreshObligationIx, makeRefreshReservesBatchIx, makeRefreshingIxs, makeSplStakePoolUpdateBalanceIx, makeUpdateJupLendRate, makeUpdateJupLendRateIx, makeUpdateSpotMarketCumulativeInterestIx, makeUpdateSpotMarketIx, obligationRawToDto, parsePriceData, parsePriceInfo, replenishPoolIx, reserveRawToDto, resolveExponentClmmTradePtContext, resolveExponentMergeContext, resolveExponentStripContext, resolveExponentTradePtContext, resolveExponentWrapperMergeContext, resolveLookupTables, scaledSupplies, selectBestRoute, selectGatewayRoute, slotAdjustmentFactor, syncNativeInstructionData, transferCheckedInstructionData, truncateBorrowCurve, unpackAccount };
|
|
29833
|
+
export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, type Account, AccountLayout, type AccountMeta, AccountState, AccountType, type ApproveInstructionData, type Base, type BigFractionBytesFields, type BorrowRateCurveFields, type ClientRequest, type CloseAccountInstructionData, ConnectionClosed, CorpAction, type CurvePointFields, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, type DriftIdlType, type DriftInterestRateCurvePoint, DriftRewards, DriftRewardsJSON, DriftSpotBalanceType, DriftSpotMarket, DriftSpotMarketJSON, type DriftSpotMarketRaw, type DriftState, type DriftStateJSON, DriftUser, DriftUserJSON, type DriftUserRaw, DriftUserStats, DriftUserStatsJSON, EXPONENT_CLMM_IDL, EXPONENT_CLMM_PROGRAM_ID, EXPONENT_CORE_IDL, EXPONENT_CORE_PROGRAM_ID, EXPONENT_EVENT_AUTHORITY_SEED, EXPONENT_GENERIC_SY_PROGRAM_ID, EXPONENT_JITO_RESTAKING_SY_PROGRAM_ID, EXPONENT_KAMINO_SY_PROGRAM_ID, EXPONENT_MARGINFI_SY_PROGRAM_ID, EXPONENT_NUMBER_DENOM, EXPONENT_ORDERBOOK_PROGRAM_ID, EXPONENT_PERENA_SY_PROGRAM_ID, EXPONENT_VAULTS_PROGRAM_ID, type Ema, ErrorResponse, type ExponentClmmTradePtAccounts, type ExponentClmmTradePtContext, type ExponentCpiInterfaceContext, type ExponentMarketThree, type ExponentMarketThreeCpiAccounts, type ExponentMarketTwo, type ExponentMarketTwoCpiAccounts, type ExponentMergeAccounts, type ExponentMergeContext, type ExponentStripAccounts, type ExponentStripContext, ExponentSwapDirection, type ExponentTradePtAccounts, type ExponentTradePtContext, type ExponentVault, type ExponentWrapperMergeAccounts, type ExponentWrapperMergeContext, ExtensionType, FARMS_PROGRAM_ID, type FarmStateRaw, FeeStructure, FeeStructureJSON, HistoricalIndexData, HistoricalOracleData, type InitializeAccountInstructionData, type Instruction, InsuranceFund, JUP_EXCHANGE_PRICES_PRECISION, JUP_LEND_IDL, JUP_LEND_PROGRAM_ID, JUP_LIQUIDITY_IDL, JUP_LIQUIDITY_PROGRAM_ID, JUP_MAX_REWARDS_RATE, JUP_REWARDS_PROGRAM_ID, JUP_SECONDS_PER_YEAR, type JupLendIdlType, type JupLendInterestRateCurvePoint, type JupLendRewardsResult, JupLendingRewardsRateModel, JupLendingRewardsRateModelJSON, type JupLendingRewardsRateModelRaw, JupLendingState, JupLendingStateJSON, type JupLendingStateRaw, type JupLiquidityIdlType, JupRateModel, JupRateModelJSON, type JupRateModelRaw, JupTokenReserve, JupTokenReserveJSON, type JupTokenReserveRaw, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, KaminoBorrowRateCurvePoint, KaminoFarmRewardInfo, KaminoFarmState, KaminoFarmStateJSON, KaminoObligation, KaminoObligationJSON, KaminoReserve, type KaminoReserveCurveData, KaminoReserveJSON, type KfarmsIdlType, type KlendIdlType, type KlendInterestRateCurvePoint, LENGTH_SIZE, type LastUpdateFields, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, type Mint, MintLayout, type Multisig, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, type ObligationCollateralFields, type ObligationLiquidityFields, type ObligationOrderFields, type ObligationRaw, OracleGuardRails, OracleGuardRailsJSON, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, type PlatformFee, PoolBalance, type Price, type PriceComponent, type PriceData, type PriceHeuristicFields, PriceStatus, PriceType, type Pubkey, type PythConfigurationFields, type QuoteSwapStreamResponse, type QuoteUpdateParams, REFRESH_OBLIGATION_DISCRIMINATOR, type RawAccount, type RawMint, type RawMultisig, type RefreshObligationAccounts, type RequestData, type ReserveCollateralFields, type ReserveConfigFields, type ReserveFeesFields, type ReserveLiquidityFields, type ReserveRaw, type ResolveExponentClmmTradePtContextParams, type ResolveExponentMergeContextParams, type ResolveExponentStripContextParams, type ResolveExponentTradePtContextParams, type ResolveExponentWrapperMergeContextParams, type ResponseData, type ResponseError, type ResponseSuccess, type ResponseWithStream, type RewardInfoFields, type RewardPerTimeUnitPointFields, type RewardScheduleCurveFields, type RoutePlanStep, SEED_BASE_REFERRER_STATE, SEED_BASE_REFERRER_TOKEN_STATE, SEED_BASE_SHORT_URL, SEED_BASE_USER_METADATA, SEED_DRIFT_SIGNER, SEED_DRIFT_STATE, SEED_FEE_RECEIVER, SEED_F_TOKEN_MINT, SEED_LENDING, SEED_LENDING_ADMIN, SEED_LENDING_MARKET_AUTH, SEED_LENDING_REWARDS_RATE_MODEL, SEED_LIQUIDITY, SEED_RATE_MODEL, SEED_RESERVE, SEED_RESERVE_COLL_MINT, SEED_RESERVE_COLL_SUPPLY, SEED_RESERVE_LIQ_SUPPLY, SEED_SPOT_MARKET, SEED_SPOT_MARKET_VAULT, SEED_USER, SEED_USER_CLAIM, SEED_USER_STATE, SEED_USER_STATS, SEED_USER_SUPPLY_POSITION, SLOTS_PER_DAY, SLOTS_PER_HOUR, SLOTS_PER_MINUTE, SLOTS_PER_SECOND, SLOTS_PER_YEAR, SPOT_MARKET_RATE_PRECISION, SPOT_MARKET_RATE_PRECISION_EXP, SPOT_MARKET_UTILIZATION_PRECISION, SPOT_MARKET_UTILIZATION_PRECISION_EXP, type ScopeConfigurationFields, type SerializedInstruction, type SerializedSwapRoute, type ServerMessage, SinglePoolInstruction, SplAccountType, SpotPosition, type StakeAccount, type StopStreamRequest, type StopStreamResponse, type StreamData, type StreamDataPayload, type StreamEnd, StreamError, type StreamStart, SwapMode, type SwapParams, type SwapQuoteRequest, type SwapQuotes, type SwapRoute, SwapVersion, type SwitchboardConfigurationFields, type SyncNativeInstructionData, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, type TitanGatewayQuoteParams, type TitanGatewayQuoteResponse, type TitanProxyExactOutResponse, type TitanProxySwapQuoteResponse, type TitanSwapQuoteResult, type TitanTemplateLut, type TitanTransactionTemplate, TokenAccountNotFoundError, TokenError, type TokenInfoFields$1 as TokenInfoFields, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, type TransactionParams, type TransactionTemplate, type TransactionTemplateLut, type TransferCheckedInstructionData, type Uint64, V1Client, type WithdrawalCapsFields, ZERO, addSigners, approveInstructionData, buildSwapQuoteResult, buildTitanTemplate, calculateAPYFromAPR, calculateDriftBorrowAPR, calculateDriftBorrowAPY, calculateDriftBorrowRate, calculateDriftDepositRate, calculateDriftInterestRate, calculateDriftLendingAPR, calculateDriftLendingAPY, calculateDriftUtilization, calculateJupLendBorrowRate, calculateJupLendLiquiditySupplyRate, calculateJupLendNewExchangePrice, calculateJupLendRewardsRate, calculateJupLendRewardsRateForExchangePrice, calculateJupLendSupplyAPY, calculateJupLendSupplyRate, calculateJupLendTotalAssets, calculateKaminoEstimatedBorrowRate, calculateKaminoEstimatedSupplyRate, calculateKaminoSupplyAPY, calculateRewardApy, calculateSlotAdjustmentFactor, calculateUtilizationRatio, closeAccountInstructionData, createAccountIx, createApproveInstruction, createAssociatedTokenAccountIdempotentInstruction, createAssociatedTokenAccountInstruction, createCloseAccountInstruction, createInitializeAccountInstruction, createMemoInstruction, createPoolOnrampIx, createSyncNativeInstruction, createTransferCheckedInstruction, decodeDriftSpotMarketData, decodeDriftStateData, decodeDriftUserData, decodeDriftUserStatsData, decodeExponentMarketThree, decodeExponentMarketTwo, decodeExponentMarketVault, decodeExponentVault, decodeFarmDataRaw, decodeJupLendingRewardsRateModelData, decodeJupLendingStateData, decodeJupRateModelData, decodeJupTokenReserveData, decodeKlendObligationData, decodeKlendReserveData, deriveBaseObligation, deriveDriftSigner, deriveDriftSpotMarket, deriveDriftSpotMarketVault, deriveDriftState, deriveDriftUser, deriveDriftUserStats, deriveExponentClmmEventAuthority, deriveExponentEventAuthority, deriveFeeReceiver, deriveJupLendClaimAccount, deriveJupLendFTokenMint, deriveJupLendLending, deriveJupLendLendingAdmin, deriveJupLendLendingPdas, deriveJupLendLendingRewardsRateModel, deriveJupLendLiquidity, deriveJupLendLiquiditySupplyPositionPda, deriveJupLendLiquidityVaultAta, deriveJupLendRateModel, deriveJupLendTokenReserve, deriveLendingMarketAuthority, deriveObligation, deriveReferrerState, deriveReferrerTokenState, deriveReserveCollateralMint, deriveReserveCollateralSupply, deriveReserveLiquiditySupply, deriveShortUrl, deriveUserMetadata, deriveUserState, deserializeSerializedInstruction, deserializeTitanWireInstruction, driftRewardsRawToDto, driftSpotMarketRawToDto, driftStateRawToDto, driftUserRawToDto, driftUserStatsRawToDto, dtoToDriftRewardsRaw, dtoToDriftSpotMarketRaw, dtoToDriftStateRaw, dtoToDriftUserRaw, dtoToDriftUserStatsRaw, dtoToJupLendingRewardsRateModelRaw, dtoToJupLendingStateRaw, dtoToJupRateModelRaw, dtoToJupTokenReserveRaw, dtoToKaminoFarmState, dtoToKaminoObligation, dtoToKaminoReserve, encodeTitanTemplate, exponentBuyPtArgs, exponentClmmBuyPtArgs, exponentNumberToBigNumber, fetchExponentMarketThree, fetchExponentMarketTwo, fetchExponentVault, fetchExponentVaultFromMarket, fetchTitanQuoteSwapV3, findMplMetadataAddress, findPoolAddress, findPoolMintAddress, findPoolMintAddressByVoteAccount, findPoolMintAuthorityAddress, findPoolMplAuthorityAddress, findPoolOnRampAddress, findPoolStakeAddress, findPoolStakeAuthorityAddress, generateDriftReserveCurve, generateJupLendSupplyCurve, generateKaminoReserveCurve, getAccount, getAccountLen, getAllDerivedDriftAccounts, getAllDerivedJupLendAccounts, getAllDerivedKaminoAccounts, getAllRequiredMarkets, getAssociatedTokenAddressSync, getDriftRewards, getDriftTokenAmount, getFixedHostInterestRate, getJupLendRewards, getKaminoBorrowRate, getKaminoTotalSupply, getMinimumBalanceForRentExemptAccount, getMinimumBalanceForRentExemptAccountWithExtensions, getMint, getMintDecimals, getMultipleAccounts, getProtocolTakeRatePct, getReserveRewardsApy, getRewardPerTimeUnitSecond, getStakeAccount, initializeAccountInstructionData, initializeStakedPoolIxs, initializeStakedPoolTx, instructionToTitanWire, interpolateLinear, isJitoDontFront, jupLendingRewardsRateModelRawToDto, jupLendingStateRawToDto, jupRateModelRawToDto, jupTokenReserveRawToDto, kaminoFarmStateToDto, kaminoObligationToDto, kaminoReserveToDto, layout, lutToTitanWire, makeExponentClmmTradePtIx, makeExponentMergeIx, makeExponentStripIx, makeExponentTradePtIx, makeExponentWrapperMergeIx, makeRefreshObligationIx, makeRefreshReservesBatchIx, makeRefreshingIxs, makeSplStakePoolUpdateBalanceIx, makeUpdateJupLendRate, makeUpdateJupLendRateIx, makeUpdateSpotMarketCumulativeInterestIx, makeUpdateSpotMarketIx, parsePriceData, parsePriceInfo, replenishPoolIx, resolveExponentClmmTradePtContext, resolveExponentMergeContext, resolveExponentStripContext, resolveExponentTradePtContext, resolveExponentWrapperMergeContext, resolveLookupTables, scaledSupplies, selectBestRoute, selectGatewayRoute, slotAdjustmentFactor, syncNativeInstructionData, transferCheckedInstructionData, truncateBorrowCurve, unpackAccount };
|