@0dotxyz/p0-ts-sdk 2.7.3 → 2.7.4

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.
@@ -46,11 +46,35 @@ interface KaminoReserveCollateral {
46
46
  /** Reserve collateral supply address */
47
47
  supplyVault: PublicKey;
48
48
  }
49
+ /**
50
+ * Mirrors the on-chain `InterestRateBasis` (stored as a `u8` in
51
+ * `ReserveConfig.interestRateBasis`). The klend IDL never exposes the enum,
52
+ * only the raw byte, hence this local copy.
53
+ */
54
+ declare enum KaminoInterestRateBasis {
55
+ /**
56
+ * Rates are nominal "slot-year" APRs assuming `SLOTS_PER_SECOND`: interest
57
+ * accrues per slot over `SLOTS_PER_YEAR`, so the realized wall-clock rate
58
+ * scales with the observed slot duration.
59
+ */
60
+ Legacy = 0,
61
+ /**
62
+ * Rates are wall-clock APRs: interest accrues per second over
63
+ * `SECONDS_PER_YEAR`, independently of the slot rate. All reserves created
64
+ * by klend >= 1.25.0 use this basis.
65
+ */
66
+ TrueApr = 1
67
+ }
49
68
  interface KaminoReserveConfig {
50
69
  /** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
51
70
  protocolTakeRatePct: number;
52
71
  /** Flat rate that goes to the host */
53
72
  hostFixedInterestRateBps: number;
73
+ /**
74
+ * How the borrow rate curve is annualized; see {@link KaminoInterestRateBasis}.
75
+ * Absent on reserves serialized before this field existed — treated as `Legacy`.
76
+ */
77
+ interestRateBasis?: number;
54
78
  /** Maximum deposit limit of liquidity in native units, u64::MAX for inf */
55
79
  depositLimit: BN;
56
80
  /** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */
@@ -118,6 +142,8 @@ interface KaminoReserveCollateralJSON {
118
142
  interface KaminoReserveConfigJSON {
119
143
  protocolTakeRatePct: number;
120
144
  hostFixedInterestRateBps: number;
145
+ /** `KaminoInterestRateBasis` as a raw u8; missing on older DTOs (= Legacy) */
146
+ interestRateBasis?: number;
121
147
  depositLimit: string;
122
148
  borrowLimit: string;
123
149
  borrowRateCurve: KaminoBorrowRateCurveJSON;
@@ -835,4 +861,4 @@ interface JupRateModelJSON {
835
861
  rateAtKink2: number;
836
862
  }
837
863
 
838
- export { type KaminoObligationCollateralJSON as $, type KaminoReserveCollateral as A, type KaminoReserveConfig as B, type KaminoBorrowRateCurve as C, type DriftSpotMarket as D, type KaminoReserveTokenInfo as E, type FeeStructureJSON as F, type KaminoScopeConfiguration as G, type HistoricalOracleData as H, type InsuranceFund as I, type JupLendingState as J, type KaminoReserve as K, type KaminoSwitchboardConfiguration as L, type KaminoPythConfiguration as M, type KaminoReserveLiquidityJSON as N, type OracleGuardRailsJSON as O, type PoolBalance as P, type KaminoReserveCollateralJSON as Q, type KaminoReserveConfigJSON as R, type SpotPosition as S, type KaminoBorrowRateCurveJSON as T, type KaminoBorrowRateCurvePointJSON as U, type KaminoReserveTokenInfoJSON as V, type KaminoScopeConfigurationJSON as W, type KaminoSwitchboardConfigurationJSON as X, type KaminoPythConfigurationJSON as Y, type KaminoObligationCollateral as Z, type KaminoObligationLiquidity as _, type KaminoObligation as a, type KaminoObligationLiquidityJSON as a0, type KaminoFarmTokenInfo as a1, type KaminoRewardScheduleCurve as a2, type KaminoRewardCurvePoint as a3, type KaminoFarmTokenInfoJSON as a4, type KaminoFarmRewardInfoJSON as a5, type KaminoRewardScheduleCurveJSON as a6, type KaminoRewardCurvePointJSON as a7, type UserFeesJSON as a8, type UserFeesFields as a9, isSpotBalanceTypeVariant as aa, type FeeTier as ab, type FeeTierJSON as ac, type OrderFillerRewardStructure as ad, type OrderFillerRewardStructureJSON as ae, type PriceDivergenceGuardRails as af, type PriceDivergenceGuardRailsJSON as ag, type ValidityGuardRails as ah, type ValidityGuardRailsJSON as ai, type HistoricalOracleDataJSON as aj, type HistoricalIndexDataJSON as ak, type PoolBalanceJSON as al, type InsuranceFundJSON as am, SpotBalanceType as an, type SpotPositionJSON as ao, type KaminoFarmState as b, type DriftUser as c, type DriftRewards as d, type DriftUserStats as e, type JupTokenReserve as f, type JupLendingRewardsRateModel as g, type JupRateModel as h, type KaminoReserveJSON as i, type KaminoObligationJSON as j, type KaminoFarmStateJSON as k, type DriftSpotMarketJSON as l, type DriftUserJSON as m, type DriftRewardsJSON as n, type DriftUserStatsJSON as o, type JupLendingStateJSON as p, type JupTokenReserveJSON as q, type JupLendingRewardsRateModelJSON as r, type JupRateModelJSON as s, type KaminoBorrowRateCurvePoint as t, type KaminoFarmRewardInfo as u, type HistoricalIndexData as v, type FeeStructure as w, type OracleGuardRails as x, DriftSpotBalanceType as y, type KaminoReserveLiquidity as z };
864
+ export { type KaminoObligationLiquidity as $, type KaminoReserveLiquidity as A, type KaminoReserveCollateral as B, type KaminoReserveConfig as C, type DriftSpotMarket as D, type KaminoBorrowRateCurve as E, type FeeStructureJSON as F, type KaminoReserveTokenInfo as G, type HistoricalOracleData as H, type InsuranceFund as I, type JupLendingState as J, type KaminoReserve as K, type KaminoScopeConfiguration as L, type KaminoSwitchboardConfiguration as M, type KaminoPythConfiguration as N, type OracleGuardRailsJSON as O, type PoolBalance as P, type KaminoReserveLiquidityJSON as Q, type KaminoReserveCollateralJSON as R, type SpotPosition as S, type KaminoReserveConfigJSON as T, type KaminoBorrowRateCurveJSON as U, type KaminoBorrowRateCurvePointJSON as V, type KaminoReserveTokenInfoJSON as W, type KaminoScopeConfigurationJSON as X, type KaminoSwitchboardConfigurationJSON as Y, type KaminoPythConfigurationJSON as Z, type KaminoObligationCollateral as _, type KaminoObligation as a, type KaminoObligationCollateralJSON as a0, type KaminoObligationLiquidityJSON as a1, type KaminoFarmTokenInfo as a2, type KaminoRewardScheduleCurve as a3, type KaminoRewardCurvePoint as a4, type KaminoFarmTokenInfoJSON as a5, type KaminoFarmRewardInfoJSON as a6, type KaminoRewardScheduleCurveJSON as a7, type KaminoRewardCurvePointJSON as a8, type UserFeesJSON as a9, type UserFeesFields as aa, isSpotBalanceTypeVariant as ab, type FeeTier as ac, type FeeTierJSON as ad, type OrderFillerRewardStructure as ae, type OrderFillerRewardStructureJSON as af, type PriceDivergenceGuardRails as ag, type PriceDivergenceGuardRailsJSON as ah, type ValidityGuardRails as ai, type ValidityGuardRailsJSON as aj, type HistoricalOracleDataJSON as ak, type HistoricalIndexDataJSON as al, type PoolBalanceJSON as am, type InsuranceFundJSON as an, SpotBalanceType as ao, type SpotPositionJSON as ap, type KaminoFarmState as b, type DriftUser as c, type DriftRewards as d, type DriftUserStats as e, type JupTokenReserve as f, type JupLendingRewardsRateModel as g, type JupRateModel as h, type KaminoReserveJSON as i, type KaminoObligationJSON as j, type KaminoFarmStateJSON as k, type DriftSpotMarketJSON as l, type DriftUserJSON as m, type DriftRewardsJSON as n, type DriftUserStatsJSON as o, type JupLendingStateJSON as p, type JupTokenReserveJSON as q, type JupLendingRewardsRateModelJSON as r, type JupRateModelJSON as s, KaminoInterestRateBasis as t, type KaminoBorrowRateCurvePoint as u, type KaminoFarmRewardInfo as v, type HistoricalIndexData as w, type FeeStructure as x, type OracleGuardRails as y, DriftSpotBalanceType as z };
@@ -46,11 +46,35 @@ interface KaminoReserveCollateral {
46
46
  /** Reserve collateral supply address */
47
47
  supplyVault: PublicKey;
48
48
  }
49
+ /**
50
+ * Mirrors the on-chain `InterestRateBasis` (stored as a `u8` in
51
+ * `ReserveConfig.interestRateBasis`). The klend IDL never exposes the enum,
52
+ * only the raw byte, hence this local copy.
53
+ */
54
+ declare enum KaminoInterestRateBasis {
55
+ /**
56
+ * Rates are nominal "slot-year" APRs assuming `SLOTS_PER_SECOND`: interest
57
+ * accrues per slot over `SLOTS_PER_YEAR`, so the realized wall-clock rate
58
+ * scales with the observed slot duration.
59
+ */
60
+ Legacy = 0,
61
+ /**
62
+ * Rates are wall-clock APRs: interest accrues per second over
63
+ * `SECONDS_PER_YEAR`, independently of the slot rate. All reserves created
64
+ * by klend >= 1.25.0 use this basis.
65
+ */
66
+ TrueApr = 1
67
+ }
49
68
  interface KaminoReserveConfig {
50
69
  /** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
51
70
  protocolTakeRatePct: number;
52
71
  /** Flat rate that goes to the host */
53
72
  hostFixedInterestRateBps: number;
73
+ /**
74
+ * How the borrow rate curve is annualized; see {@link KaminoInterestRateBasis}.
75
+ * Absent on reserves serialized before this field existed — treated as `Legacy`.
76
+ */
77
+ interestRateBasis?: number;
54
78
  /** Maximum deposit limit of liquidity in native units, u64::MAX for inf */
55
79
  depositLimit: BN;
56
80
  /** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */
@@ -118,6 +142,8 @@ interface KaminoReserveCollateralJSON {
118
142
  interface KaminoReserveConfigJSON {
119
143
  protocolTakeRatePct: number;
120
144
  hostFixedInterestRateBps: number;
145
+ /** `KaminoInterestRateBasis` as a raw u8; missing on older DTOs (= Legacy) */
146
+ interestRateBasis?: number;
121
147
  depositLimit: string;
122
148
  borrowLimit: string;
123
149
  borrowRateCurve: KaminoBorrowRateCurveJSON;
@@ -835,4 +861,4 @@ interface JupRateModelJSON {
835
861
  rateAtKink2: number;
836
862
  }
837
863
 
838
- export { type KaminoObligationCollateralJSON as $, type KaminoReserveCollateral as A, type KaminoReserveConfig as B, type KaminoBorrowRateCurve as C, type DriftSpotMarket as D, type KaminoReserveTokenInfo as E, type FeeStructureJSON as F, type KaminoScopeConfiguration as G, type HistoricalOracleData as H, type InsuranceFund as I, type JupLendingState as J, type KaminoReserve as K, type KaminoSwitchboardConfiguration as L, type KaminoPythConfiguration as M, type KaminoReserveLiquidityJSON as N, type OracleGuardRailsJSON as O, type PoolBalance as P, type KaminoReserveCollateralJSON as Q, type KaminoReserveConfigJSON as R, type SpotPosition as S, type KaminoBorrowRateCurveJSON as T, type KaminoBorrowRateCurvePointJSON as U, type KaminoReserveTokenInfoJSON as V, type KaminoScopeConfigurationJSON as W, type KaminoSwitchboardConfigurationJSON as X, type KaminoPythConfigurationJSON as Y, type KaminoObligationCollateral as Z, type KaminoObligationLiquidity as _, type KaminoObligation as a, type KaminoObligationLiquidityJSON as a0, type KaminoFarmTokenInfo as a1, type KaminoRewardScheduleCurve as a2, type KaminoRewardCurvePoint as a3, type KaminoFarmTokenInfoJSON as a4, type KaminoFarmRewardInfoJSON as a5, type KaminoRewardScheduleCurveJSON as a6, type KaminoRewardCurvePointJSON as a7, type UserFeesJSON as a8, type UserFeesFields as a9, isSpotBalanceTypeVariant as aa, type FeeTier as ab, type FeeTierJSON as ac, type OrderFillerRewardStructure as ad, type OrderFillerRewardStructureJSON as ae, type PriceDivergenceGuardRails as af, type PriceDivergenceGuardRailsJSON as ag, type ValidityGuardRails as ah, type ValidityGuardRailsJSON as ai, type HistoricalOracleDataJSON as aj, type HistoricalIndexDataJSON as ak, type PoolBalanceJSON as al, type InsuranceFundJSON as am, SpotBalanceType as an, type SpotPositionJSON as ao, type KaminoFarmState as b, type DriftUser as c, type DriftRewards as d, type DriftUserStats as e, type JupTokenReserve as f, type JupLendingRewardsRateModel as g, type JupRateModel as h, type KaminoReserveJSON as i, type KaminoObligationJSON as j, type KaminoFarmStateJSON as k, type DriftSpotMarketJSON as l, type DriftUserJSON as m, type DriftRewardsJSON as n, type DriftUserStatsJSON as o, type JupLendingStateJSON as p, type JupTokenReserveJSON as q, type JupLendingRewardsRateModelJSON as r, type JupRateModelJSON as s, type KaminoBorrowRateCurvePoint as t, type KaminoFarmRewardInfo as u, type HistoricalIndexData as v, type FeeStructure as w, type OracleGuardRails as x, DriftSpotBalanceType as y, type KaminoReserveLiquidity as z };
864
+ export { type KaminoObligationLiquidity as $, type KaminoReserveLiquidity as A, type KaminoReserveCollateral as B, type KaminoReserveConfig as C, type DriftSpotMarket as D, type KaminoBorrowRateCurve as E, type FeeStructureJSON as F, type KaminoReserveTokenInfo as G, type HistoricalOracleData as H, type InsuranceFund as I, type JupLendingState as J, type KaminoReserve as K, type KaminoScopeConfiguration as L, type KaminoSwitchboardConfiguration as M, type KaminoPythConfiguration as N, type OracleGuardRailsJSON as O, type PoolBalance as P, type KaminoReserveLiquidityJSON as Q, type KaminoReserveCollateralJSON as R, type SpotPosition as S, type KaminoReserveConfigJSON as T, type KaminoBorrowRateCurveJSON as U, type KaminoBorrowRateCurvePointJSON as V, type KaminoReserveTokenInfoJSON as W, type KaminoScopeConfigurationJSON as X, type KaminoSwitchboardConfigurationJSON as Y, type KaminoPythConfigurationJSON as Z, type KaminoObligationCollateral as _, type KaminoObligation as a, type KaminoObligationCollateralJSON as a0, type KaminoObligationLiquidityJSON as a1, type KaminoFarmTokenInfo as a2, type KaminoRewardScheduleCurve as a3, type KaminoRewardCurvePoint as a4, type KaminoFarmTokenInfoJSON as a5, type KaminoFarmRewardInfoJSON as a6, type KaminoRewardScheduleCurveJSON as a7, type KaminoRewardCurvePointJSON as a8, type UserFeesJSON as a9, type UserFeesFields as aa, isSpotBalanceTypeVariant as ab, type FeeTier as ac, type FeeTierJSON as ad, type OrderFillerRewardStructure as ae, type OrderFillerRewardStructureJSON as af, type PriceDivergenceGuardRails as ag, type PriceDivergenceGuardRailsJSON as ah, type ValidityGuardRails as ai, type ValidityGuardRailsJSON as aj, type HistoricalOracleDataJSON as ak, type HistoricalIndexDataJSON as al, type PoolBalanceJSON as am, type InsuranceFundJSON as an, SpotBalanceType as ao, type SpotPositionJSON as ap, type KaminoFarmState as b, type DriftUser as c, type DriftRewards as d, type DriftUserStats as e, type JupTokenReserve as f, type JupLendingRewardsRateModel as g, type JupRateModel as h, type KaminoReserveJSON as i, type KaminoObligationJSON as j, type KaminoFarmStateJSON as k, type DriftSpotMarketJSON as l, type DriftUserJSON as m, type DriftRewardsJSON as n, type DriftUserStatsJSON as o, type JupLendingStateJSON as p, type JupTokenReserveJSON as q, type JupLendingRewardsRateModelJSON as r, type JupRateModelJSON as s, KaminoInterestRateBasis as t, type KaminoBorrowRateCurvePoint as u, type KaminoFarmRewardInfo as v, type HistoricalIndexData as w, type FeeStructure as x, type OracleGuardRails as y, DriftSpotBalanceType as z };