@0dotxyz/p0-ts-sdk 2.3.2 → 2.4.0

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/vendor.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PublicKey, TransactionInstruction, SYSVAR_RENT_PUBKEY, SystemProgram, STAKE_CONFIG_ID, Transaction, LAMPORTS_PER_SOL, StakeProgram, SYSVAR_CLOCK_PUBKEY, AddressLookupTableAccount } from '@solana/web3.js';
2
2
  import { BigNumber } from 'bignumber.js';
3
3
  import { deserialize } from 'borsh';
4
- import BN2, { BN } from 'bn.js';
4
+ import BN5, { BN } from 'bn.js';
5
5
  import { struct, u8, u32 } from '@solana/buffer-layout';
6
6
  import { bool, publicKey, u64 } from '@solana/buffer-layout-utils';
7
7
  import { Buffer as Buffer$1 } from 'buffer';
@@ -4037,233 +4037,63 @@ async function makeRefreshingIxs({
4037
4037
  }
4038
4038
 
4039
4039
  // src/vendor/klend/utils/klend/serialize.utils.ts
4040
- function obligationRawToDto(obligationRaw) {
4040
+ function kaminoObligationToDto(obligation) {
4041
4041
  return {
4042
- tag: obligationRaw.tag.toString(),
4043
- lastUpdate: {
4044
- slot: obligationRaw.lastUpdate.slot.toString(),
4045
- stale: obligationRaw.lastUpdate.stale,
4046
- priceStatus: obligationRaw.lastUpdate.priceStatus,
4047
- placeholder: obligationRaw.lastUpdate.placeholder
4048
- },
4049
- lendingMarket: obligationRaw.lendingMarket.toBase58(),
4050
- owner: obligationRaw.owner.toBase58(),
4051
- deposits: obligationRaw.deposits.map(
4052
- (item) => obligationCollateralToDto(item)
4053
- ),
4054
- lowestReserveDepositLiquidationLtv: obligationRaw.lowestReserveDepositLiquidationLtv.toString(),
4055
- depositedValueSf: obligationRaw.depositedValueSf.toString(),
4056
- borrows: obligationRaw.borrows.map(
4057
- (item) => obligationLiquidityToDto(item)
4058
- ),
4059
- borrowFactorAdjustedDebtValueSf: obligationRaw.borrowFactorAdjustedDebtValueSf.toString(),
4060
- borrowedAssetsMarketValueSf: obligationRaw.borrowedAssetsMarketValueSf.toString(),
4061
- allowedBorrowValueSf: obligationRaw.allowedBorrowValueSf.toString(),
4062
- unhealthyBorrowValueSf: obligationRaw.unhealthyBorrowValueSf.toString(),
4063
- depositsAssetTiers: obligationRaw.depositsAssetTiers,
4064
- borrowsAssetTiers: obligationRaw.borrowsAssetTiers,
4065
- elevationGroup: obligationRaw.elevationGroup,
4066
- numOfObsoleteDepositReserves: obligationRaw.numOfObsoleteDepositReserves,
4067
- hasDebt: obligationRaw.hasDebt,
4068
- referrer: obligationRaw.referrer.toBase58(),
4069
- borrowingDisabled: obligationRaw.borrowingDisabled,
4070
- autodeleverageTargetLtvPct: obligationRaw.autodeleverageTargetLtvPct,
4071
- lowestReserveDepositMaxLtvPct: obligationRaw.lowestReserveDepositMaxLtvPct,
4072
- numOfObsoleteBorrowReserves: obligationRaw.numOfObsoleteBorrowReserves,
4073
- reserved: obligationRaw.reserved,
4074
- highestBorrowFactorPct: obligationRaw.highestBorrowFactorPct.toString(),
4075
- autodeleverageMarginCallStartedTimestamp: obligationRaw.autodeleverageMarginCallStartedTimestamp.toString(),
4076
- orders: obligationRaw.orders.map((item) => obligationOrderToDto(item)),
4077
- padding3: obligationRaw.padding3.map((item) => item.toString())
4078
- };
4079
- }
4080
- function reserveRawToDto(reserveRaw) {
4081
- return {
4082
- version: reserveRaw.version.toString(),
4083
- lastUpdate: {
4084
- slot: reserveRaw.lastUpdate.slot.toString(),
4085
- stale: reserveRaw.lastUpdate.stale,
4086
- priceStatus: reserveRaw.lastUpdate.priceStatus,
4087
- placeholder: reserveRaw.lastUpdate.placeholder
4088
- },
4089
- lendingMarket: reserveRaw.lendingMarket.toBase58(),
4090
- farmCollateral: reserveRaw.farmCollateral.toBase58(),
4091
- farmDebt: reserveRaw.farmDebt.toBase58(),
4092
- liquidity: reserveLiquidityFieldsToDto(reserveRaw.liquidity),
4093
- reserveLiquidityPadding: reserveRaw.reserveLiquidityPadding.map(
4094
- (item) => item.toString()
4095
- ),
4096
- collateral: {
4097
- mintPubkey: reserveRaw.collateral.mintPubkey.toBase58(),
4098
- mintTotalSupply: reserveRaw.collateral.mintTotalSupply.toString(),
4099
- supplyVault: reserveRaw.collateral.supplyVault.toBase58(),
4100
- padding1: reserveRaw.collateral.padding1.map((item) => item.toString()),
4101
- padding2: reserveRaw.collateral.padding2.map((item) => item.toString())
4102
- },
4103
- reserveCollateralPadding: reserveRaw.reserveCollateralPadding.map(
4104
- (item) => item.toString()
4105
- ),
4106
- config: reserveConfigFieldsToDto(reserveRaw.config),
4107
- configPadding: reserveRaw.configPadding.map((item) => item.toString()),
4108
- borrowedAmountOutsideElevationGroup: reserveRaw.borrowedAmountOutsideElevationGroup.toString(),
4109
- borrowedAmountsAgainstThisReserveInElevationGroups: reserveRaw.borrowedAmountsAgainstThisReserveInElevationGroups.map(
4110
- (item) => item.toString()
4111
- ),
4112
- padding: reserveRaw.padding.map((item) => item.toString())
4113
- };
4114
- }
4115
- function reserveLiquidityFieldsToDto(reserveLiquidityFields) {
4116
- return {
4117
- mintPubkey: reserveLiquidityFields.mintPubkey.toBase58(),
4118
- supplyVault: reserveLiquidityFields.supplyVault.toBase58(),
4119
- feeVault: reserveLiquidityFields.feeVault.toBase58(),
4120
- availableAmount: reserveLiquidityFields.availableAmount.toString(),
4121
- borrowedAmountSf: reserveLiquidityFields.borrowedAmountSf.toString(),
4122
- marketPriceSf: reserveLiquidityFields.marketPriceSf.toString(),
4123
- marketPriceLastUpdatedTs: reserveLiquidityFields.marketPriceLastUpdatedTs.toString(),
4124
- mintDecimals: reserveLiquidityFields.mintDecimals.toString(),
4125
- depositLimitCrossedTimestamp: reserveLiquidityFields.depositLimitCrossedTimestamp.toString(),
4126
- borrowLimitCrossedTimestamp: reserveLiquidityFields.borrowLimitCrossedTimestamp.toString(),
4127
- cumulativeBorrowRateBsf: {
4128
- value: reserveLiquidityFields.cumulativeBorrowRateBsf.value.map(
4129
- (item) => item.toString()
4130
- ),
4131
- padding: reserveLiquidityFields.cumulativeBorrowRateBsf.padding.map(
4132
- (item) => item.toString()
4133
- )
4134
- },
4135
- accumulatedProtocolFeesSf: reserveLiquidityFields.accumulatedProtocolFeesSf.toString(),
4136
- accumulatedReferrerFeesSf: reserveLiquidityFields.accumulatedReferrerFeesSf.toString(),
4137
- pendingReferrerFeesSf: reserveLiquidityFields.pendingReferrerFeesSf.toString(),
4138
- absoluteReferralRateSf: reserveLiquidityFields.absoluteReferralRateSf.toString(),
4139
- tokenProgram: reserveLiquidityFields.tokenProgram.toBase58(),
4140
- padding2: reserveLiquidityFields.padding2.map((item) => item.toString()),
4141
- padding3: reserveLiquidityFields.padding3.map((item) => item.toString())
4142
- };
4143
- }
4144
- function reserveConfigFieldsToDto(reserveConfigFields) {
4145
- return {
4146
- status: reserveConfigFields.status,
4147
- assetTier: reserveConfigFields.assetTier,
4148
- hostFixedInterestRateBps: reserveConfigFields.hostFixedInterestRateBps,
4149
- reserved2: reserveConfigFields.reserved2,
4150
- protocolOrderExecutionFeePct: reserveConfigFields.protocolOrderExecutionFeePct,
4151
- protocolTakeRatePct: reserveConfigFields.protocolTakeRatePct,
4152
- protocolLiquidationFeePct: reserveConfigFields.protocolLiquidationFeePct,
4153
- loanToValuePct: reserveConfigFields.loanToValuePct,
4154
- liquidationThresholdPct: reserveConfigFields.liquidationThresholdPct,
4155
- minLiquidationBonusBps: reserveConfigFields.minLiquidationBonusBps,
4156
- maxLiquidationBonusBps: reserveConfigFields.maxLiquidationBonusBps,
4157
- badDebtLiquidationBonusBps: reserveConfigFields.badDebtLiquidationBonusBps,
4158
- deleveragingMarginCallPeriodSecs: reserveConfigFields.deleveragingMarginCallPeriodSecs.toString(),
4159
- deleveragingThresholdDecreaseBpsPerDay: reserveConfigFields.deleveragingThresholdDecreaseBpsPerDay.toString(),
4160
- fees: {
4161
- borrowFeeSf: reserveConfigFields.fees.borrowFeeSf.toString(),
4162
- flashLoanFeeSf: reserveConfigFields.fees.flashLoanFeeSf.toString(),
4163
- padding: reserveConfigFields.fees.padding
4164
- },
4165
- borrowRateCurve: {
4166
- points: reserveConfigFields.borrowRateCurve.points.map((item) => ({
4167
- utilizationRateBps: item.utilizationRateBps,
4168
- borrowRateBps: item.borrowRateBps
4169
- }))
4170
- },
4171
- borrowFactorPct: reserveConfigFields.borrowFactorPct.toString(),
4172
- depositLimit: reserveConfigFields.depositLimit.toString(),
4173
- borrowLimit: reserveConfigFields.borrowLimit.toString(),
4174
- tokenInfo: tokenInfoFieldsToDto(reserveConfigFields.tokenInfo),
4175
- depositWithdrawalCap: withdrawalCapsFieldsToDto(
4176
- reserveConfigFields.depositWithdrawalCap
4177
- ),
4178
- debtWithdrawalCap: withdrawalCapsFieldsToDto(
4179
- reserveConfigFields.debtWithdrawalCap
4180
- ),
4181
- elevationGroups: reserveConfigFields.elevationGroups,
4182
- disableUsageAsCollOutsideEmode: reserveConfigFields.disableUsageAsCollOutsideEmode,
4183
- utilizationLimitBlockBorrowingAbovePct: reserveConfigFields.utilizationLimitBlockBorrowingAbovePct,
4184
- autodeleverageEnabled: reserveConfigFields.autodeleverageEnabled,
4185
- reserved1: reserveConfigFields.reserved1,
4186
- borrowLimitOutsideElevationGroup: reserveConfigFields.borrowLimitOutsideElevationGroup.toString(),
4187
- borrowLimitAgainstThisCollateralInElevationGroup: reserveConfigFields.borrowLimitAgainstThisCollateralInElevationGroup.map(
4188
- (item) => item.toString()
4189
- ),
4190
- deleveragingBonusIncreaseBpsPerDay: reserveConfigFields.deleveragingBonusIncreaseBpsPerDay.toString()
4191
- };
4192
- }
4193
- function tokenInfoFieldsToDto(tokenInfoFields) {
4194
- return {
4195
- name: tokenInfoFields.name,
4196
- heuristic: {
4197
- lower: tokenInfoFields.heuristic.lower.toString(),
4198
- upper: tokenInfoFields.heuristic.upper.toString(),
4199
- exp: tokenInfoFields.heuristic.exp.toString()
4200
- },
4201
- maxTwapDivergenceBps: tokenInfoFields.maxTwapDivergenceBps.toString(),
4202
- maxAgePriceSeconds: tokenInfoFields.maxAgePriceSeconds.toString(),
4203
- maxAgeTwapSeconds: tokenInfoFields.maxAgeTwapSeconds.toString(),
4204
- scopeConfiguration: {
4205
- priceFeed: tokenInfoFields.scopeConfiguration.priceFeed.toBase58(),
4206
- priceChain: tokenInfoFields.scopeConfiguration.priceChain,
4207
- twapChain: tokenInfoFields.scopeConfiguration.twapChain
4208
- },
4209
- switchboardConfiguration: {
4210
- priceAggregator: tokenInfoFields.switchboardConfiguration.priceAggregator.toBase58(),
4211
- twapAggregator: tokenInfoFields.switchboardConfiguration.twapAggregator.toBase58()
4212
- },
4213
- pythConfiguration: {
4214
- price: tokenInfoFields.pythConfiguration.price.toBase58()
4215
- },
4216
- blockPriceUsage: tokenInfoFields.blockPriceUsage,
4217
- reserved: tokenInfoFields.reserved,
4218
- padding: tokenInfoFields.padding.map((item) => item.toString())
4219
- };
4220
- }
4221
- function withdrawalCapsFieldsToDto(withdrawalCapsFields) {
4222
- return {
4223
- configCapacity: withdrawalCapsFields.configCapacity.toString(),
4224
- currentTotal: withdrawalCapsFields.currentTotal.toString(),
4225
- lastIntervalStartTimestamp: withdrawalCapsFields.lastIntervalStartTimestamp.toString(),
4226
- configIntervalLengthSeconds: withdrawalCapsFields.configIntervalLengthSeconds.toString()
4227
- };
4228
- }
4229
- function obligationCollateralToDto(obligationCollateralFields) {
4230
- return {
4231
- depositReserve: obligationCollateralFields.depositReserve.toBase58(),
4232
- depositedAmount: obligationCollateralFields.depositedAmount.toString(),
4233
- marketValueSf: obligationCollateralFields.marketValueSf.toString(),
4234
- borrowedAmountAgainstThisCollateralInElevationGroup: obligationCollateralFields.borrowedAmountAgainstThisCollateralInElevationGroup.toString(),
4235
- padding: obligationCollateralFields.padding.map((item) => item.toString())
4042
+ lendingMarket: obligation.lendingMarket.toBase58(),
4043
+ owner: obligation.owner.toBase58(),
4044
+ deposits: obligation.deposits.map((item) => ({
4045
+ depositReserve: item.depositReserve.toBase58(),
4046
+ depositedAmount: item.depositedAmount.toString(),
4047
+ marketValueSf: item.marketValueSf.toString()
4048
+ })),
4049
+ borrows: obligation.borrows.map((item) => ({
4050
+ borrowReserve: item.borrowReserve.toBase58(),
4051
+ borrowedAmountSf: item.borrowedAmountSf.toString(),
4052
+ marketValueSf: item.marketValueSf.toString()
4053
+ }))
4236
4054
  };
4237
4055
  }
4238
- function obligationLiquidityToDto(obligationLiquidityFields) {
4056
+ function kaminoReserveToDto(reserve) {
4239
4057
  return {
4240
- borrowReserve: obligationLiquidityFields.borrowReserve.toBase58(),
4241
- cumulativeBorrowRateBsf: {
4242
- value: obligationLiquidityFields.cumulativeBorrowRateBsf.value.map(
4243
- (item) => item.toString()
4244
- ),
4245
- padding: obligationLiquidityFields.cumulativeBorrowRateBsf.padding.map(
4246
- (item) => item.toString()
4247
- )
4058
+ lendingMarket: reserve.lendingMarket.toBase58(),
4059
+ farmCollateral: reserve.farmCollateral.toBase58(),
4060
+ liquidity: {
4061
+ mintPubkey: reserve.liquidity.mintPubkey.toBase58(),
4062
+ supplyVault: reserve.liquidity.supplyVault.toBase58(),
4063
+ mintDecimals: reserve.liquidity.mintDecimals.toString(),
4064
+ availableAmount: reserve.liquidity.availableAmount.toString(),
4065
+ borrowedAmountSf: reserve.liquidity.borrowedAmountSf.toString(),
4066
+ accumulatedProtocolFeesSf: reserve.liquidity.accumulatedProtocolFeesSf.toString(),
4067
+ accumulatedReferrerFeesSf: reserve.liquidity.accumulatedReferrerFeesSf.toString(),
4068
+ pendingReferrerFeesSf: reserve.liquidity.pendingReferrerFeesSf.toString()
4248
4069
  },
4249
- padding: obligationLiquidityFields.padding.toString(),
4250
- borrowedAmountSf: obligationLiquidityFields.borrowedAmountSf.toString(),
4251
- marketValueSf: obligationLiquidityFields.marketValueSf.toString(),
4252
- borrowFactorAdjustedMarketValueSf: obligationLiquidityFields.borrowFactorAdjustedMarketValueSf.toString(),
4253
- borrowedAmountOutsideElevationGroups: obligationLiquidityFields.borrowedAmountOutsideElevationGroups.toString(),
4254
- padding2: obligationLiquidityFields.padding2.map((item) => item.toString())
4255
- };
4256
- }
4257
- function obligationOrderToDto(obligationOrderFields) {
4258
- return {
4259
- conditionThresholdSf: obligationOrderFields.conditionThresholdSf.toString(),
4260
- opportunityParameterSf: obligationOrderFields.opportunityParameterSf.toString(),
4261
- minExecutionBonusBps: obligationOrderFields.minExecutionBonusBps,
4262
- maxExecutionBonusBps: obligationOrderFields.maxExecutionBonusBps,
4263
- conditionType: obligationOrderFields.conditionType,
4264
- opportunityType: obligationOrderFields.opportunityType,
4265
- padding1: obligationOrderFields.padding1,
4266
- padding2: obligationOrderFields.padding2.map((item) => item.toString())
4070
+ collateral: {
4071
+ mintPubkey: reserve.collateral.mintPubkey.toBase58(),
4072
+ mintTotalSupply: reserve.collateral.mintTotalSupply.toString(),
4073
+ supplyVault: reserve.collateral.supplyVault.toBase58()
4074
+ },
4075
+ config: {
4076
+ protocolTakeRatePct: reserve.config.protocolTakeRatePct,
4077
+ hostFixedInterestRateBps: reserve.config.hostFixedInterestRateBps,
4078
+ borrowRateCurve: {
4079
+ points: reserve.config.borrowRateCurve.points.map((item) => ({
4080
+ utilizationRateBps: item.utilizationRateBps,
4081
+ borrowRateBps: item.borrowRateBps
4082
+ }))
4083
+ },
4084
+ tokenInfo: {
4085
+ scopeConfiguration: {
4086
+ priceFeed: reserve.config.tokenInfo.scopeConfiguration.priceFeed.toBase58()
4087
+ },
4088
+ switchboardConfiguration: {
4089
+ priceAggregator: reserve.config.tokenInfo.switchboardConfiguration.priceAggregator.toBase58(),
4090
+ twapAggregator: reserve.config.tokenInfo.switchboardConfiguration.twapAggregator.toBase58()
4091
+ },
4092
+ pythConfiguration: {
4093
+ price: reserve.config.tokenInfo.pythConfiguration.price.toBase58()
4094
+ }
4095
+ }
4096
+ }
4267
4097
  };
4268
4098
  }
4269
4099
 
@@ -12548,267 +12378,75 @@ function decodeKlendObligationData(data) {
12548
12378
  const dec = obligationLayout.decode(data.slice(8));
12549
12379
  return dec;
12550
12380
  }
12551
- function dtoToObligationRaw(obligationDto) {
12381
+ function dtoToKaminoObligation(obligationDto) {
12552
12382
  return {
12553
- tag: new BN2(obligationDto.tag),
12554
- lastUpdate: {
12555
- slot: new BN2(obligationDto.lastUpdate.slot),
12556
- stale: obligationDto.lastUpdate.stale,
12557
- priceStatus: obligationDto.lastUpdate.priceStatus,
12558
- placeholder: obligationDto.lastUpdate.placeholder
12559
- },
12560
12383
  lendingMarket: new PublicKey(obligationDto.lendingMarket),
12561
12384
  owner: new PublicKey(obligationDto.owner),
12562
- deposits: obligationDto.deposits.map(
12563
- (item) => dtoToObligationCollateralFields(item)
12564
- ),
12565
- lowestReserveDepositLiquidationLtv: new BN2(
12566
- obligationDto.lowestReserveDepositLiquidationLtv
12567
- ),
12568
- depositedValueSf: new BN2(obligationDto.depositedValueSf),
12569
- borrows: obligationDto.borrows.map(
12570
- (item) => dtoToObligationLiquidityFields(item)
12571
- ),
12572
- borrowFactorAdjustedDebtValueSf: new BN2(
12573
- obligationDto.borrowFactorAdjustedDebtValueSf
12574
- ),
12575
- borrowedAssetsMarketValueSf: new BN2(
12576
- obligationDto.borrowedAssetsMarketValueSf
12577
- ),
12578
- allowedBorrowValueSf: new BN2(obligationDto.allowedBorrowValueSf),
12579
- unhealthyBorrowValueSf: new BN2(obligationDto.unhealthyBorrowValueSf),
12580
- depositsAssetTiers: obligationDto.depositsAssetTiers,
12581
- borrowsAssetTiers: obligationDto.borrowsAssetTiers,
12582
- elevationGroup: obligationDto.elevationGroup,
12583
- numOfObsoleteDepositReserves: obligationDto.numOfObsoleteDepositReserves,
12584
- hasDebt: obligationDto.hasDebt,
12585
- referrer: new PublicKey(obligationDto.referrer),
12586
- borrowingDisabled: obligationDto.borrowingDisabled,
12587
- autodeleverageTargetLtvPct: obligationDto.autodeleverageTargetLtvPct,
12588
- lowestReserveDepositMaxLtvPct: obligationDto.lowestReserveDepositMaxLtvPct,
12589
- numOfObsoleteBorrowReserves: obligationDto.numOfObsoleteBorrowReserves,
12590
- reserved: obligationDto.reserved,
12591
- highestBorrowFactorPct: new BN2(obligationDto.highestBorrowFactorPct),
12592
- autodeleverageMarginCallStartedTimestamp: new BN2(
12593
- obligationDto.autodeleverageMarginCallStartedTimestamp
12594
- ),
12595
- orders: obligationDto.orders.map(
12596
- (item) => dtoToObligationOrderFields(item)
12597
- ),
12598
- padding3: obligationDto.padding3.map((item) => new BN2(item))
12385
+ deposits: obligationDto.deposits.map((item) => ({
12386
+ depositReserve: new PublicKey(item.depositReserve),
12387
+ depositedAmount: new BN5(item.depositedAmount),
12388
+ marketValueSf: new BN5(item.marketValueSf)
12389
+ })),
12390
+ borrows: obligationDto.borrows.map((item) => ({
12391
+ borrowReserve: new PublicKey(item.borrowReserve),
12392
+ borrowedAmountSf: new BN5(item.borrowedAmountSf),
12393
+ marketValueSf: new BN5(item.marketValueSf)
12394
+ }))
12599
12395
  };
12600
12396
  }
12601
- function dtoToReserveRaw(reserveDto) {
12397
+ function dtoToKaminoReserve(reserveDto) {
12602
12398
  return {
12603
- version: new BN2(reserveDto.version),
12604
- lastUpdate: {
12605
- slot: new BN2(reserveDto.lastUpdate.slot),
12606
- stale: reserveDto.lastUpdate.stale,
12607
- priceStatus: reserveDto.lastUpdate.priceStatus,
12608
- placeholder: reserveDto.lastUpdate.placeholder
12609
- },
12610
12399
  lendingMarket: new PublicKey(reserveDto.lendingMarket),
12611
12400
  farmCollateral: new PublicKey(reserveDto.farmCollateral),
12612
- farmDebt: new PublicKey(reserveDto.farmDebt),
12613
- liquidity: dtoToReserveLiquidityFields(reserveDto.liquidity),
12614
- reserveLiquidityPadding: reserveDto.reserveLiquidityPadding.map(
12615
- (item) => new BN2(item)
12616
- ),
12617
- collateral: {
12618
- mintPubkey: new PublicKey(reserveDto.collateral.mintPubkey),
12619
- mintTotalSupply: new BN2(reserveDto.collateral.mintTotalSupply),
12620
- supplyVault: new PublicKey(reserveDto.collateral.supplyVault),
12621
- padding1: reserveDto.collateral.padding1.map((item) => new BN2(item)),
12622
- padding2: reserveDto.collateral.padding2.map((item) => new BN2(item))
12623
- },
12624
- reserveCollateralPadding: reserveDto.reserveCollateralPadding.map(
12625
- (item) => new BN2(item)
12626
- ),
12627
- config: dtoToReserveConfigFields(reserveDto.config),
12628
- configPadding: reserveDto.configPadding.map((item) => new BN2(item)),
12629
- borrowedAmountOutsideElevationGroup: new BN2(
12630
- reserveDto.borrowedAmountOutsideElevationGroup
12631
- ),
12632
- borrowedAmountsAgainstThisReserveInElevationGroups: reserveDto.borrowedAmountsAgainstThisReserveInElevationGroups.map(
12633
- (item) => new BN2(item)
12634
- ),
12635
- padding: reserveDto.padding.map((item) => new BN2(item))
12636
- };
12637
- }
12638
- function dtoToReserveLiquidityFields(reserveDto) {
12639
- return {
12640
- mintPubkey: new PublicKey(reserveDto.mintPubkey),
12641
- supplyVault: new PublicKey(reserveDto.supplyVault),
12642
- feeVault: new PublicKey(reserveDto.feeVault),
12643
- availableAmount: new BN2(reserveDto.availableAmount),
12644
- borrowedAmountSf: new BN2(reserveDto.borrowedAmountSf),
12645
- marketPriceSf: new BN2(reserveDto.marketPriceSf),
12646
- marketPriceLastUpdatedTs: new BN2(reserveDto.marketPriceLastUpdatedTs),
12647
- mintDecimals: new BN2(reserveDto.mintDecimals),
12648
- depositLimitCrossedTimestamp: new BN2(
12649
- reserveDto.depositLimitCrossedTimestamp
12650
- ),
12651
- borrowLimitCrossedTimestamp: new BN2(reserveDto.borrowLimitCrossedTimestamp),
12652
- cumulativeBorrowRateBsf: {
12653
- value: reserveDto.cumulativeBorrowRateBsf.value.map(
12654
- (item) => new BN2(item)
12401
+ liquidity: {
12402
+ mintPubkey: new PublicKey(reserveDto.liquidity.mintPubkey),
12403
+ supplyVault: new PublicKey(reserveDto.liquidity.supplyVault),
12404
+ mintDecimals: new BN5(reserveDto.liquidity.mintDecimals),
12405
+ availableAmount: new BN5(reserveDto.liquidity.availableAmount),
12406
+ borrowedAmountSf: new BN5(reserveDto.liquidity.borrowedAmountSf),
12407
+ accumulatedProtocolFeesSf: new BN5(
12408
+ reserveDto.liquidity.accumulatedProtocolFeesSf
12655
12409
  ),
12656
- padding: reserveDto.cumulativeBorrowRateBsf.padding.map(
12657
- (item) => new BN2(item)
12658
- )
12659
- },
12660
- accumulatedProtocolFeesSf: new BN2(reserveDto.accumulatedProtocolFeesSf),
12661
- accumulatedReferrerFeesSf: new BN2(reserveDto.accumulatedReferrerFeesSf),
12662
- pendingReferrerFeesSf: new BN2(reserveDto.pendingReferrerFeesSf),
12663
- absoluteReferralRateSf: new BN2(reserveDto.absoluteReferralRateSf),
12664
- tokenProgram: new PublicKey(reserveDto.tokenProgram),
12665
- padding2: reserveDto.padding2.map((item) => new BN2(item)),
12666
- padding3: reserveDto.padding3.map((item) => new BN2(item))
12667
- };
12668
- }
12669
- function dtoToReserveConfigFields(reserveDto) {
12670
- return {
12671
- status: reserveDto.status,
12672
- assetTier: reserveDto.assetTier,
12673
- hostFixedInterestRateBps: reserveDto.hostFixedInterestRateBps,
12674
- reserved2: reserveDto.reserved2,
12675
- protocolOrderExecutionFeePct: reserveDto.protocolOrderExecutionFeePct,
12676
- protocolTakeRatePct: reserveDto.protocolTakeRatePct,
12677
- protocolLiquidationFeePct: reserveDto.protocolLiquidationFeePct,
12678
- loanToValuePct: reserveDto.loanToValuePct,
12679
- liquidationThresholdPct: reserveDto.liquidationThresholdPct,
12680
- minLiquidationBonusBps: reserveDto.minLiquidationBonusBps,
12681
- maxLiquidationBonusBps: reserveDto.maxLiquidationBonusBps,
12682
- badDebtLiquidationBonusBps: reserveDto.badDebtLiquidationBonusBps,
12683
- deleveragingMarginCallPeriodSecs: new BN2(
12684
- reserveDto.deleveragingMarginCallPeriodSecs
12685
- ),
12686
- deleveragingThresholdDecreaseBpsPerDay: new BN2(
12687
- reserveDto.deleveragingThresholdDecreaseBpsPerDay
12688
- ),
12689
- fees: {
12690
- borrowFeeSf: new BN2(reserveDto.fees.borrowFeeSf),
12691
- flashLoanFeeSf: new BN2(reserveDto.fees.flashLoanFeeSf),
12692
- padding: reserveDto.fees.padding
12693
- },
12694
- borrowRateCurve: {
12695
- points: reserveDto.borrowRateCurve.points.map((item) => ({
12696
- utilizationRateBps: item.utilizationRateBps,
12697
- borrowRateBps: item.borrowRateBps
12698
- }))
12699
- },
12700
- borrowFactorPct: new BN2(reserveDto.borrowFactorPct),
12701
- depositLimit: new BN2(reserveDto.depositLimit),
12702
- borrowLimit: new BN2(reserveDto.borrowLimit),
12703
- tokenInfo: dtoToTokenInfoFields(reserveDto.tokenInfo),
12704
- depositWithdrawalCap: dtoToWithdrawalCapsFields(
12705
- reserveDto.depositWithdrawalCap
12706
- ),
12707
- debtWithdrawalCap: dtoToWithdrawalCapsFields(reserveDto.debtWithdrawalCap),
12708
- elevationGroups: reserveDto.elevationGroups,
12709
- disableUsageAsCollOutsideEmode: reserveDto.disableUsageAsCollOutsideEmode,
12710
- utilizationLimitBlockBorrowingAbovePct: reserveDto.utilizationLimitBlockBorrowingAbovePct,
12711
- autodeleverageEnabled: reserveDto.autodeleverageEnabled,
12712
- reserved1: reserveDto.reserved1,
12713
- borrowLimitOutsideElevationGroup: new BN2(
12714
- reserveDto.borrowLimitOutsideElevationGroup
12715
- ),
12716
- borrowLimitAgainstThisCollateralInElevationGroup: reserveDto.borrowLimitAgainstThisCollateralInElevationGroup.map(
12717
- (item) => new BN2(item)
12718
- ),
12719
- deleveragingBonusIncreaseBpsPerDay: new BN2(
12720
- reserveDto.deleveragingBonusIncreaseBpsPerDay
12721
- )
12722
- };
12723
- }
12724
- function dtoToTokenInfoFields(tokenInfoDto) {
12725
- return {
12726
- name: tokenInfoDto.name,
12727
- heuristic: {
12728
- lower: new BN2(tokenInfoDto.heuristic.lower),
12729
- upper: new BN2(tokenInfoDto.heuristic.upper),
12730
- exp: new BN2(tokenInfoDto.heuristic.exp)
12731
- },
12732
- maxTwapDivergenceBps: new BN2(tokenInfoDto.maxTwapDivergenceBps),
12733
- maxAgePriceSeconds: new BN2(tokenInfoDto.maxAgePriceSeconds),
12734
- maxAgeTwapSeconds: new BN2(tokenInfoDto.maxAgeTwapSeconds),
12735
- scopeConfiguration: {
12736
- priceFeed: new PublicKey(tokenInfoDto.scopeConfiguration.priceFeed),
12737
- priceChain: tokenInfoDto.scopeConfiguration.priceChain,
12738
- twapChain: tokenInfoDto.scopeConfiguration.twapChain
12739
- },
12740
- switchboardConfiguration: {
12741
- priceAggregator: new PublicKey(
12742
- tokenInfoDto.switchboardConfiguration.priceAggregator
12410
+ accumulatedReferrerFeesSf: new BN5(
12411
+ reserveDto.liquidity.accumulatedReferrerFeesSf
12743
12412
  ),
12744
- twapAggregator: new PublicKey(
12745
- tokenInfoDto.switchboardConfiguration.twapAggregator
12746
- )
12747
- },
12748
- pythConfiguration: {
12749
- price: new PublicKey(tokenInfoDto.pythConfiguration.price)
12413
+ pendingReferrerFeesSf: new BN5(reserveDto.liquidity.pendingReferrerFeesSf)
12750
12414
  },
12751
- blockPriceUsage: tokenInfoDto.blockPriceUsage,
12752
- reserved: tokenInfoDto.reserved,
12753
- padding: tokenInfoDto.padding.map((item) => new BN2(item))
12754
- };
12755
- }
12756
- function dtoToWithdrawalCapsFields(withdrawalCapsDto) {
12757
- return {
12758
- configCapacity: new BN2(withdrawalCapsDto.configCapacity),
12759
- currentTotal: new BN2(withdrawalCapsDto.currentTotal),
12760
- lastIntervalStartTimestamp: new BN2(
12761
- withdrawalCapsDto.lastIntervalStartTimestamp
12762
- ),
12763
- configIntervalLengthSeconds: new BN2(
12764
- withdrawalCapsDto.configIntervalLengthSeconds
12765
- )
12766
- };
12767
- }
12768
- function dtoToObligationCollateralFields(obligationCollateralDto) {
12769
- return {
12770
- depositReserve: new PublicKey(obligationCollateralDto.depositReserve),
12771
- depositedAmount: new BN2(obligationCollateralDto.depositedAmount),
12772
- marketValueSf: new BN2(obligationCollateralDto.marketValueSf),
12773
- borrowedAmountAgainstThisCollateralInElevationGroup: new BN2(
12774
- obligationCollateralDto.borrowedAmountAgainstThisCollateralInElevationGroup
12775
- ),
12776
- padding: obligationCollateralDto.padding.map((item) => new BN2(item))
12777
- };
12778
- }
12779
- function dtoToObligationLiquidityFields(obligationLiquidityDto) {
12780
- return {
12781
- borrowReserve: new PublicKey(obligationLiquidityDto.borrowReserve),
12782
- cumulativeBorrowRateBsf: {
12783
- value: obligationLiquidityDto.cumulativeBorrowRateBsf.value.map(
12784
- (item) => new BN2(item)
12785
- ),
12786
- padding: obligationLiquidityDto.cumulativeBorrowRateBsf.padding.map(
12787
- (item) => new BN2(item)
12788
- )
12789
- },
12790
- padding: new BN2(obligationLiquidityDto.padding),
12791
- borrowedAmountSf: new BN2(obligationLiquidityDto.borrowedAmountSf),
12792
- marketValueSf: new BN2(obligationLiquidityDto.marketValueSf),
12793
- borrowFactorAdjustedMarketValueSf: new BN2(
12794
- obligationLiquidityDto.borrowFactorAdjustedMarketValueSf
12795
- ),
12796
- borrowedAmountOutsideElevationGroups: new BN2(
12797
- obligationLiquidityDto.borrowedAmountOutsideElevationGroups
12798
- ),
12799
- padding2: obligationLiquidityDto.padding2.map((item) => new BN2(item))
12800
- };
12801
- }
12802
- function dtoToObligationOrderFields(obligationOrderDto) {
12803
- return {
12804
- conditionThresholdSf: new BN2(obligationOrderDto.conditionThresholdSf),
12805
- opportunityParameterSf: new BN2(obligationOrderDto.opportunityParameterSf),
12806
- minExecutionBonusBps: obligationOrderDto.minExecutionBonusBps,
12807
- maxExecutionBonusBps: obligationOrderDto.maxExecutionBonusBps,
12808
- conditionType: obligationOrderDto.conditionType,
12809
- opportunityType: obligationOrderDto.opportunityType,
12810
- padding1: obligationOrderDto.padding1,
12811
- padding2: obligationOrderDto.padding2.map((item) => new BN2(item))
12415
+ collateral: {
12416
+ mintPubkey: new PublicKey(reserveDto.collateral.mintPubkey),
12417
+ mintTotalSupply: new BN5(reserveDto.collateral.mintTotalSupply),
12418
+ supplyVault: new PublicKey(reserveDto.collateral.supplyVault)
12419
+ },
12420
+ config: {
12421
+ protocolTakeRatePct: reserveDto.config.protocolTakeRatePct,
12422
+ hostFixedInterestRateBps: reserveDto.config.hostFixedInterestRateBps,
12423
+ borrowRateCurve: {
12424
+ points: reserveDto.config.borrowRateCurve.points.map((item) => ({
12425
+ utilizationRateBps: item.utilizationRateBps,
12426
+ borrowRateBps: item.borrowRateBps
12427
+ }))
12428
+ },
12429
+ tokenInfo: {
12430
+ scopeConfiguration: {
12431
+ priceFeed: new PublicKey(
12432
+ reserveDto.config.tokenInfo.scopeConfiguration.priceFeed
12433
+ )
12434
+ },
12435
+ switchboardConfiguration: {
12436
+ priceAggregator: new PublicKey(
12437
+ reserveDto.config.tokenInfo.switchboardConfiguration.priceAggregator
12438
+ ),
12439
+ twapAggregator: new PublicKey(
12440
+ reserveDto.config.tokenInfo.switchboardConfiguration.twapAggregator
12441
+ )
12442
+ },
12443
+ pythConfiguration: {
12444
+ price: new PublicKey(
12445
+ reserveDto.config.tokenInfo.pythConfiguration.price
12446
+ )
12447
+ }
12448
+ }
12449
+ }
12812
12450
  };
12813
12451
  }
12814
12452
  var SEED_LENDING_MARKET_AUTH = "lma";
@@ -12934,9 +12572,9 @@ var Fraction = class _Fraction {
12934
12572
  static MAX_SIZE_BF = 256;
12935
12573
  static FRACTIONS = 60;
12936
12574
  static MULTIPLIER = new FractionDecimal(2).pow(_Fraction.FRACTIONS);
12937
- static MAX_F_BN = new BN2(2).pow(new BN2(_Fraction.MAX_SIZE_F)).sub(new BN2(1));
12938
- static MAX_BF_BN = new BN2(2).pow(new BN2(_Fraction.MAX_SIZE_BF)).sub(new BN2(1));
12939
- static MIN_BN = new BN2(0);
12575
+ static MAX_F_BN = new BN5(2).pow(new BN5(_Fraction.MAX_SIZE_F)).sub(new BN5(1));
12576
+ static MAX_BF_BN = new BN5(2).pow(new BN5(_Fraction.MAX_SIZE_BF)).sub(new BN5(1));
12577
+ static MIN_BN = new BN5(0);
12940
12578
  valueSf;
12941
12579
  constructor(valueSf) {
12942
12580
  if (valueSf.lt(_Fraction.MIN_BN) || valueSf.gt(_Fraction.MAX_BF_BN)) {
@@ -12952,7 +12590,7 @@ var Fraction = class _Fraction {
12952
12590
  static fromDecimal(n) {
12953
12591
  const scaledDecimal = new FractionDecimal(n).mul(_Fraction.MULTIPLIER);
12954
12592
  const roundedScaledDecimal = roundNearest(scaledDecimal);
12955
- const scaledValue = new BN2(roundedScaledDecimal.toFixed());
12593
+ const scaledValue = new BN5(roundedScaledDecimal.toFixed());
12956
12594
  return new _Fraction(scaledValue);
12957
12595
  }
12958
12596
  static fromBps(n) {
@@ -12982,7 +12620,7 @@ var Fraction = class _Fraction {
12982
12620
  return this.valueSf.eq(x.getValue());
12983
12621
  }
12984
12622
  };
12985
- new Fraction(new BN2(0));
12623
+ new Fraction(new BN5(0));
12986
12624
  function roundNearest(decimal) {
12987
12625
  return decimal.toDecimalPlaces(0, Decimal3.ROUND_HALF_CEIL);
12988
12626
  }
@@ -13185,76 +12823,25 @@ function lamportsToNumberDecimal(amount, decimals) {
13185
12823
  }
13186
12824
 
13187
12825
  // src/vendor/klend/utils/farms/serialize.utils.ts
13188
- function farmRawToDto(farmRaw) {
12826
+ function kaminoFarmStateToDto(farmState) {
13189
12827
  return {
13190
- farmAdmin: farmRaw.farmAdmin.toBase58(),
13191
- globalConfig: farmRaw.globalConfig.toBase58(),
13192
12828
  token: {
13193
- mint: farmRaw.token.mint.toBase58(),
13194
- decimals: farmRaw.token.decimals.toString(),
13195
- tokenProgram: farmRaw.token.tokenProgram.toBase58(),
13196
- padding: farmRaw.token.padding.map((p) => p.toString())
12829
+ mint: farmState.token.mint.toBase58(),
12830
+ decimals: farmState.token.decimals.toString()
13197
12831
  },
13198
- rewardInfos: farmRaw.rewardInfos.map((item) => ({
12832
+ rewardInfos: farmState.rewardInfos.map((item) => ({
13199
12833
  token: {
13200
12834
  mint: item.token.mint.toBase58(),
13201
- decimals: item.token.decimals.toString(),
13202
- tokenProgram: item.token.tokenProgram.toBase58(),
13203
- padding: item.token.padding.map((p) => p.toString())
12835
+ decimals: item.token.decimals.toString()
13204
12836
  },
13205
- rewardsVault: item.rewardsVault.toBase58(),
13206
- rewardsAvailable: item.rewardsAvailable.toString(),
12837
+ rewardsPerSecondDecimals: item.rewardsPerSecondDecimals,
13207
12838
  rewardScheduleCurve: {
13208
12839
  points: item.rewardScheduleCurve.points.map((p) => ({
13209
12840
  tsStart: p.tsStart.toString(),
13210
12841
  rewardPerTimeUnit: p.rewardPerTimeUnit.toString()
13211
12842
  }))
13212
- },
13213
- minClaimDurationSeconds: item.minClaimDurationSeconds.toString(),
13214
- lastIssuanceTs: item.lastIssuanceTs.toString(),
13215
- rewardsIssuedUnclaimed: item.rewardsIssuedUnclaimed.toString(),
13216
- rewardsIssuedCumulative: item.rewardsIssuedCumulative.toString(),
13217
- rewardPerShareScaled: item.rewardPerShareScaled.toString(),
13218
- placeholder0: item.placeholder0.toString(),
13219
- rewardType: item.rewardType,
13220
- rewardsPerSecondDecimals: item.rewardsPerSecondDecimals,
13221
- padding0: item.padding0,
13222
- padding1: item.padding1.map((p) => p.toString())
13223
- })),
13224
- numRewardTokens: farmRaw.numRewardTokens.toString(),
13225
- numUsers: farmRaw.numUsers.toString(),
13226
- totalStakedAmount: farmRaw.totalStakedAmount.toString(),
13227
- farmVault: farmRaw.farmVault.toBase58(),
13228
- farmVaultsAuthority: farmRaw.farmVaultsAuthority.toBase58(),
13229
- farmVaultsAuthorityBump: farmRaw.farmVaultsAuthorityBump.toString(),
13230
- delegateAuthority: farmRaw.delegateAuthority.toBase58(),
13231
- timeUnit: farmRaw.timeUnit,
13232
- isFarmFrozen: farmRaw.isFarmFrozen,
13233
- isFarmDelegated: farmRaw.isFarmDelegated,
13234
- padding0: farmRaw.padding0,
13235
- withdrawAuthority: farmRaw.withdrawAuthority.toBase58(),
13236
- depositWarmupPeriod: farmRaw.depositWarmupPeriod,
13237
- withdrawalCooldownPeriod: farmRaw.withdrawalCooldownPeriod,
13238
- totalActiveStakeScaled: farmRaw.totalActiveStakeScaled.toString(),
13239
- totalPendingStakeScaled: farmRaw.totalPendingStakeScaled.toString(),
13240
- totalPendingAmount: farmRaw.totalPendingAmount.toString(),
13241
- slashedAmountCurrent: farmRaw.slashedAmountCurrent.toString(),
13242
- slashedAmountCumulative: farmRaw.slashedAmountCumulative.toString(),
13243
- slashedAmountSpillAddress: farmRaw.slashedAmountSpillAddress.toBase58(),
13244
- lockingMode: farmRaw.lockingMode.toString(),
13245
- lockingStartTimestamp: farmRaw.lockingStartTimestamp.toString(),
13246
- lockingDuration: farmRaw.lockingDuration.toString(),
13247
- lockingEarlyWithdrawalPenaltyBps: farmRaw.lockingEarlyWithdrawalPenaltyBps.toString(),
13248
- depositCapAmount: farmRaw.depositCapAmount.toString(),
13249
- scopePrices: farmRaw.scopePrices.toBase58(),
13250
- scopeOraclePriceId: farmRaw.scopeOraclePriceId.toString(),
13251
- scopeOracleMaxAge: farmRaw.scopeOracleMaxAge.toString(),
13252
- pendingFarmAdmin: farmRaw.pendingFarmAdmin.toBase58(),
13253
- strategyId: farmRaw.strategyId.toBase58(),
13254
- delegatedRpsAdmin: farmRaw.delegatedRpsAdmin.toBase58(),
13255
- vaultId: farmRaw.vaultId.toBase58(),
13256
- secondDelegatedAuthority: farmRaw.secondDelegatedAuthority.toBase58(),
13257
- padding: farmRaw.padding.map((item) => item.toString())
12843
+ }
12844
+ }))
13258
12845
  };
13259
12846
  }
13260
12847
  var farmDiscriminator = Buffer.from([198, 102, 216, 74, 63, 66, 163, 190]);
@@ -13349,78 +12936,25 @@ function decodeFarmDataRaw(data) {
13349
12936
  const dec = farmLayout.decode(data.slice(8));
13350
12937
  return dec;
13351
12938
  }
13352
- function dtoToFarmRaw(dto) {
12939
+ function dtoToKaminoFarmState(dto) {
13353
12940
  return {
13354
- farmAdmin: new PublicKey(dto.farmAdmin),
13355
- globalConfig: new PublicKey(dto.globalConfig),
13356
12941
  token: {
13357
12942
  mint: new PublicKey(dto.token.mint),
13358
- decimals: new BN2(dto.token.decimals),
13359
- tokenProgram: new PublicKey(dto.token.tokenProgram),
13360
- padding: dto.token.padding.map((item) => new BN2(item))
12943
+ decimals: new BN5(dto.token.decimals)
13361
12944
  },
13362
12945
  rewardInfos: dto.rewardInfos.map((item) => ({
13363
12946
  token: {
13364
12947
  mint: new PublicKey(item.token.mint),
13365
- decimals: new BN2(item.token.decimals),
13366
- tokenProgram: new PublicKey(item.token.tokenProgram),
13367
- padding: item.token.padding.map((p) => new BN2(p))
12948
+ decimals: new BN5(item.token.decimals)
13368
12949
  },
13369
- rewardsVault: new PublicKey(item.rewardsVault),
13370
- rewardsAvailable: new BN2(item.rewardsAvailable),
12950
+ rewardsPerSecondDecimals: item.rewardsPerSecondDecimals,
13371
12951
  rewardScheduleCurve: {
13372
12952
  points: item.rewardScheduleCurve.points.map((p) => ({
13373
- tsStart: new BN2(p.tsStart),
13374
- rewardPerTimeUnit: new BN2(p.rewardPerTimeUnit)
12953
+ tsStart: new BN5(p.tsStart),
12954
+ rewardPerTimeUnit: new BN5(p.rewardPerTimeUnit)
13375
12955
  }))
13376
- },
13377
- minClaimDurationSeconds: new BN2(item.minClaimDurationSeconds),
13378
- lastIssuanceTs: new BN2(item.lastIssuanceTs),
13379
- rewardsIssuedUnclaimed: new BN2(item.rewardsIssuedUnclaimed),
13380
- rewardsIssuedCumulative: new BN2(item.rewardsIssuedCumulative),
13381
- rewardPerShareScaled: new BN2(item.rewardPerShareScaled),
13382
- placeholder0: new BN2(item.placeholder0),
13383
- rewardType: item.rewardType,
13384
- rewardsPerSecondDecimals: item.rewardsPerSecondDecimals,
13385
- padding0: item.padding0,
13386
- padding1: item.padding1.map((p) => new BN2(p))
13387
- })),
13388
- numRewardTokens: new BN2(dto.numRewardTokens),
13389
- numUsers: new BN2(dto.numUsers),
13390
- totalStakedAmount: new BN2(dto.totalStakedAmount),
13391
- farmVault: new PublicKey(dto.farmVault),
13392
- farmVaultsAuthority: new PublicKey(dto.farmVaultsAuthority),
13393
- farmVaultsAuthorityBump: new BN2(dto.farmVaultsAuthorityBump),
13394
- delegateAuthority: new PublicKey(dto.delegateAuthority),
13395
- timeUnit: dto.timeUnit,
13396
- isFarmFrozen: dto.isFarmFrozen,
13397
- isFarmDelegated: dto.isFarmDelegated,
13398
- padding0: dto.padding0,
13399
- withdrawAuthority: new PublicKey(dto.withdrawAuthority),
13400
- depositWarmupPeriod: dto.depositWarmupPeriod,
13401
- withdrawalCooldownPeriod: dto.withdrawalCooldownPeriod,
13402
- totalActiveStakeScaled: new BN2(dto.totalActiveStakeScaled),
13403
- totalPendingStakeScaled: new BN2(dto.totalPendingStakeScaled),
13404
- totalPendingAmount: new BN2(dto.totalPendingAmount),
13405
- slashedAmountCurrent: new BN2(dto.slashedAmountCurrent),
13406
- slashedAmountCumulative: new BN2(dto.slashedAmountCumulative),
13407
- slashedAmountSpillAddress: new PublicKey(dto.slashedAmountSpillAddress),
13408
- lockingMode: new BN2(dto.lockingMode),
13409
- lockingStartTimestamp: new BN2(dto.lockingStartTimestamp),
13410
- lockingDuration: new BN2(dto.lockingDuration),
13411
- lockingEarlyWithdrawalPenaltyBps: new BN2(
13412
- dto.lockingEarlyWithdrawalPenaltyBps
13413
- ),
13414
- depositCapAmount: new BN2(dto.depositCapAmount),
13415
- scopePrices: new PublicKey(dto.scopePrices),
13416
- scopeOraclePriceId: new BN2(dto.scopeOraclePriceId),
13417
- scopeOracleMaxAge: new BN2(dto.scopeOracleMaxAge),
13418
- pendingFarmAdmin: new PublicKey(dto.pendingFarmAdmin),
13419
- strategyId: new PublicKey(dto.strategyId),
13420
- delegatedRpsAdmin: new PublicKey(dto.delegatedRpsAdmin),
13421
- vaultId: new PublicKey(dto.vaultId),
13422
- secondDelegatedAuthority: new PublicKey(dto.secondDelegatedAuthority),
13423
- padding: dto.padding.map((item) => new BN2(item))
12956
+ }
12957
+ }))
13424
12958
  };
13425
12959
  }
13426
12960
 
@@ -27582,23 +27116,23 @@ function dtoToDriftUserStatsRaw(userStatsDto) {
27582
27116
  authority: new PublicKey(userStatsDto.authority),
27583
27117
  referrer: new PublicKey(userStatsDto.referrer),
27584
27118
  fees: {
27585
- totalFeePaid: new BN2(userStatsDto.fees.totalFeePaid),
27586
- totalFeeRebate: new BN2(userStatsDto.fees.totalFeeRebate),
27587
- totalTokenDiscount: new BN2(userStatsDto.fees.totalTokenDiscount),
27588
- totalRefereeDiscount: new BN2(userStatsDto.fees.totalRefereeDiscount),
27589
- totalReferrerReward: new BN2(userStatsDto.fees.totalReferrerReward),
27590
- currentEpochReferrerReward: new BN2(
27119
+ totalFeePaid: new BN5(userStatsDto.fees.totalFeePaid),
27120
+ totalFeeRebate: new BN5(userStatsDto.fees.totalFeeRebate),
27121
+ totalTokenDiscount: new BN5(userStatsDto.fees.totalTokenDiscount),
27122
+ totalRefereeDiscount: new BN5(userStatsDto.fees.totalRefereeDiscount),
27123
+ totalReferrerReward: new BN5(userStatsDto.fees.totalReferrerReward),
27124
+ currentEpochReferrerReward: new BN5(
27591
27125
  userStatsDto.fees.currentEpochReferrerReward
27592
27126
  )
27593
27127
  },
27594
- nextEpochTs: new BN2(userStatsDto.nextEpochTs),
27595
- makerVolume30d: new BN2(userStatsDto.makerVolume30d),
27596
- takerVolume30d: new BN2(userStatsDto.takerVolume30d),
27597
- fillerVolume30d: new BN2(userStatsDto.fillerVolume30d),
27598
- lastMakerVolume30dTs: new BN2(userStatsDto.lastMakerVolume30dTs),
27599
- lastTakerVolume30dTs: new BN2(userStatsDto.lastTakerVolume30dTs),
27600
- lastFillerVolume30dTs: new BN2(userStatsDto.lastFillerVolume30dTs),
27601
- ifStakedQuoteAssetAmount: new BN2(userStatsDto.ifStakedQuoteAssetAmount),
27128
+ nextEpochTs: new BN5(userStatsDto.nextEpochTs),
27129
+ makerVolume30d: new BN5(userStatsDto.makerVolume30d),
27130
+ takerVolume30d: new BN5(userStatsDto.takerVolume30d),
27131
+ fillerVolume30d: new BN5(userStatsDto.fillerVolume30d),
27132
+ lastMakerVolume30dTs: new BN5(userStatsDto.lastMakerVolume30dTs),
27133
+ lastTakerVolume30dTs: new BN5(userStatsDto.lastTakerVolume30dTs),
27134
+ lastFillerVolume30dTs: new BN5(userStatsDto.lastFillerVolume30dTs),
27135
+ ifStakedQuoteAssetAmount: new BN5(userStatsDto.ifStakedQuoteAssetAmount),
27602
27136
  numberOfSubAccounts: userStatsDto.numberOfSubAccounts,
27603
27137
  numberOfSubAccountsCreated: userStatsDto.numberOfSubAccountsCreated,
27604
27138
  referrerStatus: userStatsDto.referrerStatus,
@@ -27611,7 +27145,7 @@ function dtoToDriftUserStatsRaw(userStatsDto) {
27611
27145
  fuelPositions: userStatsDto.fuelPositions,
27612
27146
  fuelTaker: userStatsDto.fuelTaker,
27613
27147
  fuelMaker: userStatsDto.fuelMaker,
27614
- ifStakedGovTokenAmount: new BN2(userStatsDto.ifStakedGovTokenAmount),
27148
+ ifStakedGovTokenAmount: new BN5(userStatsDto.ifStakedGovTokenAmount),
27615
27149
  lastFuelIfBonusUpdateTs: userStatsDto.lastFuelIfBonusUpdateTs,
27616
27150
  padding: userStatsDto.padding
27617
27151
  };
@@ -27620,10 +27154,10 @@ function dtoToDriftUserRaw(userDto) {
27620
27154
  return {
27621
27155
  authority: new PublicKey(userDto.authority),
27622
27156
  spotPositions: userDto.spotPositions.map((p) => ({
27623
- scaledBalance: new BN2(p.scaledBalance),
27624
- openBids: new BN2(p.openBids),
27625
- openAsks: new BN2(p.openAsks),
27626
- cumulativeDeposits: new BN2(p.cumulativeDeposits),
27157
+ scaledBalance: new BN5(p.scaledBalance),
27158
+ openBids: new BN5(p.openBids),
27159
+ openAsks: new BN5(p.openAsks),
27160
+ cumulativeDeposits: new BN5(p.cumulativeDeposits),
27627
27161
  marketIndex: p.marketIndex,
27628
27162
  balanceType: p.balanceType,
27629
27163
  openOrders: p.openOrders,
@@ -27641,9 +27175,9 @@ function dtoToDriftStateRaw(stateDto) {
27641
27175
  perpFeeStructure: stateDto.perpFeeStructure,
27642
27176
  spotFeeStructure: stateDto.spotFeeStructure,
27643
27177
  oracleGuardRails: stateDto.oracleGuardRails,
27644
- numberOfAuthorities: new BN2(stateDto.numberOfAuthorities),
27645
- numberOfSubAccounts: new BN2(stateDto.numberOfSubAccounts),
27646
- lpCooldownTime: new BN2(stateDto.lpCooldownTime),
27178
+ numberOfAuthorities: new BN5(stateDto.numberOfAuthorities),
27179
+ numberOfSubAccounts: new BN5(stateDto.numberOfSubAccounts),
27180
+ lpCooldownTime: new BN5(stateDto.lpCooldownTime),
27647
27181
  liquidationMarginBufferRatio: stateDto.liquidationMarginBufferRatio,
27648
27182
  settlementDuration: stateDto.settlementDuration,
27649
27183
  numberOfMarkets: stateDto.numberOfMarkets,
@@ -27667,10 +27201,10 @@ function dtoToDriftRewardsRaw(rewardsDto) {
27667
27201
  spotMarket: new PublicKey(rewardsDto.spotMarket),
27668
27202
  mint: new PublicKey(rewardsDto.mint),
27669
27203
  spotPosition: {
27670
- scaledBalance: new BN2(rewardsDto.spotPosition.scaledBalance),
27671
- openBids: new BN2(rewardsDto.spotPosition.openBids),
27672
- openAsks: new BN2(rewardsDto.spotPosition.openAsks),
27673
- cumulativeDeposits: new BN2(rewardsDto.spotPosition.cumulativeDeposits),
27204
+ scaledBalance: new BN5(rewardsDto.spotPosition.scaledBalance),
27205
+ openBids: new BN5(rewardsDto.spotPosition.openBids),
27206
+ openAsks: new BN5(rewardsDto.spotPosition.openAsks),
27207
+ cumulativeDeposits: new BN5(rewardsDto.spotPosition.cumulativeDeposits),
27674
27208
  marketIndex: rewardsDto.spotPosition.marketIndex,
27675
27209
  balanceType: rewardsDto.spotPosition.balanceType,
27676
27210
  openOrders: rewardsDto.spotPosition.openOrders,
@@ -27684,11 +27218,11 @@ function dtoToDriftSpotMarketRaw(spotMarketDto) {
27684
27218
  oracle: new PublicKey(spotMarketDto.oracle),
27685
27219
  mint: new PublicKey(spotMarketDto.mint),
27686
27220
  decimals: spotMarketDto.decimals,
27687
- cumulativeDepositInterest: new BN2(spotMarketDto.cumulativeDepositInterest),
27221
+ cumulativeDepositInterest: new BN5(spotMarketDto.cumulativeDepositInterest),
27688
27222
  marketIndex: spotMarketDto.marketIndex,
27689
- depositBalance: new BN2(spotMarketDto.depositBalance),
27690
- borrowBalance: new BN2(spotMarketDto.borrowBalance),
27691
- cumulativeBorrowInterest: new BN2(spotMarketDto.cumulativeBorrowInterest),
27223
+ depositBalance: new BN5(spotMarketDto.depositBalance),
27224
+ borrowBalance: new BN5(spotMarketDto.borrowBalance),
27225
+ cumulativeBorrowInterest: new BN5(spotMarketDto.cumulativeBorrowInterest),
27692
27226
  optimalUtilization: spotMarketDto.optimalUtilization,
27693
27227
  optimalBorrowRate: spotMarketDto.optimalBorrowRate,
27694
27228
  maxBorrowRate: spotMarketDto.maxBorrowRate,
@@ -27810,10 +27344,10 @@ function decodeDriftUserData(data) {
27810
27344
  return {
27811
27345
  authority: decoded.authority,
27812
27346
  spotPositions: decoded.spot_positions.map((p) => ({
27813
- scaledBalance: new BN2(p.scaled_balance),
27814
- openBids: new BN2(p.open_bids),
27815
- openAsks: new BN2(p.open_asks),
27816
- cumulativeDeposits: new BN2(p.cumulative_deposits),
27347
+ scaledBalance: new BN5(p.scaled_balance),
27348
+ openBids: new BN5(p.open_bids),
27349
+ openAsks: new BN5(p.open_asks),
27350
+ cumulativeDeposits: new BN5(p.cumulative_deposits),
27817
27351
  marketIndex: p.market_index,
27818
27352
  balanceType: p.balance_type,
27819
27353
  openOrders: p.open_orders,
@@ -27920,7 +27454,7 @@ function deriveDriftUser(authority, subAccountId, programId = DRIFT_PROGRAM_ID)
27920
27454
  [
27921
27455
  Buffer.from(SEED_USER),
27922
27456
  authority.toBuffer(),
27923
- new BN2(subAccountId).toArrayLike(Buffer, "le", 2)
27457
+ new BN5(subAccountId).toArrayLike(Buffer, "le", 2)
27924
27458
  ],
27925
27459
  programId
27926
27460
  );
@@ -27935,7 +27469,7 @@ function deriveDriftSpotMarket(marketIndex, programId = DRIFT_PROGRAM_ID) {
27935
27469
  return PublicKey.findProgramAddressSync(
27936
27470
  [
27937
27471
  Buffer.from(SEED_SPOT_MARKET),
27938
- new BN2(marketIndex).toArrayLike(Buffer, "le", 2)
27472
+ new BN5(marketIndex).toArrayLike(Buffer, "le", 2)
27939
27473
  ],
27940
27474
  programId
27941
27475
  );
@@ -27944,23 +27478,23 @@ function deriveDriftSpotMarketVault(marketIndex, programId = DRIFT_PROGRAM_ID) {
27944
27478
  return PublicKey.findProgramAddressSync(
27945
27479
  [
27946
27480
  Buffer.from(SEED_SPOT_MARKET_VAULT),
27947
- new BN2(marketIndex).toArrayLike(Buffer, "le", 2)
27481
+ new BN5(marketIndex).toArrayLike(Buffer, "le", 2)
27948
27482
  ],
27949
27483
  programId
27950
27484
  );
27951
27485
  }
27952
- var ZERO = new BN2(0);
27953
- var ONE = new BN2(1);
27954
- var TEN = new BN2(10);
27955
- var PERCENTAGE_PRECISION_EXP = new BN2(6);
27956
- var PERCENTAGE_PRECISION = new BN2(10).pow(PERCENTAGE_PRECISION_EXP);
27957
- var SPOT_MARKET_RATE_PRECISION_EXP = new BN2(6);
27958
- var SPOT_MARKET_RATE_PRECISION = new BN2(10).pow(SPOT_MARKET_RATE_PRECISION_EXP);
27959
- var SPOT_MARKET_UTILIZATION_PRECISION_EXP = new BN2(6);
27960
- var SPOT_MARKET_UTILIZATION_PRECISION = new BN2(10).pow(
27486
+ var ZERO = new BN5(0);
27487
+ var ONE = new BN5(1);
27488
+ var TEN = new BN5(10);
27489
+ var PERCENTAGE_PRECISION_EXP = new BN5(6);
27490
+ var PERCENTAGE_PRECISION = new BN5(10).pow(PERCENTAGE_PRECISION_EXP);
27491
+ var SPOT_MARKET_RATE_PRECISION_EXP = new BN5(6);
27492
+ var SPOT_MARKET_RATE_PRECISION = new BN5(10).pow(SPOT_MARKET_RATE_PRECISION_EXP);
27493
+ var SPOT_MARKET_UTILIZATION_PRECISION_EXP = new BN5(6);
27494
+ var SPOT_MARKET_UTILIZATION_PRECISION = new BN5(10).pow(
27961
27495
  SPOT_MARKET_UTILIZATION_PRECISION_EXP
27962
27496
  );
27963
- var ONE_YEAR = new BN2(31536e3);
27497
+ var ONE_YEAR = new BN5(31536e3);
27964
27498
  function divCeil(a, b) {
27965
27499
  const quotient = a.div(b);
27966
27500
  const remainder = a.mod(b);
@@ -27970,7 +27504,7 @@ function divCeil(a, b) {
27970
27504
  return quotient;
27971
27505
  }
27972
27506
  function getDriftTokenAmount(balanceAmount, spotMarket, balanceType) {
27973
- const precisionDecrease = TEN.pow(new BN2(19 - spotMarket.decimals));
27507
+ const precisionDecrease = TEN.pow(new BN5(19 - spotMarket.decimals));
27974
27508
  if (isSpotBalanceTypeVariant(balanceType, "deposit")) {
27975
27509
  return balanceAmount.mul(spotMarket.cumulativeDepositInterest).div(precisionDecrease);
27976
27510
  } else {
@@ -28005,18 +27539,18 @@ function calculateDriftUtilization(bank, delta = ZERO) {
28005
27539
  }
28006
27540
  function calculateDriftInterestRate(bank, delta = ZERO, currentUtilization = null) {
28007
27541
  const utilization = currentUtilization || calculateDriftUtilization(bank, delta);
28008
- const optimalUtil = new BN2(bank.optimalUtilization);
28009
- const optimalRate = new BN2(bank.optimalBorrowRate);
28010
- const maxRate = new BN2(bank.maxBorrowRate);
28011
- const minRate = new BN2(bank.minBorrowRate).mul(PERCENTAGE_PRECISION.divn(200));
28012
- const weightsDivisor = new BN2(1e3);
27542
+ const optimalUtil = new BN5(bank.optimalUtilization);
27543
+ const optimalRate = new BN5(bank.optimalBorrowRate);
27544
+ const maxRate = new BN5(bank.maxBorrowRate);
27545
+ const minRate = new BN5(bank.minBorrowRate).mul(PERCENTAGE_PRECISION.divn(200));
27546
+ const weightsDivisor = new BN5(1e3);
28013
27547
  const segments = [
28014
- [new BN2(85e4), new BN2(50)],
28015
- [new BN2(9e5), new BN2(100)],
28016
- [new BN2(95e4), new BN2(150)],
28017
- [new BN2(99e4), new BN2(200)],
28018
- [new BN2(995e3), new BN2(250)],
28019
- [SPOT_MARKET_UTILIZATION_PRECISION, new BN2(250)]
27548
+ [new BN5(85e4), new BN5(50)],
27549
+ [new BN5(9e5), new BN5(100)],
27550
+ [new BN5(95e4), new BN5(150)],
27551
+ [new BN5(99e4), new BN5(200)],
27552
+ [new BN5(995e3), new BN5(250)],
27553
+ [SPOT_MARKET_UTILIZATION_PRECISION, new BN5(250)]
28020
27554
  ];
28021
27555
  let rate;
28022
27556
  if (utilization.lte(optimalUtil)) {
@@ -28041,7 +27575,7 @@ function calculateDriftInterestRate(bank, delta = ZERO, currentUtilization = nul
28041
27575
  }
28042
27576
  }
28043
27577
  }
28044
- return BN2.max(minRate, rate);
27578
+ return BN5.max(minRate, rate);
28045
27579
  }
28046
27580
  function calculateDriftBorrowRate(bank, delta = ZERO, currentUtilization = null) {
28047
27581
  return calculateDriftInterestRate(bank, delta, currentUtilization);
@@ -28049,7 +27583,7 @@ function calculateDriftBorrowRate(bank, delta = ZERO, currentUtilization = null)
28049
27583
  function calculateDriftDepositRate(bank, delta = ZERO, currentUtilization = null) {
28050
27584
  const utilization = currentUtilization || calculateDriftUtilization(bank, delta);
28051
27585
  const borrowRate = calculateDriftBorrowRate(bank, delta, utilization);
28052
- const depositRate = borrowRate.mul(PERCENTAGE_PRECISION.sub(new BN2(bank.insuranceFund.totalFactor))).mul(utilization).div(SPOT_MARKET_UTILIZATION_PRECISION).div(PERCENTAGE_PRECISION);
27586
+ const depositRate = borrowRate.mul(PERCENTAGE_PRECISION.sub(new BN5(bank.insuranceFund.totalFactor))).mul(utilization).div(SPOT_MARKET_UTILIZATION_PRECISION).div(PERCENTAGE_PRECISION);
28053
27587
  return depositRate;
28054
27588
  }
28055
27589
  function calculateDriftLendingAPY(bank, delta = ZERO, currentUtilization = null, compoundingPeriodsPerYear = 365) {
@@ -28057,7 +27591,7 @@ function calculateDriftLendingAPY(bank, delta = ZERO, currentUtilization = null,
28057
27591
  if (depositRate.eq(ZERO)) {
28058
27592
  return ZERO;
28059
27593
  }
28060
- const CALC_PRECISION = new BN2(10).pow(new BN2(18));
27594
+ const CALC_PRECISION = new BN5(10).pow(new BN5(18));
28061
27595
  const rateInCalcPrecisionDecimal = depositRate.mul(CALC_PRECISION).div(SPOT_MARKET_RATE_PRECISION);
28062
27596
  let expResult = CALC_PRECISION;
28063
27597
  let term = rateInCalcPrecisionDecimal;
@@ -28090,7 +27624,7 @@ function calculateDriftBorrowAPY(bank, delta = ZERO, currentUtilization = null,
28090
27624
  if (borrowRate.eq(ZERO)) {
28091
27625
  return ZERO;
28092
27626
  }
28093
- const CALC_PRECISION = new BN2(10).pow(new BN2(18));
27627
+ const CALC_PRECISION = new BN5(10).pow(new BN5(18));
28094
27628
  const rateInCalcPrecisionDecimal = borrowRate.mul(CALC_PRECISION).div(SPOT_MARKET_RATE_PRECISION);
28095
27629
  let expResult = CALC_PRECISION;
28096
27630
  let term = rateInCalcPrecisionDecimal;
@@ -28126,7 +27660,7 @@ function calculateAPYFromAPR2(apr) {
28126
27660
  function generateDriftReserveCurve(spotMarket) {
28127
27661
  return Array.from({ length: 101 }, (_, i) => {
28128
27662
  const utilizationPercent = i / 100;
28129
- const utilizationBN = new BN2(
27663
+ const utilizationBN = new BN5(
28130
27664
  Math.floor(utilizationPercent * SPOT_MARKET_UTILIZATION_PRECISION.toNumber())
28131
27665
  );
28132
27666
  const borrowRateBN = calculateDriftBorrowRate(spotMarket, ZERO, utilizationBN);
@@ -31532,29 +31066,29 @@ function decodeJupTokenReserveData(data, pubkey) {
31532
31066
  offset += 2;
31533
31067
  const lastUtilization = data.readUInt16LE(offset);
31534
31068
  offset += 2;
31535
- const lastUpdateTimestamp = new BN2(data.slice(offset, offset + 8), "le");
31069
+ const lastUpdateTimestamp = new BN5(data.slice(offset, offset + 8), "le");
31536
31070
  offset += 8;
31537
- const supplyExchangePrice = new BN2(data.slice(offset, offset + 8), "le");
31071
+ const supplyExchangePrice = new BN5(data.slice(offset, offset + 8), "le");
31538
31072
  offset += 8;
31539
- const borrowExchangePrice = new BN2(data.slice(offset, offset + 8), "le");
31073
+ const borrowExchangePrice = new BN5(data.slice(offset, offset + 8), "le");
31540
31074
  offset += 8;
31541
31075
  const maxUtilization = data.readUInt16LE(offset);
31542
31076
  offset += 2;
31543
- const totalSupplyWithInterest = new BN2(data.slice(offset, offset + 8), "le");
31077
+ const totalSupplyWithInterest = new BN5(data.slice(offset, offset + 8), "le");
31544
31078
  offset += 8;
31545
- const totalSupplyInterestFree = new BN2(data.slice(offset, offset + 8), "le");
31079
+ const totalSupplyInterestFree = new BN5(data.slice(offset, offset + 8), "le");
31546
31080
  offset += 8;
31547
- const totalBorrowWithInterest = new BN2(data.slice(offset, offset + 8), "le");
31081
+ const totalBorrowWithInterest = new BN5(data.slice(offset, offset + 8), "le");
31548
31082
  offset += 8;
31549
- const totalBorrowInterestFree = new BN2(data.slice(offset, offset + 8), "le");
31083
+ const totalBorrowInterestFree = new BN5(data.slice(offset, offset + 8), "le");
31550
31084
  offset += 8;
31551
- const totalClaimAmount = new BN2(data.slice(offset, offset + 8), "le");
31085
+ const totalClaimAmount = new BN5(data.slice(offset, offset + 8), "le");
31552
31086
  offset += 8;
31553
31087
  const interactingProtocol = new PublicKey(data.slice(offset, offset + 32));
31554
31088
  offset += 32;
31555
- const interactingTimestamp = new BN2(data.slice(offset, offset + 8), "le");
31089
+ const interactingTimestamp = new BN5(data.slice(offset, offset + 8), "le");
31556
31090
  offset += 8;
31557
- const interactingBalance = new BN2(data.slice(offset, offset + 8), "le");
31091
+ const interactingBalance = new BN5(data.slice(offset, offset + 8), "le");
31558
31092
  return {
31559
31093
  pubkey,
31560
31094
  mint,
@@ -31616,9 +31150,9 @@ function dtoToJupLendingStateRaw(dto) {
31616
31150
  lendingId: dto.lendingId,
31617
31151
  decimals: dto.decimals,
31618
31152
  rewardsRateModel: new PublicKey(dto.rewardsRateModel),
31619
- liquidityExchangePrice: new BN2(dto.liquidityExchangePrice),
31620
- tokenExchangePrice: new BN2(dto.tokenExchangePrice),
31621
- lastUpdateTimestamp: new BN2(dto.lastUpdateTimestamp),
31153
+ liquidityExchangePrice: new BN5(dto.liquidityExchangePrice),
31154
+ tokenExchangePrice: new BN5(dto.tokenExchangePrice),
31155
+ lastUpdateTimestamp: new BN5(dto.lastUpdateTimestamp),
31622
31156
  tokenReservesLiquidity: new PublicKey(dto.tokenReservesLiquidity),
31623
31157
  supplyPositionOnLiquidity: new PublicKey(dto.supplyPositionOnLiquidity)
31624
31158
  };
@@ -31631,30 +31165,30 @@ function dtoToJupTokenReserveRaw(dto) {
31631
31165
  borrowRate: dto.borrowRate,
31632
31166
  feeOnInterest: dto.feeOnInterest,
31633
31167
  lastUtilization: dto.lastUtilization,
31634
- lastUpdateTimestamp: new BN2(dto.lastUpdateTimestamp),
31635
- supplyExchangePrice: new BN2(dto.supplyExchangePrice),
31636
- borrowExchangePrice: new BN2(dto.borrowExchangePrice),
31168
+ lastUpdateTimestamp: new BN5(dto.lastUpdateTimestamp),
31169
+ supplyExchangePrice: new BN5(dto.supplyExchangePrice),
31170
+ borrowExchangePrice: new BN5(dto.borrowExchangePrice),
31637
31171
  maxUtilization: dto.maxUtilization,
31638
- totalSupplyWithInterest: new BN2(dto.totalSupplyWithInterest),
31639
- totalSupplyInterestFree: new BN2(dto.totalSupplyInterestFree),
31640
- totalBorrowWithInterest: new BN2(dto.totalBorrowWithInterest),
31641
- totalBorrowInterestFree: new BN2(dto.totalBorrowInterestFree),
31642
- totalClaimAmount: new BN2(dto.totalClaimAmount),
31172
+ totalSupplyWithInterest: new BN5(dto.totalSupplyWithInterest),
31173
+ totalSupplyInterestFree: new BN5(dto.totalSupplyInterestFree),
31174
+ totalBorrowWithInterest: new BN5(dto.totalBorrowWithInterest),
31175
+ totalBorrowInterestFree: new BN5(dto.totalBorrowInterestFree),
31176
+ totalClaimAmount: new BN5(dto.totalClaimAmount),
31643
31177
  interactingProtocol: new PublicKey(dto.interactingProtocol),
31644
- interactingTimestamp: new BN2(dto.interactingTimestamp),
31645
- interactingBalance: new BN2(dto.interactingBalance)
31178
+ interactingTimestamp: new BN5(dto.interactingTimestamp),
31179
+ interactingBalance: new BN5(dto.interactingBalance)
31646
31180
  };
31647
31181
  }
31648
31182
  function dtoToJupLendingRewardsRateModelRaw(dto) {
31649
31183
  return {
31650
31184
  pubkey: new PublicKey(dto.pubkey),
31651
31185
  mint: new PublicKey(dto.mint),
31652
- startTvl: new BN2(dto.startTvl),
31653
- duration: new BN2(dto.duration),
31654
- startTime: new BN2(dto.startTime),
31655
- yearlyReward: new BN2(dto.yearlyReward),
31656
- nextDuration: new BN2(dto.nextDuration),
31657
- nextRewardAmount: new BN2(dto.nextRewardAmount)
31186
+ startTvl: new BN5(dto.startTvl),
31187
+ duration: new BN5(dto.duration),
31188
+ startTime: new BN5(dto.startTime),
31189
+ yearlyReward: new BN5(dto.yearlyReward),
31190
+ nextDuration: new BN5(dto.nextDuration),
31191
+ nextRewardAmount: new BN5(dto.nextRewardAmount)
31658
31192
  };
31659
31193
  }
31660
31194
  function dtoToJupRateModelRaw(dto) {
@@ -31770,15 +31304,15 @@ function deriveJupLendLiquiditySupplyPositionPda(underlyingMint, lendingPda, liq
31770
31304
  var aprToApy2 = (apr, compoundingFrequency = HOURS_PER_YEAR, apyCap = 3) => Math.min((1 + apr / compoundingFrequency) ** compoundingFrequency - 1, apyCap);
31771
31305
 
31772
31306
  // src/vendor/jup-lend/utils/interest-rate.utils.ts
31773
- var JUP_EXCHANGE_PRICES_PRECISION = new BN2("1000000000000");
31774
- var JUP_SECONDS_PER_YEAR = new BN2(31536e3);
31775
- var JUP_MAX_REWARDS_RATE = new BN2("50000000000000");
31307
+ var JUP_EXCHANGE_PRICES_PRECISION = new BN5("1000000000000");
31308
+ var JUP_SECONDS_PER_YEAR = new BN5(31536e3);
31309
+ var JUP_MAX_REWARDS_RATE = new BN5("50000000000000");
31776
31310
  function calculateJupLendTotalAssets(lendingState, fTokenTotalSupply) {
31777
31311
  return lendingState.tokenExchangePrice.mul(fTokenTotalSupply).div(JUP_EXCHANGE_PRICES_PRECISION);
31778
31312
  }
31779
31313
  function calculateJupLendRewardsRate(rewardsModel, totalAssets, currentTimestamp) {
31780
31314
  const defaultResult = {
31781
- rewardsRate: new BN2(0),
31315
+ rewardsRate: new BN5(0),
31782
31316
  rewardsEnded: false,
31783
31317
  rewardsStartTime: rewardsModel.startTime
31784
31318
  };
@@ -31791,7 +31325,7 @@ function calculateJupLendRewardsRate(rewardsModel, totalAssets, currentTimestamp
31791
31325
  if (totalAssets.lt(rewardsModel.startTvl)) {
31792
31326
  return defaultResult;
31793
31327
  }
31794
- let rewardsRate = rewardsModel.yearlyReward.mul(new BN2(1e4)).div(totalAssets);
31328
+ let rewardsRate = rewardsModel.yearlyReward.mul(new BN5(1e4)).div(totalAssets);
31795
31329
  if (rewardsRate.gt(JUP_MAX_REWARDS_RATE)) {
31796
31330
  rewardsRate = JUP_MAX_REWARDS_RATE;
31797
31331
  }
@@ -31802,7 +31336,7 @@ function calculateJupLendRewardsRate(rewardsModel, totalAssets, currentTimestamp
31802
31336
  };
31803
31337
  }
31804
31338
  function calculateJupLendRewardsRateForExchangePrice(rewardsModel, totalAssets, currentTimestamp) {
31805
- const defaultResult = { rate: new BN2(0), rewardsStartTime: rewardsModel.startTime };
31339
+ const defaultResult = { rate: new BN5(0), rewardsStartTime: rewardsModel.startTime };
31806
31340
  if (rewardsModel.startTime.isZero() || rewardsModel.duration.isZero()) {
31807
31341
  return defaultResult;
31808
31342
  }
@@ -31822,7 +31356,7 @@ function calculateJupLendNewExchangePrice(lendingState, tokenReserve, rewardsMod
31822
31356
  const oldTokenExchangePrice = lendingState.tokenExchangePrice;
31823
31357
  const oldLiquidityExchangePrice = lendingState.liquidityExchangePrice;
31824
31358
  const currentLiquidityExchangePrice = tokenReserve.supplyExchangePrice;
31825
- let rewardsRate = new BN2(0);
31359
+ let rewardsRate = new BN5(0);
31826
31360
  let rewardsStartTime = lendingState.lastUpdateTimestamp;
31827
31361
  if (rewardsModel) {
31828
31362
  const totalAssets = calculateJupLendTotalAssets(lendingState, fTokenTotalSupply);
@@ -31839,32 +31373,32 @@ function calculateJupLendNewExchangePrice(lendingState, tokenReserve, rewardsMod
31839
31373
  lastUpdateTime = rewardsStartTime;
31840
31374
  }
31841
31375
  const secondsElapsed = currentTimestamp.sub(lastUpdateTime);
31842
- let totalReturnPercent = rewardsRate.mul(secondsElapsed).div(JUP_SECONDS_PER_YEAR).mul(new BN2(100));
31376
+ let totalReturnPercent = rewardsRate.mul(secondsElapsed).div(JUP_SECONDS_PER_YEAR).mul(new BN5(100));
31843
31377
  const delta = currentLiquidityExchangePrice.sub(oldLiquidityExchangePrice);
31844
31378
  totalReturnPercent = totalReturnPercent.add(
31845
- delta.mul(new BN2(1e14)).div(oldLiquidityExchangePrice)
31379
+ delta.mul(new BN5(1e14)).div(oldLiquidityExchangePrice)
31846
31380
  );
31847
- return oldTokenExchangePrice.add(oldTokenExchangePrice.mul(totalReturnPercent).div(new BN2(1e14)));
31381
+ return oldTokenExchangePrice.add(oldTokenExchangePrice.mul(totalReturnPercent).div(new BN5(1e14)));
31848
31382
  }
31849
31383
  function calculateJupLendLiquiditySupplyRate(tokenReserve) {
31850
- const borrowRate = new BN2(tokenReserve.borrowRate);
31851
- const fee = new BN2(tokenReserve.feeOnInterest);
31384
+ const borrowRate = new BN5(tokenReserve.borrowRate);
31385
+ const fee = new BN5(tokenReserve.feeOnInterest);
31852
31386
  if (tokenReserve.totalSupplyWithInterest.isZero()) {
31853
- return new BN2(0);
31387
+ return new BN5(0);
31854
31388
  }
31855
31389
  const borrowWithInterestForRate = tokenReserve.totalBorrowWithInterest.mul(tokenReserve.borrowExchangePrice).div(JUP_EXCHANGE_PRICES_PRECISION);
31856
31390
  const supplyWithInterestForRate = tokenReserve.totalSupplyWithInterest.mul(tokenReserve.supplyExchangePrice).div(JUP_EXCHANGE_PRICES_PRECISION);
31857
31391
  if (supplyWithInterestForRate.isZero()) {
31858
- return new BN2(0);
31392
+ return new BN5(0);
31859
31393
  }
31860
- return borrowRate.mul(new BN2(1e4).sub(fee)).mul(borrowWithInterestForRate).div(supplyWithInterestForRate.mul(new BN2(1e4)));
31394
+ return borrowRate.mul(new BN5(1e4).sub(fee)).mul(borrowWithInterestForRate).div(supplyWithInterestForRate.mul(new BN5(1e4)));
31861
31395
  }
31862
31396
  function calculateJupLendSupplyRate(lendingState, tokenReserve, rewardsModel, fTokenTotalSupply) {
31863
31397
  const supplyRate = calculateJupLendLiquiditySupplyRate(tokenReserve);
31864
31398
  let totalRateBps = supplyRate.toNumber();
31865
31399
  if (rewardsModel) {
31866
31400
  const totalAssets = calculateJupLendTotalAssets(lendingState, fTokenTotalSupply);
31867
- const currentTimestamp = new BN2(Math.floor(Date.now() / 1e3));
31401
+ const currentTimestamp = new BN5(Math.floor(Date.now() / 1e3));
31868
31402
  const { rewardsRate } = calculateJupLendRewardsRate(
31869
31403
  rewardsModel,
31870
31404
  totalAssets,
@@ -31951,13 +31485,13 @@ function generateJupLendSupplyCurve(rateModel, feeOnInterest) {
31951
31485
  function getJupLendRewards(lendingState, rewardsModel, fTokenTotalSupply) {
31952
31486
  if (lendingState.rewardsRateModel.equals(PublicKey.default)) {
31953
31487
  return {
31954
- rewardsRate: new BN2(0),
31488
+ rewardsRate: new BN5(0),
31955
31489
  rewardsEnded: false,
31956
- rewardsStartTime: new BN2(0)
31490
+ rewardsStartTime: new BN5(0)
31957
31491
  };
31958
31492
  }
31959
31493
  const totalAssets = calculateJupLendTotalAssets(lendingState, fTokenTotalSupply);
31960
- const currentTimestamp = new BN2(Math.floor(Date.now() / 1e3));
31494
+ const currentTimestamp = new BN5(Math.floor(Date.now() / 1e3));
31961
31495
  return calculateJupLendRewardsRate(rewardsModel, totalAssets, currentTimestamp);
31962
31496
  }
31963
31497
  var UPDATE_RATE_DISCRIMINATOR = Buffer.from([
@@ -45540,7 +45074,7 @@ function exponentNumberToBigNumber(raw) {
45540
45074
  let value = new BigNumber(0);
45541
45075
  const TWO_64 = new BigNumber(2).pow(64);
45542
45076
  words.forEach((w, i) => {
45543
- const word = new BigNumber(BN2.isBN(w) ? w.toString() : String(w));
45077
+ const word = new BigNumber(BN5.isBN(w) ? w.toString() : String(w));
45544
45078
  value = value.plus(word.times(TWO_64.pow(i)));
45545
45079
  });
45546
45080
  return value.div(EXPONENT_NUMBER_DENOM);
@@ -45551,7 +45085,7 @@ function pk(v) {
45551
45085
  function decodeExponentVault(data) {
45552
45086
  const d = EXPONENT_ACCOUNTS_CODER.decode("Vault", data);
45553
45087
  const get = (snake, camel) => d[snake] ?? d[camel];
45554
- const u646 = (v) => BigInt(BN2.isBN(v) ? v.toString() : String(v ?? 0));
45088
+ const u646 = (v) => BigInt(BN5.isBN(v) ? v.toString() : String(v ?? 0));
45555
45089
  const cpi = get("cpi_accounts", "cpiAccounts") ?? {};
45556
45090
  return {
45557
45091
  authority: pk(get("authority", "authority")),
@@ -46240,6 +45774,6 @@ async function resolveExponentWrapperMergeContext(params) {
46240
45774
  };
46241
45775
  }
46242
45776
 
46243
- export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, AccountLayout, AccountState, AccountType, ConnectionClosed, CorpAction, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, DriftSpotBalanceType, 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, ErrorResponse, ExponentSwapDirection, ExtensionType, FARMS_PROGRAM_ID, 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, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, LENGTH_SIZE, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, MintLayout, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, PriceStatus, PriceType, REFRESH_OBLIGATION_DISCRIMINATOR, 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, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, SinglePoolInstruction, SplAccountType, SpotBalanceType, StreamError, SwapMode, SwapVersion, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, TokenAccountNotFoundError, TokenError, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, 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, decodeSwitchboardPullFeedData, 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, getSwitchboardProgram, initializeAccountInstructionData, initializeStakedPoolIxs, initializeStakedPoolTx, instructionToTitanWire, interpolateLinear, isJitoDontFront, isSpotBalanceTypeVariant, jupLendingRewardsRateModelRawToDto, jupLendingStateRawToDto, jupRateModelRawToDto, jupTokenReserveRawToDto, layout, lutToTitanWire, makeExponentClmmTradePtIx, makeExponentMergeIx, makeExponentStripIx, makeExponentTradePtIx, makeExponentWrapperMergeIx, makeRefreshObligationIx, makeRefreshReservesBatchIx, makeRefreshingIxs, makeSplStakePoolUpdateBalanceIx, makeUpdateJupLendRate, makeUpdateJupLendRateIx, makeUpdateSpotMarketCumulativeInterestIx, makeUpdateSpotMarketIx, obligationRawToDto, parsePriceData, parsePriceInfo2 as parsePriceInfo, replenishPoolIx, reserveRawToDto, resolveExponentClmmTradePtContext, resolveExponentMergeContext, resolveExponentStripContext, resolveExponentTradePtContext, resolveExponentWrapperMergeContext, resolveLookupTables, scaledSupplies, selectBestRoute, selectGatewayRoute, slotAdjustmentFactor, switchboardAccountCoder, syncNativeInstructionData, transferCheckedInstructionData, truncateBorrowCurve, unpackAccount };
45777
+ export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, AccountLayout, AccountState, AccountType, ConnectionClosed, CorpAction, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, DriftSpotBalanceType, 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, ErrorResponse, ExponentSwapDirection, ExtensionType, FARMS_PROGRAM_ID, 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, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, LENGTH_SIZE, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, MintLayout, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, PriceStatus, PriceType, REFRESH_OBLIGATION_DISCRIMINATOR, 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, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, SinglePoolInstruction, SplAccountType, SpotBalanceType, StreamError, SwapMode, SwapVersion, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, TokenAccountNotFoundError, TokenError, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, 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, decodeSwitchboardPullFeedData, 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, getSwitchboardProgram, initializeAccountInstructionData, initializeStakedPoolIxs, initializeStakedPoolTx, instructionToTitanWire, interpolateLinear, isJitoDontFront, isSpotBalanceTypeVariant, jupLendingRewardsRateModelRawToDto, jupLendingStateRawToDto, jupRateModelRawToDto, jupTokenReserveRawToDto, kaminoFarmStateToDto, kaminoObligationToDto, kaminoReserveToDto, layout, lutToTitanWire, makeExponentClmmTradePtIx, makeExponentMergeIx, makeExponentStripIx, makeExponentTradePtIx, makeExponentWrapperMergeIx, makeRefreshObligationIx, makeRefreshReservesBatchIx, makeRefreshingIxs, makeSplStakePoolUpdateBalanceIx, makeUpdateJupLendRate, makeUpdateJupLendRateIx, makeUpdateSpotMarketCumulativeInterestIx, makeUpdateSpotMarketIx, parsePriceData, parsePriceInfo2 as parsePriceInfo, replenishPoolIx, resolveExponentClmmTradePtContext, resolveExponentMergeContext, resolveExponentStripContext, resolveExponentTradePtContext, resolveExponentWrapperMergeContext, resolveLookupTables, scaledSupplies, selectBestRoute, selectGatewayRoute, slotAdjustmentFactor, switchboardAccountCoder, syncNativeInstructionData, transferCheckedInstructionData, truncateBorrowCurve, unpackAccount };
46244
45778
  //# sourceMappingURL=vendor.js.map
46245
45779
  //# sourceMappingURL=vendor.js.map