@kestrelfi/lyc-sdk 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +11 -0
- package/README.md +207 -0
- package/dist/sdks/long-yield-carry/scripts/asyncBurn.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/asyncBurn.js +117 -0
- package/dist/sdks/long-yield-carry/scripts/burnToken.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/burnToken.js +98 -0
- package/dist/sdks/long-yield-carry/scripts/claimIncentives.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/claimIncentives.js +108 -0
- package/dist/sdks/long-yield-carry/scripts/closeCpiPlans.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/closeCpiPlans.js +93 -0
- package/dist/sdks/long-yield-carry/scripts/collectInterest.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/collectInterest.js +164 -0
- package/dist/sdks/long-yield-carry/scripts/collectProtocolFees.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/collectProtocolFees.js +120 -0
- package/dist/sdks/long-yield-carry/scripts/computeOptimalAllocations.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/computeOptimalAllocations.js +84 -0
- package/dist/sdks/long-yield-carry/scripts/createToken.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/createToken.js +76 -0
- package/dist/sdks/long-yield-carry/scripts/createTokenLendingPosition.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/createTokenLendingPosition.js +157 -0
- package/dist/sdks/long-yield-carry/scripts/createYieldingBank.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/createYieldingBank.js +69 -0
- package/dist/sdks/long-yield-carry/scripts/decreaseCarryPositions.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/decreaseCarryPositions.js +247 -0
- package/dist/sdks/long-yield-carry/scripts/depositUnlentCollateral.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/depositUnlentCollateral.js +90 -0
- package/dist/sdks/long-yield-carry/scripts/emergency/deleverageAll.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/emergency/deleverageAll.js +202 -0
- package/dist/sdks/long-yield-carry/scripts/emergency/triggerCircuitBreaker.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/emergency/triggerCircuitBreaker.js +68 -0
- package/dist/sdks/long-yield-carry/scripts/env.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/env.js +8 -0
- package/dist/sdks/long-yield-carry/scripts/findTxs.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/findTxs.js +143 -0
- package/dist/sdks/long-yield-carry/scripts/increaseCarryPositions.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/increaseCarryPositions.js +112 -0
- package/dist/sdks/long-yield-carry/scripts/inspect/format.d.ts +13 -0
- package/dist/sdks/long-yield-carry/scripts/inspect/format.js +363 -0
- package/dist/sdks/long-yield-carry/scripts/inspect.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/inspect.js +108 -0
- package/dist/sdks/long-yield-carry/scripts/localUtils.d.ts +53 -0
- package/dist/sdks/long-yield-carry/scripts/localUtils.js +191 -0
- package/dist/sdks/long-yield-carry/scripts/mintToken.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/mintToken.js +103 -0
- package/dist/sdks/long-yield-carry/scripts/processAsyncBurns.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/processAsyncBurns.js +76 -0
- package/dist/sdks/long-yield-carry/scripts/rebalanceToken.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/rebalanceToken.js +210 -0
- package/dist/sdks/long-yield-carry/scripts/rebalanceYieldingBank.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/rebalanceYieldingBank.js +149 -0
- package/dist/sdks/long-yield-carry/scripts/recollateralizeLoss.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/recollateralizeLoss.js +64 -0
- package/dist/sdks/long-yield-carry/scripts/refresh.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/refresh.js +101 -0
- package/dist/sdks/long-yield-carry/scripts/updateFees.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/updateFees.js +369 -0
- package/dist/sdks/long-yield-carry/scripts/updateGeneralLut.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/updateGeneralLut.js +27 -0
- package/dist/sdks/long-yield-carry/scripts/updateLendingPositionConfig.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/updateLendingPositionConfig.js +127 -0
- package/dist/sdks/long-yield-carry/scripts/updateTokenLuts.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/updateTokenLuts.js +27 -0
- package/dist/sdks/long-yield-carry/scripts/updateTokenMetadata.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/updateTokenMetadata.js +194 -0
- package/dist/sdks/long-yield-carry/scripts/updateYieldingBankConfig.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/updateYieldingBankConfig.js +84 -0
- package/dist/sdks/long-yield-carry/scripts/withdrawUnlentCollateral.d.ts +1 -0
- package/dist/sdks/long-yield-carry/scripts/withdrawUnlentCollateral.js +140 -0
- package/dist/sdks/long-yield-carry/src/client/account.d.ts +152 -0
- package/dist/sdks/long-yield-carry/src/client/account.js +349 -0
- package/dist/sdks/long-yield-carry/src/client/builders/args.d.ts +299 -0
- package/dist/sdks/long-yield-carry/src/client/builders/args.js +2 -0
- package/dist/sdks/long-yield-carry/src/client/builders/asyncBurnBuilder.d.ts +20 -0
- package/dist/sdks/long-yield-carry/src/client/builders/asyncBurnBuilder.js +212 -0
- package/dist/sdks/long-yield-carry/src/client/builders/base.d.ts +77 -0
- package/dist/sdks/long-yield-carry/src/client/builders/base.js +191 -0
- package/dist/sdks/long-yield-carry/src/client/builders/burnTokenBuilder.d.ts +18 -0
- package/dist/sdks/long-yield-carry/src/client/builders/burnTokenBuilder.js +165 -0
- package/dist/sdks/long-yield-carry/src/client/builders/claimIncentivesBuilder.d.ts +9 -0
- package/dist/sdks/long-yield-carry/src/client/builders/claimIncentivesBuilder.js +135 -0
- package/dist/sdks/long-yield-carry/src/client/builders/collectFeesBuilder.d.ts +14 -0
- package/dist/sdks/long-yield-carry/src/client/builders/collectFeesBuilder.js +50 -0
- package/dist/sdks/long-yield-carry/src/client/builders/collectInterestBuilder.d.ts +8 -0
- package/dist/sdks/long-yield-carry/src/client/builders/collectInterestBuilder.js +86 -0
- package/dist/sdks/long-yield-carry/src/client/builders/createCpiPlanBuilder.d.ts +6 -0
- package/dist/sdks/long-yield-carry/src/client/builders/createCpiPlanBuilder.js +22 -0
- package/dist/sdks/long-yield-carry/src/client/builders/createTokenBuilder.d.ts +7 -0
- package/dist/sdks/long-yield-carry/src/client/builders/createTokenBuilder.js +64 -0
- package/dist/sdks/long-yield-carry/src/client/builders/createTokenLendingPositionBuilder.d.ts +10 -0
- package/dist/sdks/long-yield-carry/src/client/builders/createTokenLendingPositionBuilder.js +138 -0
- package/dist/sdks/long-yield-carry/src/client/builders/createYieldingBankAllocationBuilder.d.ts +7 -0
- package/dist/sdks/long-yield-carry/src/client/builders/createYieldingBankAllocationBuilder.js +29 -0
- package/dist/sdks/long-yield-carry/src/client/builders/createYieldingBankBuilder.d.ts +7 -0
- package/dist/sdks/long-yield-carry/src/client/builders/createYieldingBankBuilder.js +39 -0
- package/dist/sdks/long-yield-carry/src/client/builders/decreaseCarryPositionBuilder.d.ts +30 -0
- package/dist/sdks/long-yield-carry/src/client/builders/decreaseCarryPositionBuilder.js +99 -0
- package/dist/sdks/long-yield-carry/src/client/builders/depositUnlentCollateralBuilder.d.ts +8 -0
- package/dist/sdks/long-yield-carry/src/client/builders/depositUnlentCollateralBuilder.js +64 -0
- package/dist/sdks/long-yield-carry/src/client/builders/increaseCarryPositionBuilder.d.ts +8 -0
- package/dist/sdks/long-yield-carry/src/client/builders/increaseCarryPositionBuilder.js +73 -0
- package/dist/sdks/long-yield-carry/src/client/builders/index.d.ts +28 -0
- package/dist/sdks/long-yield-carry/src/client/builders/index.js +62 -0
- package/dist/sdks/long-yield-carry/src/client/builders/mintTokenBuilder.d.ts +8 -0
- package/dist/sdks/long-yield-carry/src/client/builders/mintTokenBuilder.js +95 -0
- package/dist/sdks/long-yield-carry/src/client/builders/rebalanceTokenBuilder.d.ts +11 -0
- package/dist/sdks/long-yield-carry/src/client/builders/rebalanceTokenBuilder.js +255 -0
- package/dist/sdks/long-yield-carry/src/client/builders/rebalanceYieldingBankBuilder.d.ts +8 -0
- package/dist/sdks/long-yield-carry/src/client/builders/rebalanceYieldingBankBuilder.js +75 -0
- package/dist/sdks/long-yield-carry/src/client/builders/recollateralizeLossBuilder.d.ts +12 -0
- package/dist/sdks/long-yield-carry/src/client/builders/recollateralizeLossBuilder.js +220 -0
- package/dist/sdks/long-yield-carry/src/client/builders/refreshTokenStateBuilder.d.ts +9 -0
- package/dist/sdks/long-yield-carry/src/client/builders/refreshTokenStateBuilder.js +112 -0
- package/dist/sdks/long-yield-carry/src/client/builders/refreshTokensBuilder.d.ts +9 -0
- package/dist/sdks/long-yield-carry/src/client/builders/refreshTokensBuilder.js +59 -0
- package/dist/sdks/long-yield-carry/src/client/builders/refreshYieldingBankBuilder.d.ts +8 -0
- package/dist/sdks/long-yield-carry/src/client/builders/refreshYieldingBankBuilder.js +29 -0
- package/dist/sdks/long-yield-carry/src/client/builders/resetTokenBurnRateLimitBuilder.d.ts +7 -0
- package/dist/sdks/long-yield-carry/src/client/builders/resetTokenBurnRateLimitBuilder.js +19 -0
- package/dist/sdks/long-yield-carry/src/client/builders/setTokenCircuitBreakerBuilder.d.ts +11 -0
- package/dist/sdks/long-yield-carry/src/client/builders/setTokenCircuitBreakerBuilder.js +31 -0
- package/dist/sdks/long-yield-carry/src/client/builders/setYieldingBankCircuitBreakerBuilder.d.ts +8 -0
- package/dist/sdks/long-yield-carry/src/client/builders/setYieldingBankCircuitBreakerBuilder.js +28 -0
- package/dist/sdks/long-yield-carry/src/client/builders/updateLendingPositionConfigBuilder.d.ts +10 -0
- package/dist/sdks/long-yield-carry/src/client/builders/updateLendingPositionConfigBuilder.js +30 -0
- package/dist/sdks/long-yield-carry/src/client/builders/updateTokenConfigurationBuilder.d.ts +11 -0
- package/dist/sdks/long-yield-carry/src/client/builders/updateTokenConfigurationBuilder.js +47 -0
- package/dist/sdks/long-yield-carry/src/client/builders/updateTokenMetadataBuilder.d.ts +7 -0
- package/dist/sdks/long-yield-carry/src/client/builders/updateTokenMetadataBuilder.js +24 -0
- package/dist/sdks/long-yield-carry/src/client/builders/updateYieldingBankConfigBuilder.d.ts +10 -0
- package/dist/sdks/long-yield-carry/src/client/builders/updateYieldingBankConfigBuilder.js +31 -0
- package/dist/sdks/long-yield-carry/src/client/builders/utils.d.ts +4 -0
- package/dist/sdks/long-yield-carry/src/client/builders/utils.js +20 -0
- package/dist/sdks/long-yield-carry/src/client/client.d.ts +115 -0
- package/dist/sdks/long-yield-carry/src/client/client.js +166 -0
- package/dist/sdks/long-yield-carry/src/client/externalLiquidityResolver.d.ts +13 -0
- package/dist/sdks/long-yield-carry/src/client/externalLiquidityResolver.js +34 -0
- package/dist/sdks/long-yield-carry/src/client/index.d.ts +10 -0
- package/dist/sdks/long-yield-carry/src/client/index.js +33 -0
- package/dist/sdks/long-yield-carry/src/client/lendingPlatformClients.d.ts +19 -0
- package/dist/sdks/long-yield-carry/src/client/lendingPlatformClients.js +33 -0
- package/dist/sdks/long-yield-carry/src/client/pda.d.ts +33 -0
- package/dist/sdks/long-yield-carry/src/client/pda.js +79 -0
- package/dist/sdks/long-yield-carry/src/client/plans/collectInterest.d.ts +24 -0
- package/dist/sdks/long-yield-carry/src/client/plans/collectInterest.js +150 -0
- package/dist/sdks/long-yield-carry/src/client/plans/decreaseCarryPosition.d.ts +12 -0
- package/dist/sdks/long-yield-carry/src/client/plans/decreaseCarryPosition.js +140 -0
- package/dist/sdks/long-yield-carry/src/client/routes/collectInterest.d.ts +13 -0
- package/dist/sdks/long-yield-carry/src/client/routes/collectInterest.js +39 -0
- package/dist/sdks/long-yield-carry/src/client/transaction.d.ts +41 -0
- package/dist/sdks/long-yield-carry/src/client/transaction.js +55 -0
- package/dist/sdks/long-yield-carry/src/client/types/builders.d.ts +18 -0
- package/dist/sdks/long-yield-carry/src/client/types/builders.js +2 -0
- package/dist/sdks/long-yield-carry/src/client/types/enums.d.ts +22 -0
- package/dist/sdks/long-yield-carry/src/client/types/enums.js +48 -0
- package/dist/sdks/long-yield-carry/src/client/types/general.d.ts +98 -0
- package/dist/sdks/long-yield-carry/src/client/types/general.js +2 -0
- package/dist/sdks/long-yield-carry/src/client/types/index.d.ts +6 -0
- package/dist/sdks/long-yield-carry/src/client/types/index.js +22 -0
- package/dist/sdks/long-yield-carry/src/client/types/ix.d.ts +352 -0
- package/dist/sdks/long-yield-carry/src/client/types/ix.js +2 -0
- package/dist/sdks/long-yield-carry/src/client/types/planTypes/collectInterest.d.ts +91 -0
- package/dist/sdks/long-yield-carry/src/client/types/planTypes/collectInterest.js +2 -0
- package/dist/sdks/long-yield-carry/src/client/types/planTypes/common.d.ts +28 -0
- package/dist/sdks/long-yield-carry/src/client/types/planTypes/common.js +2 -0
- package/dist/sdks/long-yield-carry/src/client/types/planTypes/decreaseCarryPosition.d.ts +128 -0
- package/dist/sdks/long-yield-carry/src/client/types/planTypes/decreaseCarryPosition.js +2 -0
- package/dist/sdks/long-yield-carry/src/client/types/planTypes/index.d.ts +3 -0
- package/dist/sdks/long-yield-carry/src/client/types/planTypes/index.js +19 -0
- package/dist/sdks/long-yield-carry/src/client/types/tx.d.ts +339 -0
- package/dist/sdks/long-yield-carry/src/client/types/tx.js +2 -0
- package/dist/sdks/long-yield-carry/src/constants/configs/allocations.d.ts +3 -0
- package/dist/sdks/long-yield-carry/src/constants/configs/allocations.js +23 -0
- package/dist/sdks/long-yield-carry/src/constants/configs/carryTradePresets.d.ts +58 -0
- package/dist/sdks/long-yield-carry/src/constants/configs/carryTradePresets.js +116 -0
- package/dist/sdks/long-yield-carry/src/constants/configs/index.d.ts +2 -0
- package/dist/sdks/long-yield-carry/src/constants/configs/index.js +18 -0
- package/dist/sdks/long-yield-carry/src/constants/general.d.ts +70 -0
- package/dist/sdks/long-yield-carry/src/constants/general.js +107 -0
- package/dist/sdks/long-yield-carry/src/constants/index.d.ts +3 -0
- package/dist/sdks/long-yield-carry/src/constants/index.js +19 -0
- package/dist/sdks/long-yield-carry/src/constants/lycTokenMetadata.d.ts +36 -0
- package/dist/sdks/long-yield-carry/src/constants/lycTokenMetadata.js +41 -0
- package/dist/sdks/long-yield-carry/src/decoders/decodeTransaction.d.ts +86 -0
- package/dist/sdks/long-yield-carry/src/decoders/decodeTransaction.js +230 -0
- package/dist/sdks/long-yield-carry/src/decoders/discriminators.d.ts +8 -0
- package/dist/sdks/long-yield-carry/src/decoders/discriminators.js +11 -0
- package/dist/sdks/long-yield-carry/src/decoders/idlAccounts.d.ts +29 -0
- package/dist/sdks/long-yield-carry/src/decoders/idlAccounts.js +57 -0
- package/dist/sdks/long-yield-carry/src/decoders/index.d.ts +6 -0
- package/dist/sdks/long-yield-carry/src/decoders/index.js +14 -0
- package/dist/sdks/long-yield-carry/src/decoders/innerCpis.d.ts +68 -0
- package/dist/sdks/long-yield-carry/src/decoders/innerCpis.js +225 -0
- package/dist/sdks/long-yield-carry/src/decoders/lycInstructionNames.d.ts +6 -0
- package/dist/sdks/long-yield-carry/src/decoders/lycInstructionNames.js +73 -0
- package/dist/sdks/long-yield-carry/src/decoders/programIds.d.ts +4 -0
- package/dist/sdks/long-yield-carry/src/decoders/programIds.js +11 -0
- package/dist/sdks/long-yield-carry/src/decoders/solana.d.ts +7 -0
- package/dist/sdks/long-yield-carry/src/decoders/solana.js +30 -0
- package/dist/sdks/long-yield-carry/src/decoders/transactionPayload.d.ts +41 -0
- package/dist/sdks/long-yield-carry/src/decoders/transactionPayload.js +6 -0
- package/dist/sdks/long-yield-carry/src/decoders/types.d.ts +58 -0
- package/dist/sdks/long-yield-carry/src/decoders/types.js +2 -0
- package/dist/sdks/long-yield-carry/src/errors.d.ts +69 -0
- package/dist/sdks/long-yield-carry/src/errors.js +183 -0
- package/dist/sdks/long-yield-carry/src/idl/long_yield_carry.d.ts +7327 -0
- package/dist/sdks/long-yield-carry/src/idl/long_yield_carry.js +7323 -0
- package/dist/sdks/long-yield-carry/src/index.d.ts +10 -0
- package/dist/sdks/long-yield-carry/src/index.js +25 -0
- package/dist/sdks/long-yield-carry/src/metrics/index.d.ts +1 -0
- package/dist/sdks/long-yield-carry/src/metrics/index.js +17 -0
- package/dist/sdks/long-yield-carry/src/metrics/protocolMetrics.d.ts +276 -0
- package/dist/sdks/long-yield-carry/src/metrics/protocolMetrics.js +547 -0
- package/dist/sdks/long-yield-carry/src/models/index.d.ts +3 -0
- package/dist/sdks/long-yield-carry/src/models/index.js +7 -0
- package/dist/sdks/long-yield-carry/src/models/lycToken.d.ts +156 -0
- package/dist/sdks/long-yield-carry/src/models/lycToken.js +288 -0
- package/dist/sdks/long-yield-carry/src/models/yieldingBank.d.ts +52 -0
- package/dist/sdks/long-yield-carry/src/models/yieldingBank.js +109 -0
- package/dist/sdks/long-yield-carry/src/services/allocation/allocationService.d.ts +106 -0
- package/dist/sdks/long-yield-carry/src/services/allocation/allocationService.js +589 -0
- package/dist/sdks/long-yield-carry/src/services/allocation/index.d.ts +2 -0
- package/dist/sdks/long-yield-carry/src/services/allocation/index.js +18 -0
- package/dist/sdks/long-yield-carry/src/services/allocation/types.d.ts +25 -0
- package/dist/sdks/long-yield-carry/src/services/allocation/types.js +2 -0
- package/dist/sdks/long-yield-carry/src/services/carry/carryAllocationConfig.d.ts +103 -0
- package/dist/sdks/long-yield-carry/src/services/carry/carryAllocationConfig.js +146 -0
- package/dist/sdks/long-yield-carry/src/services/carry/index.d.ts +2 -0
- package/dist/sdks/long-yield-carry/src/services/carry/index.js +18 -0
- package/dist/sdks/long-yield-carry/src/services/carry/lycLendingPositionManager.d.ts +39 -0
- package/dist/sdks/long-yield-carry/src/services/carry/lycLendingPositionManager.js +100 -0
- package/dist/sdks/long-yield-carry/src/services/index.d.ts +5 -0
- package/dist/sdks/long-yield-carry/src/services/index.js +21 -0
- package/dist/sdks/long-yield-carry/src/services/lendingPosition/index.d.ts +2 -0
- package/dist/sdks/long-yield-carry/src/services/lendingPosition/index.js +5 -0
- package/dist/sdks/long-yield-carry/src/services/lendingPosition/lendingPositionService.d.ts +88 -0
- package/dist/sdks/long-yield-carry/src/services/lendingPosition/lendingPositionService.js +229 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/index.d.ts +2 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/index.js +18 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/token/index.d.ts +1 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/token/index.js +17 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/token/tokenRebalanceService.d.ts +51 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/token/tokenRebalanceService.js +99 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/index.d.ts +3 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/index.js +21 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/planner.d.ts +68 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/planner.js +181 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/strategy.d.ts +26 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/strategy.js +26 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/types.d.ts +40 -0
- package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/types.js +2 -0
- package/dist/sdks/long-yield-carry/src/services/redemption/index.d.ts +2 -0
- package/dist/sdks/long-yield-carry/src/services/redemption/index.js +5 -0
- package/dist/sdks/long-yield-carry/src/services/redemption/redemptionService.d.ts +139 -0
- package/dist/sdks/long-yield-carry/src/services/redemption/redemptionService.js +532 -0
- package/dist/sdks/long-yield-carry/src/types/enriched.d.ts +168 -0
- package/dist/sdks/long-yield-carry/src/types/enriched.js +2 -0
- package/dist/sdks/long-yield-carry/src/types/index.d.ts +1 -0
- package/dist/sdks/long-yield-carry/src/types/index.js +17 -0
- package/dist/sdks/long-yield-carry/src/utils/cache.d.ts +4 -0
- package/dist/sdks/long-yield-carry/src/utils/cache.js +10 -0
- package/dist/sdks/long-yield-carry/src/utils/data.d.ts +12 -0
- package/dist/sdks/long-yield-carry/src/utils/data.js +59 -0
- package/dist/sdks/long-yield-carry/src/utils/enrichment.d.ts +5 -0
- package/dist/sdks/long-yield-carry/src/utils/enrichment.js +244 -0
- package/dist/sdks/long-yield-carry/src/utils/feeDripMetrics.d.ts +36 -0
- package/dist/sdks/long-yield-carry/src/utils/feeDripMetrics.js +93 -0
- package/dist/sdks/long-yield-carry/src/utils/general.d.ts +28 -0
- package/dist/sdks/long-yield-carry/src/utils/general.js +47 -0
- package/dist/sdks/long-yield-carry/src/utils/index.d.ts +13 -0
- package/dist/sdks/long-yield-carry/src/utils/index.js +29 -0
- package/dist/sdks/long-yield-carry/src/utils/ix.d.ts +83 -0
- package/dist/sdks/long-yield-carry/src/utils/ix.js +165 -0
- package/dist/sdks/long-yield-carry/src/utils/lendingPosition.d.ts +68 -0
- package/dist/sdks/long-yield-carry/src/utils/lendingPosition.js +105 -0
- package/dist/sdks/long-yield-carry/src/utils/lookupTables.d.ts +55 -0
- package/dist/sdks/long-yield-carry/src/utils/lookupTables.js +216 -0
- package/dist/sdks/long-yield-carry/src/utils/lycData.d.ts +66 -0
- package/dist/sdks/long-yield-carry/src/utils/lycData.js +211 -0
- package/dist/sdks/long-yield-carry/src/utils/timelock.d.ts +19 -0
- package/dist/sdks/long-yield-carry/src/utils/timelock.js +37 -0
- package/dist/sdks/long-yield-carry/src/utils/tokenFeeMath.d.ts +11 -0
- package/dist/sdks/long-yield-carry/src/utils/tokenFeeMath.js +24 -0
- package/dist/sdks/long-yield-carry/src/utils/transactions.d.ts +20 -0
- package/dist/sdks/long-yield-carry/src/utils/transactions.js +72 -0
- package/dist/sdks/long-yield-carry/src/utils/yieldingBank.d.ts +24 -0
- package/dist/sdks/long-yield-carry/src/utils/yieldingBank.js +36 -0
- package/dist/shared/common/src/constants/accountMetas.d.ts +3 -0
- package/dist/shared/common/src/constants/accountMetas.js +9 -0
- package/dist/shared/common/src/constants/general.d.ts +21 -0
- package/dist/shared/common/src/constants/general.js +30 -0
- package/dist/shared/common/src/constants/generated/cpi.d.ts +23 -0
- package/dist/shared/common/src/constants/generated/cpi.js +28 -0
- package/dist/shared/common/src/constants/generated/index.d.ts +1 -0
- package/dist/shared/common/src/constants/generated/index.js +17 -0
- package/dist/shared/common/src/constants/index.d.ts +3 -0
- package/dist/shared/common/src/constants/index.js +19 -0
- package/dist/shared/common/src/index.d.ts +4 -0
- package/dist/shared/common/src/index.js +20 -0
- package/dist/shared/common/src/services/baseAccountClient.d.ts +22 -0
- package/dist/shared/common/src/services/baseAccountClient.js +38 -0
- package/dist/shared/common/src/services/baseIxBuilderService.d.ts +27 -0
- package/dist/shared/common/src/services/baseIxBuilderService.js +48 -0
- package/dist/shared/common/src/services/dataCache.d.ts +41 -0
- package/dist/shared/common/src/services/dataCache.js +130 -0
- package/dist/shared/common/src/services/index.d.ts +8 -0
- package/dist/shared/common/src/services/index.js +24 -0
- package/dist/shared/common/src/services/lutManager.d.ts +31 -0
- package/dist/shared/common/src/services/lutManager.js +133 -0
- package/dist/shared/common/src/services/mints/defaults.d.ts +2 -0
- package/dist/shared/common/src/services/mints/defaults.js +152 -0
- package/dist/shared/common/src/services/mints/index.d.ts +4 -0
- package/dist/shared/common/src/services/mints/index.js +20 -0
- package/dist/shared/common/src/services/mints/registry.d.ts +70 -0
- package/dist/shared/common/src/services/mints/registry.js +117 -0
- package/dist/shared/common/src/services/mints/symbols.d.ts +6 -0
- package/dist/shared/common/src/services/mints/symbols.js +13 -0
- package/dist/shared/common/src/services/mints/types.d.ts +30 -0
- package/dist/shared/common/src/services/mints/types.js +2 -0
- package/dist/shared/common/src/services/swap/index.d.ts +4 -0
- package/dist/shared/common/src/services/swap/index.js +20 -0
- package/dist/shared/common/src/services/swap/routableSwapClient.d.ts +36 -0
- package/dist/shared/common/src/services/swap/routableSwapClient.js +2 -0
- package/dist/shared/common/src/services/swap/swapClientBase.d.ts +45 -0
- package/dist/shared/common/src/services/swap/swapClientBase.js +2 -0
- package/dist/shared/common/src/services/swap/swapRouting.d.ts +13 -0
- package/dist/shared/common/src/services/swap/swapRouting.js +28 -0
- package/dist/shared/common/src/services/swap/types.d.ts +77 -0
- package/dist/shared/common/src/services/swap/types.js +2 -0
- package/dist/shared/common/src/services/token/index.d.ts +2 -0
- package/dist/shared/common/src/services/token/index.js +18 -0
- package/dist/shared/common/src/services/token/tokenProtocolClientBase.d.ts +51 -0
- package/dist/shared/common/src/services/token/tokenProtocolClientBase.js +2 -0
- package/dist/shared/common/src/services/token/types.d.ts +19 -0
- package/dist/shared/common/src/services/token/types.js +2 -0
- package/dist/shared/common/src/services/transactionSender.d.ts +24 -0
- package/dist/shared/common/src/services/transactionSender.js +30 -0
- package/dist/shared/common/src/types/cpi.d.ts +34 -0
- package/dist/shared/common/src/types/cpi.js +8 -0
- package/dist/shared/common/src/types/enums.d.ts +59 -0
- package/dist/shared/common/src/types/enums.js +122 -0
- package/dist/shared/common/src/types/general.d.ts +38 -0
- package/dist/shared/common/src/types/general.js +2 -0
- package/dist/shared/common/src/types/index.d.ts +4 -0
- package/dist/shared/common/src/types/index.js +20 -0
- package/dist/shared/common/src/types/solana.d.ts +24 -0
- package/dist/shared/common/src/types/solana.js +2 -0
- package/dist/shared/common/src/utils/accounts/index.d.ts +5 -0
- package/dist/shared/common/src/utils/accounts/index.js +21 -0
- package/dist/shared/common/src/utils/accounts/meta.d.ts +21 -0
- package/dist/shared/common/src/utils/accounts/meta.js +27 -0
- package/dist/shared/common/src/utils/accounts/pda.d.ts +2 -0
- package/dist/shared/common/src/utils/accounts/pda.js +17 -0
- package/dist/shared/common/src/utils/accounts/roles.d.ts +26 -0
- package/dist/shared/common/src/utils/accounts/roles.js +54 -0
- package/dist/shared/common/src/utils/accounts/rpc.d.ts +8 -0
- package/dist/shared/common/src/utils/accounts/rpc.js +30 -0
- package/dist/shared/common/src/utils/accounts/splBalances.d.ts +15 -0
- package/dist/shared/common/src/utils/accounts/splBalances.js +52 -0
- package/dist/shared/common/src/utils/anchor.d.ts +17 -0
- package/dist/shared/common/src/utils/anchor.js +29 -0
- package/dist/shared/common/src/utils/asyncConcurrency.d.ts +5 -0
- package/dist/shared/common/src/utils/asyncConcurrency.js +28 -0
- package/dist/shared/common/src/utils/compat.d.ts +46 -0
- package/dist/shared/common/src/utils/compat.js +72 -0
- package/dist/shared/common/src/utils/cpi/args.d.ts +69 -0
- package/dist/shared/common/src/utils/cpi/args.js +100 -0
- package/dist/shared/common/src/utils/cpi/index.d.ts +2 -0
- package/dist/shared/common/src/utils/cpi/index.js +18 -0
- package/dist/shared/common/src/utils/cpi/refs.d.ts +122 -0
- package/dist/shared/common/src/utils/cpi/refs.js +234 -0
- package/dist/shared/common/src/utils/data.d.ts +20 -0
- package/dist/shared/common/src/utils/data.js +27 -0
- package/dist/shared/common/src/utils/general.d.ts +24 -0
- package/dist/shared/common/src/utils/general.js +95 -0
- package/dist/shared/common/src/utils/index.d.ts +22 -0
- package/dist/shared/common/src/utils/index.js +38 -0
- package/dist/shared/common/src/utils/instruction.d.ts +74 -0
- package/dist/shared/common/src/utils/instruction.js +147 -0
- package/dist/shared/common/src/utils/jito.d.ts +113 -0
- package/dist/shared/common/src/utils/jito.js +178 -0
- package/dist/shared/common/src/utils/json.d.ts +5 -0
- package/dist/shared/common/src/utils/json.js +25 -0
- package/dist/shared/common/src/utils/jsonRpcFetch.d.ts +21 -0
- package/dist/shared/common/src/utils/jsonRpcFetch.js +134 -0
- package/dist/shared/common/src/utils/metadata.d.ts +107 -0
- package/dist/shared/common/src/utils/metadata.js +194 -0
- package/dist/shared/common/src/utils/numbers.d.ts +72 -0
- package/dist/shared/common/src/utils/numbers.js +193 -0
- package/dist/shared/common/src/utils/priorityFee.d.ts +18 -0
- package/dist/shared/common/src/utils/priorityFee.js +63 -0
- package/dist/shared/common/src/utils/retry.d.ts +20 -0
- package/dist/shared/common/src/utils/retry.js +69 -0
- package/dist/shared/common/src/utils/rpc.d.ts +40 -0
- package/dist/shared/common/src/utils/rpc.js +130 -0
- package/dist/shared/common/src/utils/solana.d.ts +23 -0
- package/dist/shared/common/src/utils/solana.js +61 -0
- package/dist/shared/common/src/utils/timeSeries.d.ts +18 -0
- package/dist/shared/common/src/utils/timeSeries.js +40 -0
- package/dist/shared/common/src/utils/token.d.ts +33 -0
- package/dist/shared/common/src/utils/token.js +82 -0
- package/dist/shared/common/src/utils/transaction.d.ts +154 -0
- package/dist/shared/common/src/utils/transaction.js +585 -0
- package/dist/shared/common/src/utils/transactionSplitter.d.ts +85 -0
- package/dist/shared/common/src/utils/transactionSplitter.js +127 -0
- package/dist/shared/common/src/utils/txAccountCoverage.d.ts +49 -0
- package/dist/shared/common/src/utils/txAccountCoverage.js +122 -0
- package/dist/shared/jupiter-helpers/src/api.d.ts +59 -0
- package/dist/shared/jupiter-helpers/src/api.js +130 -0
- package/dist/shared/jupiter-helpers/src/client.d.ts +79 -0
- package/dist/shared/jupiter-helpers/src/client.js +173 -0
- package/dist/shared/jupiter-helpers/src/constants.d.ts +35 -0
- package/dist/shared/jupiter-helpers/src/constants.js +38 -0
- package/dist/shared/jupiter-helpers/src/extract.d.ts +30 -0
- package/dist/shared/jupiter-helpers/src/extract.js +57 -0
- package/dist/shared/jupiter-helpers/src/index.d.ts +5 -0
- package/dist/shared/jupiter-helpers/src/index.js +21 -0
- package/dist/shared/jupiter-helpers/src/routePreInstructions.d.ts +19 -0
- package/dist/shared/jupiter-helpers/src/routePreInstructions.js +61 -0
- package/dist/shared/jupiter-helpers/src/sizeExactInForMinOutput.d.ts +70 -0
- package/dist/shared/jupiter-helpers/src/sizeExactInForMinOutput.js +95 -0
- package/dist/shared/jupiter-helpers/src/types.d.ts +66 -0
- package/dist/shared/jupiter-helpers/src/types.js +2 -0
- package/dist/shared/lending-platforms/src/constants/cache.d.ts +8 -0
- package/dist/shared/lending-platforms/src/constants/cache.js +11 -0
- package/dist/shared/lending-platforms/src/constants/index.d.ts +3 -0
- package/dist/shared/lending-platforms/src/constants/index.js +19 -0
- package/dist/shared/lending-platforms/src/constants/kamino.d.ts +7 -0
- package/dist/shared/lending-platforms/src/constants/kamino.js +83 -0
- package/dist/shared/lending-platforms/src/constants/lendingPosition.d.ts +7 -0
- package/dist/shared/lending-platforms/src/constants/lendingPosition.js +10 -0
- package/dist/shared/lending-platforms/src/data/accounts/index.d.ts +2 -0
- package/dist/shared/lending-platforms/src/data/accounts/index.js +18 -0
- package/dist/shared/lending-platforms/src/data/accounts/kamino.d.ts +42 -0
- package/dist/shared/lending-platforms/src/data/accounts/kamino.js +104 -0
- package/dist/shared/lending-platforms/src/data/accounts/lpAccountsBase.d.ts +7 -0
- package/dist/shared/lending-platforms/src/data/accounts/lpAccountsBase.js +9 -0
- package/dist/shared/lending-platforms/src/data/incentive/incentiveBase.d.ts +35 -0
- package/dist/shared/lending-platforms/src/data/incentive/incentiveBase.js +26 -0
- package/dist/shared/lending-platforms/src/data/incentive/index.d.ts +2 -0
- package/dist/shared/lending-platforms/src/data/incentive/index.js +18 -0
- package/dist/shared/lending-platforms/src/data/incentive/kamino.d.ts +55 -0
- package/dist/shared/lending-platforms/src/data/incentive/kamino.js +101 -0
- package/dist/shared/lending-platforms/src/data/index.d.ts +6 -0
- package/dist/shared/lending-platforms/src/data/index.js +22 -0
- package/dist/shared/lending-platforms/src/data/instructions/index.d.ts +3 -0
- package/dist/shared/lending-platforms/src/data/instructions/index.js +19 -0
- package/dist/shared/lending-platforms/src/data/instructions/kamino.d.ts +55 -0
- package/dist/shared/lending-platforms/src/data/instructions/kamino.js +630 -0
- package/dist/shared/lending-platforms/src/data/instructions/lpInstructionsBase.d.ts +175 -0
- package/dist/shared/lending-platforms/src/data/instructions/lpInstructionsBase.js +192 -0
- package/dist/shared/lending-platforms/src/data/instructions/types.d.ts +7 -0
- package/dist/shared/lending-platforms/src/data/instructions/types.js +2 -0
- package/dist/shared/lending-platforms/src/data/platform/index.d.ts +2 -0
- package/dist/shared/lending-platforms/src/data/platform/index.js +18 -0
- package/dist/shared/lending-platforms/src/data/platform/kamino.d.ts +59 -0
- package/dist/shared/lending-platforms/src/data/platform/kamino.js +206 -0
- package/dist/shared/lending-platforms/src/data/platform/lpDataBase.d.ts +35 -0
- package/dist/shared/lending-platforms/src/data/platform/lpDataBase.js +31 -0
- package/dist/shared/lending-platforms/src/data/reserve/index.d.ts +2 -0
- package/dist/shared/lending-platforms/src/data/reserve/index.js +18 -0
- package/dist/shared/lending-platforms/src/data/reserve/kamino.d.ts +45 -0
- package/dist/shared/lending-platforms/src/data/reserve/kamino.js +141 -0
- package/dist/shared/lending-platforms/src/data/reserve/reserveBase.d.ts +114 -0
- package/dist/shared/lending-platforms/src/data/reserve/reserveBase.js +125 -0
- package/dist/shared/lending-platforms/src/data/userPosition/index.d.ts +2 -0
- package/dist/shared/lending-platforms/src/data/userPosition/index.js +18 -0
- package/dist/shared/lending-platforms/src/data/userPosition/kamino.d.ts +15 -0
- package/dist/shared/lending-platforms/src/data/userPosition/kamino.js +45 -0
- package/dist/shared/lending-platforms/src/data/userPosition/userPositionBase.d.ts +50 -0
- package/dist/shared/lending-platforms/src/data/userPosition/userPositionBase.js +63 -0
- package/dist/shared/lending-platforms/src/index.d.ts +5 -0
- package/dist/shared/lending-platforms/src/index.js +21 -0
- package/dist/shared/lending-platforms/src/services/client/index.d.ts +2 -0
- package/dist/shared/lending-platforms/src/services/client/index.js +18 -0
- package/dist/shared/lending-platforms/src/services/client/kamino.d.ts +53 -0
- package/dist/shared/lending-platforms/src/services/client/kamino.js +142 -0
- package/dist/shared/lending-platforms/src/services/client/lpClientBase.d.ts +66 -0
- package/dist/shared/lending-platforms/src/services/client/lpClientBase.js +19 -0
- package/dist/shared/lending-platforms/src/services/flashLoan/flashLoanBase.d.ts +49 -0
- package/dist/shared/lending-platforms/src/services/flashLoan/flashLoanBase.js +16 -0
- package/dist/shared/lending-platforms/src/services/flashLoan/index.d.ts +2 -0
- package/dist/shared/lending-platforms/src/services/flashLoan/index.js +18 -0
- package/dist/shared/lending-platforms/src/services/flashLoan/kamino.d.ts +11 -0
- package/dist/shared/lending-platforms/src/services/flashLoan/kamino.js +85 -0
- package/dist/shared/lending-platforms/src/services/index.d.ts +5 -0
- package/dist/shared/lending-platforms/src/services/index.js +21 -0
- package/dist/shared/lending-platforms/src/services/lendingPosition/index.d.ts +2 -0
- package/dist/shared/lending-platforms/src/services/lendingPosition/index.js +18 -0
- package/dist/shared/lending-platforms/src/services/lendingPosition/lendingPositionManager.d.ts +117 -0
- package/dist/shared/lending-platforms/src/services/lendingPosition/lendingPositionManager.js +342 -0
- package/dist/shared/lending-platforms/src/services/lendingPosition/types.d.ts +40 -0
- package/dist/shared/lending-platforms/src/services/lendingPosition/types.js +2 -0
- package/dist/shared/lending-platforms/src/services/leverage/index.d.ts +2 -0
- package/dist/shared/lending-platforms/src/services/leverage/index.js +18 -0
- package/dist/shared/lending-platforms/src/services/leverage/leverageService.d.ts +104 -0
- package/dist/shared/lending-platforms/src/services/leverage/leverageService.js +437 -0
- package/dist/shared/lending-platforms/src/services/leverage/types.d.ts +261 -0
- package/dist/shared/lending-platforms/src/services/leverage/types.js +2 -0
- package/dist/shared/lending-platforms/src/services/reservesManager.d.ts +53 -0
- package/dist/shared/lending-platforms/src/services/reservesManager.js +112 -0
- package/dist/shared/lending-platforms/src/types/general.d.ts +37 -0
- package/dist/shared/lending-platforms/src/types/general.js +8 -0
- package/dist/shared/lending-platforms/src/types/index.d.ts +2 -0
- package/dist/shared/lending-platforms/src/types/index.js +18 -0
- package/dist/shared/lending-platforms/src/types/kamino.d.ts +10 -0
- package/dist/shared/lending-platforms/src/types/kamino.js +2 -0
- package/dist/shared/lending-platforms/src/utils/accounts.d.ts +16 -0
- package/dist/shared/lending-platforms/src/utils/accounts.js +36 -0
- package/dist/shared/lending-platforms/src/utils/cache.d.ts +3 -0
- package/dist/shared/lending-platforms/src/utils/cache.js +11 -0
- package/dist/shared/lending-platforms/src/utils/index.d.ts +6 -0
- package/dist/shared/lending-platforms/src/utils/index.js +22 -0
- package/dist/shared/lending-platforms/src/utils/kamino.d.ts +87 -0
- package/dist/shared/lending-platforms/src/utils/kamino.js +190 -0
- package/dist/shared/lending-platforms/src/utils/lendingPlatform.d.ts +6 -0
- package/dist/shared/lending-platforms/src/utils/lendingPlatform.js +16 -0
- package/dist/shared/lending-platforms/src/utils/math.d.ts +47 -0
- package/dist/shared/lending-platforms/src/utils/math.js +123 -0
- package/dist/shared/lending-platforms/src/utils/scope.d.ts +38 -0
- package/dist/shared/lending-platforms/src/utils/scope.js +144 -0
- package/dist/shared/oracle-service/src/constants/index.d.ts +3 -0
- package/dist/shared/oracle-service/src/constants/index.js +19 -0
- package/dist/shared/oracle-service/src/constants/pyth.d.ts +7 -0
- package/dist/shared/oracle-service/src/constants/pyth.js +71 -0
- package/dist/shared/oracle-service/src/constants/splStake.d.ts +2 -0
- package/dist/shared/oracle-service/src/constants/splStake.js +6 -0
- package/dist/shared/oracle-service/src/constants/switchboard.d.ts +7 -0
- package/dist/shared/oracle-service/src/constants/switchboard.js +10 -0
- package/dist/shared/oracle-service/src/feeds/custom.d.ts +30 -0
- package/dist/shared/oracle-service/src/feeds/custom.js +56 -0
- package/dist/shared/oracle-service/src/feeds/jupiter.d.ts +7 -0
- package/dist/shared/oracle-service/src/feeds/jupiter.js +43 -0
- package/dist/shared/oracle-service/src/feeds/priceBase.d.ts +13 -0
- package/dist/shared/oracle-service/src/feeds/priceBase.js +25 -0
- package/dist/shared/oracle-service/src/feeds/pyth.d.ts +8 -0
- package/dist/shared/oracle-service/src/feeds/pyth.js +59 -0
- package/dist/shared/oracle-service/src/feeds/splStake.d.ts +26 -0
- package/dist/shared/oracle-service/src/feeds/splStake.js +99 -0
- package/dist/shared/oracle-service/src/feeds/switchboard.d.ts +6 -0
- package/dist/shared/oracle-service/src/feeds/switchboard.js +11 -0
- package/dist/shared/oracle-service/src/index.d.ts +5 -0
- package/dist/shared/oracle-service/src/index.js +26 -0
- package/dist/shared/oracle-service/src/oracle.d.ts +22 -0
- package/dist/shared/oracle-service/src/oracle.js +104 -0
- package/dist/shared/oracle-service/src/types.d.ts +4 -0
- package/dist/shared/oracle-service/src/types.js +2 -0
- package/dist/shared/oracle-service/src/utils/general.d.ts +20 -0
- package/dist/shared/oracle-service/src/utils/general.js +65 -0
- package/dist/shared/oracle-service/src/utils/index.d.ts +1 -0
- package/dist/shared/oracle-service/src/utils/index.js +17 -0
- package/dist/shared/perena-helpers/src/accounts.d.ts +7 -0
- package/dist/shared/perena-helpers/src/accounts.js +12 -0
- package/dist/shared/perena-helpers/src/client.d.ts +299 -0
- package/dist/shared/perena-helpers/src/client.js +680 -0
- package/dist/shared/perena-helpers/src/constants.d.ts +5 -0
- package/dist/shared/perena-helpers/src/constants.js +8 -0
- package/dist/shared/perena-helpers/src/cpi/burn.d.ts +27 -0
- package/dist/shared/perena-helpers/src/cpi/burn.js +22 -0
- package/dist/shared/perena-helpers/src/cpi/index.d.ts +3 -0
- package/dist/shared/perena-helpers/src/cpi/index.js +19 -0
- package/dist/shared/perena-helpers/src/cpi/mint.d.ts +27 -0
- package/dist/shared/perena-helpers/src/cpi/mint.js +22 -0
- package/dist/shared/perena-helpers/src/cpi/requestUnstake.d.ts +19 -0
- package/dist/shared/perena-helpers/src/cpi/requestUnstake.js +16 -0
- package/dist/shared/perena-helpers/src/index.d.ts +5 -0
- package/dist/shared/perena-helpers/src/index.js +21 -0
- package/dist/shared/perena-helpers/src/utils.d.ts +9 -0
- package/dist/shared/perena-helpers/src/utils.js +54 -0
- package/dist/shared/swap-aggregator/src/aggSwapClient.d.ts +71 -0
- package/dist/shared/swap-aggregator/src/aggSwapClient.js +103 -0
- package/dist/shared/swap-aggregator/src/index.d.ts +1 -0
- package/dist/shared/swap-aggregator/src/index.js +17 -0
- package/docs/launchingToken.md +57 -0
- package/package.json +75 -0
- package/scripts/asyncBurn.ts +155 -0
- package/scripts/burnToken.ts +120 -0
- package/scripts/claimIncentives.ts +125 -0
- package/scripts/closeCpiPlans.ts +113 -0
- package/scripts/collectInterest.ts +194 -0
- package/scripts/collectProtocolFees.ts +144 -0
- package/scripts/computeOptimalAllocations.ts +117 -0
- package/scripts/createToken.ts +100 -0
- package/scripts/createTokenLendingPosition.ts +204 -0
- package/scripts/createYieldingBank.ts +91 -0
- package/scripts/decreaseCarryPositions.ts +359 -0
- package/scripts/depositUnlentCollateral.ts +106 -0
- package/scripts/emergency/deleverageAll.ts +287 -0
- package/scripts/emergency/triggerCircuitBreaker.ts +87 -0
- package/scripts/env.ts +4 -0
- package/scripts/findTxs.ts +169 -0
- package/scripts/increaseCarryPositions.ts +134 -0
- package/scripts/inspect/format.ts +576 -0
- package/scripts/inspect.ts +147 -0
- package/scripts/localUtils.ts +249 -0
- package/scripts/mintToken.ts +126 -0
- package/scripts/processAsyncBurns.ts +89 -0
- package/scripts/rebalanceToken.ts +269 -0
- package/scripts/rebalanceYieldingBank.ts +183 -0
- package/scripts/recollateralizeLoss.ts +79 -0
- package/scripts/refresh.ts +156 -0
- package/scripts/updateFees.ts +486 -0
- package/scripts/updateGeneralLut.ts +36 -0
- package/scripts/updateLendingPositionConfig.ts +172 -0
- package/scripts/updateTokenLuts.ts +36 -0
- package/scripts/updateTokenMetadata.ts +199 -0
- package/scripts/updateYieldingBankConfig.ts +100 -0
- package/scripts/withdrawUnlentCollateral.ts +178 -0
- package/src/client/account.ts +503 -0
- package/src/client/builders/args.ts +381 -0
- package/src/client/builders/asyncBurnBuilder.ts +305 -0
- package/src/client/builders/base.ts +303 -0
- package/src/client/builders/burnTokenBuilder.ts +258 -0
- package/src/client/builders/claimIncentivesBuilder.ts +211 -0
- package/src/client/builders/collectFeesBuilder.ts +52 -0
- package/src/client/builders/collectInterestBuilder.ts +165 -0
- package/src/client/builders/createCpiPlanBuilder.ts +21 -0
- package/src/client/builders/createTokenBuilder.ts +73 -0
- package/src/client/builders/createTokenLendingPositionBuilder.ts +219 -0
- package/src/client/builders/createYieldingBankAllocationBuilder.ts +32 -0
- package/src/client/builders/createYieldingBankBuilder.ts +39 -0
- package/src/client/builders/decreaseCarryPositionBuilder.ts +162 -0
- package/src/client/builders/depositUnlentCollateralBuilder.ts +95 -0
- package/src/client/builders/increaseCarryPositionBuilder.ts +105 -0
- package/src/client/builders/index.ts +37 -0
- package/src/client/builders/mintTokenBuilder.ts +137 -0
- package/src/client/builders/rebalanceTokenBuilder.ts +356 -0
- package/src/client/builders/rebalanceYieldingBankBuilder.ts +109 -0
- package/src/client/builders/recollateralizeLossBuilder.ts +367 -0
- package/src/client/builders/refreshTokenStateBuilder.ts +153 -0
- package/src/client/builders/refreshTokensBuilder.ts +82 -0
- package/src/client/builders/refreshYieldingBankBuilder.ts +42 -0
- package/src/client/builders/resetTokenBurnRateLimitBuilder.ts +21 -0
- package/src/client/builders/setTokenCircuitBreakerBuilder.ts +40 -0
- package/src/client/builders/setYieldingBankCircuitBreakerBuilder.ts +37 -0
- package/src/client/builders/updateLendingPositionConfigBuilder.ts +33 -0
- package/src/client/builders/updateTokenConfigurationBuilder.ts +50 -0
- package/src/client/builders/updateTokenMetadataBuilder.ts +24 -0
- package/src/client/builders/updateYieldingBankConfigBuilder.ts +32 -0
- package/src/client/builders/utils.ts +26 -0
- package/src/client/client.ts +264 -0
- package/src/client/externalLiquidityResolver.ts +54 -0
- package/src/client/index.ts +20 -0
- package/src/client/lendingPlatformClients.ts +50 -0
- package/src/client/pda.ts +102 -0
- package/src/client/plans/collectInterest.ts +207 -0
- package/src/client/plans/decreaseCarryPosition.ts +226 -0
- package/src/client/routes/collectInterest.ts +56 -0
- package/src/client/transaction.ts +106 -0
- package/src/client/types/builders.ts +19 -0
- package/src/client/types/enums.ts +47 -0
- package/src/client/types/general.ts +117 -0
- package/src/client/types/index.ts +6 -0
- package/src/client/types/ix.ts +452 -0
- package/src/client/types/planTypes/collectInterest.ts +97 -0
- package/src/client/types/planTypes/common.ts +31 -0
- package/src/client/types/planTypes/decreaseCarryPosition.ts +134 -0
- package/src/client/types/planTypes/index.ts +3 -0
- package/src/client/types/tx.ts +409 -0
- package/src/constants/configs/allocations.ts +30 -0
- package/src/constants/configs/carryTradePresets.ts +164 -0
- package/src/constants/configs/index.ts +2 -0
- package/src/constants/general.ts +141 -0
- package/src/constants/index.ts +3 -0
- package/src/constants/lycTokenMetadata.ts +52 -0
- package/src/decoders/decodeTransaction.ts +319 -0
- package/src/decoders/discriminators.ts +10 -0
- package/src/decoders/idlAccounts.ts +75 -0
- package/src/decoders/index.ts +15 -0
- package/src/decoders/innerCpis.ts +262 -0
- package/src/decoders/lycInstructionNames.ts +73 -0
- package/src/decoders/programIds.ts +12 -0
- package/src/decoders/solana.ts +25 -0
- package/src/decoders/transactionPayload.ts +41 -0
- package/src/decoders/types.ts +60 -0
- package/src/errors.ts +195 -0
- package/src/idl/long_yield_carry.ts +14648 -0
- package/src/index.ts +10 -0
- package/src/metrics/index.ts +1 -0
- package/src/metrics/protocolMetrics.ts +976 -0
- package/src/models/index.ts +9 -0
- package/src/models/lycToken.ts +380 -0
- package/src/models/yieldingBank.ts +127 -0
- package/src/services/allocation/allocationService.ts +823 -0
- package/src/services/allocation/index.ts +2 -0
- package/src/services/allocation/types.ts +27 -0
- package/src/services/carry/carryAllocationConfig.ts +266 -0
- package/src/services/carry/index.ts +2 -0
- package/src/services/carry/lycLendingPositionManager.ts +167 -0
- package/src/services/index.ts +5 -0
- package/src/services/lendingPosition/index.ts +5 -0
- package/src/services/lendingPosition/lendingPositionService.ts +328 -0
- package/src/services/rebalance/index.ts +2 -0
- package/src/services/rebalance/token/index.ts +1 -0
- package/src/services/rebalance/token/tokenRebalanceService.ts +142 -0
- package/src/services/rebalance/yieldingBank/index.ts +3 -0
- package/src/services/rebalance/yieldingBank/planner.ts +215 -0
- package/src/services/rebalance/yieldingBank/strategy.ts +41 -0
- package/src/services/rebalance/yieldingBank/types.ts +41 -0
- package/src/services/redemption/index.ts +9 -0
- package/src/services/redemption/redemptionService.ts +758 -0
- package/src/types/enriched.ts +187 -0
- package/src/types/index.ts +1 -0
- package/src/utils/cache.ts +12 -0
- package/src/utils/data.ts +65 -0
- package/src/utils/enrichment.ts +330 -0
- package/src/utils/feeDripMetrics.ts +146 -0
- package/src/utils/general.ts +54 -0
- package/src/utils/index.ts +13 -0
- package/src/utils/ix.ts +227 -0
- package/src/utils/lendingPosition.ts +221 -0
- package/src/utils/lookupTables.ts +309 -0
- package/src/utils/lycData.ts +321 -0
- package/src/utils/timelock.ts +63 -0
- package/src/utils/tokenFeeMath.ts +25 -0
- package/src/utils/transactions.ts +109 -0
- package/src/utils/yieldingBank.ts +38 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BN } from "@anchor-lang/core";
|
|
2
|
+
import type { Address } from "@solana/kit";
|
|
3
|
+
import type { YieldingBankExternalLiquiditySource } from "../client/types";
|
|
4
|
+
/**
|
|
5
|
+
* PodBool is a Rust `#[repr(transparent)]` newtype over `u8`.
|
|
6
|
+
* Anchor deserializes tuple-struct fields using positional integer keys, so
|
|
7
|
+
* `PodBool(1)` arrives from the RPC as `{ '0': 1 }` instead of a plain number.
|
|
8
|
+
*
|
|
9
|
+
* This helper extracts the underlying u8 value so callers work with a plain
|
|
10
|
+
* number rather than the intermediate struct object.
|
|
11
|
+
*/
|
|
12
|
+
export declare function podBoolToNumber(val: {
|
|
13
|
+
0: number;
|
|
14
|
+
} | number): number;
|
|
15
|
+
/**
|
|
16
|
+
* Build external-liquidity source descriptors for one mint across multiple accounts.
|
|
17
|
+
*/
|
|
18
|
+
export declare function toYieldingBankExternalLiquiditySources(mint: Address, accounts: Address[]): YieldingBankExternalLiquiditySource[];
|
|
19
|
+
/**
|
|
20
|
+
* Convert a raw token amount and raw oracle price into 8-decimal USD TVL units.
|
|
21
|
+
*/
|
|
22
|
+
export declare function amountToTvl(amount: number | bigint | BN, price: number | bigint | BN, decimals: number): BN;
|
|
23
|
+
/**
|
|
24
|
+
* Generate a redemption epoch ID by flooring `Date.now()` to the nearest minute.
|
|
25
|
+
* Burns within the same 60-second window will share an epoch PDA, allowing the
|
|
26
|
+
* manager to batch-process them together.
|
|
27
|
+
*/
|
|
28
|
+
export declare function currentEpochId(): BN;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.podBoolToNumber = podBoolToNumber;
|
|
4
|
+
exports.toYieldingBankExternalLiquiditySources = toYieldingBankExternalLiquiditySources;
|
|
5
|
+
exports.amountToTvl = amountToTvl;
|
|
6
|
+
exports.currentEpochId = currentEpochId;
|
|
7
|
+
const core_1 = require("@anchor-lang/core");
|
|
8
|
+
const common_1 = require("common");
|
|
9
|
+
/**
|
|
10
|
+
* PodBool is a Rust `#[repr(transparent)]` newtype over `u8`.
|
|
11
|
+
* Anchor deserializes tuple-struct fields using positional integer keys, so
|
|
12
|
+
* `PodBool(1)` arrives from the RPC as `{ '0': 1 }` instead of a plain number.
|
|
13
|
+
*
|
|
14
|
+
* This helper extracts the underlying u8 value so callers work with a plain
|
|
15
|
+
* number rather than the intermediate struct object.
|
|
16
|
+
*/
|
|
17
|
+
function podBoolToNumber(val) {
|
|
18
|
+
if (typeof val === "number")
|
|
19
|
+
return val;
|
|
20
|
+
return val[0] ?? 0;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Build external-liquidity source descriptors for one mint across multiple accounts.
|
|
24
|
+
*/
|
|
25
|
+
function toYieldingBankExternalLiquiditySources(mint, accounts) {
|
|
26
|
+
return accounts.map((account) => ({ mint, account }));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Convert a raw token amount and raw oracle price into 8-decimal USD TVL units.
|
|
30
|
+
*/
|
|
31
|
+
function amountToTvl(amount, price, decimals) {
|
|
32
|
+
const amountBn = new core_1.BN(amount.toString());
|
|
33
|
+
const priceBn = new core_1.BN(price.toString());
|
|
34
|
+
const assetScale = (0, common_1.fromUiAmount)(1, decimals);
|
|
35
|
+
const tvlScale = (0, common_1.fromUiAmount)(1, 8);
|
|
36
|
+
const scaleFactor = assetScale.mul(assetScale).div(tvlScale);
|
|
37
|
+
return amountBn.mul(priceBn).div(scaleFactor);
|
|
38
|
+
}
|
|
39
|
+
const EPOCH_BUCKET_MS = 60000;
|
|
40
|
+
/**
|
|
41
|
+
* Generate a redemption epoch ID by flooring `Date.now()` to the nearest minute.
|
|
42
|
+
* Burns within the same 60-second window will share an epoch PDA, allowing the
|
|
43
|
+
* manager to batch-process them together.
|
|
44
|
+
*/
|
|
45
|
+
function currentEpochId() {
|
|
46
|
+
return new core_1.BN(Math.floor(Date.now() / EPOCH_BUCKET_MS) * EPOCH_BUCKET_MS);
|
|
47
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./enrichment";
|
|
2
|
+
export * from "./lycData";
|
|
3
|
+
export * from "./lookupTables";
|
|
4
|
+
export * from "./ix";
|
|
5
|
+
export * from "./general";
|
|
6
|
+
export * from "./data";
|
|
7
|
+
export * from "./cache";
|
|
8
|
+
export * from "./transactions";
|
|
9
|
+
export * from "./lendingPosition";
|
|
10
|
+
export * from "./yieldingBank";
|
|
11
|
+
export * from "./timelock";
|
|
12
|
+
export * from "./tokenFeeMath";
|
|
13
|
+
export * from "./feeDripMetrics";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./enrichment"), exports);
|
|
18
|
+
__exportStar(require("./lycData"), exports);
|
|
19
|
+
__exportStar(require("./lookupTables"), exports);
|
|
20
|
+
__exportStar(require("./ix"), exports);
|
|
21
|
+
__exportStar(require("./general"), exports);
|
|
22
|
+
__exportStar(require("./data"), exports);
|
|
23
|
+
__exportStar(require("./cache"), exports);
|
|
24
|
+
__exportStar(require("./transactions"), exports);
|
|
25
|
+
__exportStar(require("./lendingPosition"), exports);
|
|
26
|
+
__exportStar(require("./yieldingBank"), exports);
|
|
27
|
+
__exportStar(require("./timelock"), exports);
|
|
28
|
+
__exportStar(require("./tokenFeeMath"), exports);
|
|
29
|
+
__exportStar(require("./feeDripMetrics"), exports);
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type Address } from "@solana/kit";
|
|
2
|
+
import { IdlTypes } from "@anchor-lang/core";
|
|
3
|
+
import { type CustomAccountMeta, type InstructionRefs } from "common";
|
|
4
|
+
import type { LongYieldCarry } from "../idl/long_yield_carry";
|
|
5
|
+
import type { DecreaseCarryPositionPlan, YieldingBankAllocationConfig } from "../client/types";
|
|
6
|
+
export declare function toAnchorAllocationConfig(cfg: YieldingBankAllocationConfig): IdlTypes<LongYieldCarry>["yieldingBankAllocationConfig"];
|
|
7
|
+
/**
|
|
8
|
+
* Build the carry-trade account metas that are prepended to remaining_accounts
|
|
9
|
+
* for increase/decrease carry position instructions.
|
|
10
|
+
*
|
|
11
|
+
* The two ATA accounts are tagged with `isRequiredAta` so that
|
|
12
|
+
* `getCreateAtaInstructions` will create them if they don't yet exist.
|
|
13
|
+
*
|
|
14
|
+
* Order must match `parse_carry_trade_accounts` on the Rust side:
|
|
15
|
+
* 0. token (writable)
|
|
16
|
+
* 1. yieldingBank (writable)
|
|
17
|
+
* 2. tokenLpDebtTa (writable, ATA)
|
|
18
|
+
* 3. yieldingBankTa (writable, ATA)
|
|
19
|
+
* 4. lendingPositionUserAccount (readonly)
|
|
20
|
+
* 5. lendingPositionCollateralReserve (readonly)
|
|
21
|
+
* 6. debtOracle (readonly)
|
|
22
|
+
* 7. debtTokenProgram (readonly)
|
|
23
|
+
* 8. instructions_sysvar (readonly)
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildCarryTradeAccountMetas(token: Address, yieldingBank: Address, tokenLpDebtTa: Address, yieldingBankTa: Address, lendingPositionUserAccount: Address, lendingPositionCollateralReserve: Address, debtOracle: Address, debtMint: Address, debtTokenProgram: Address): CustomAccountMeta[];
|
|
26
|
+
/**
|
|
27
|
+
* Build the initial remaining-accounts prefix for `rebalance_token`.
|
|
28
|
+
*
|
|
29
|
+
* Order must match `RebalanceTokenAccounts::parse` on the Rust side:
|
|
30
|
+
* 0. token (writable)
|
|
31
|
+
* 1. yieldingBank (writable)
|
|
32
|
+
* 2. sourceDebtTokenProgram (readonly)
|
|
33
|
+
* 3. yieldingBankSourceDebtAta (writable, ATA)
|
|
34
|
+
* 4. sourceLpUserAccount (readonly)
|
|
35
|
+
* 5. sourceLpCollateralReserve (readonly)
|
|
36
|
+
* 6. sourceLpDebtOracle (readonly — also serves as the
|
|
37
|
+
* dust-sweep source_debt_oracle)
|
|
38
|
+
* 7. destinationLpUserAccount (readonly)
|
|
39
|
+
* 8. destinationLpCollateralReserve (readonly)
|
|
40
|
+
* 9. destinationLpDebtOracle (readonly)
|
|
41
|
+
*
|
|
42
|
+
* The destination debt mint is referenced by inner CPIs (borrow / swap) and
|
|
43
|
+
* reaches the pool through CPI dedup; it does not need a fixed slot here.
|
|
44
|
+
* The token PDA's source-debt ATA is part of the flash-borrow / repay path
|
|
45
|
+
* and is also resolved at runtime from the CPI account pool — only the
|
|
46
|
+
* yielding-bank's source-debt ATA needs an explicit slot for the dust sweep.
|
|
47
|
+
*/
|
|
48
|
+
export declare function buildRebalanceTokenInitialAccounts(args: {
|
|
49
|
+
token: Address;
|
|
50
|
+
yieldingBank: Address;
|
|
51
|
+
sourceDebtMint: Address;
|
|
52
|
+
sourceDebtTokenProgram: Address;
|
|
53
|
+
yieldingBankSourceDebtAta: Address;
|
|
54
|
+
lpUserAccount: Address;
|
|
55
|
+
sourceDebtOracle: Address;
|
|
56
|
+
destinationDebtOracle: Address;
|
|
57
|
+
}): CustomAccountMeta[];
|
|
58
|
+
/**
|
|
59
|
+
* Normalize grouped CPI refs for `decrease_carry_position`.
|
|
60
|
+
*
|
|
61
|
+
* The plan can contain either:
|
|
62
|
+
* - one group: repay only, or
|
|
63
|
+
* - two groups: yielding-bank swap/redeem first, then repay.
|
|
64
|
+
*/
|
|
65
|
+
export declare function resolveDecreaseCarryIxRefs(refsGroups: InstructionRefs[], options?: {
|
|
66
|
+
hasTokenPrerequisiteCpis?: boolean;
|
|
67
|
+
}): {
|
|
68
|
+
ybIxRefs?: InstructionRefs;
|
|
69
|
+
prerequisiteCpis?: InstructionRefs;
|
|
70
|
+
tokenIxRefs: InstructionRefs;
|
|
71
|
+
};
|
|
72
|
+
export interface ResolvedDecreaseCarryCpiPlan {
|
|
73
|
+
accounts: CustomAccountMeta[];
|
|
74
|
+
lookupTables: Address[];
|
|
75
|
+
ybIxRefs?: InstructionRefs;
|
|
76
|
+
prerequisiteCpis?: InstructionRefs;
|
|
77
|
+
tokenIxRefs: InstructionRefs;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Build the grouped CPI pool for `decrease_carry_position` and normalize the
|
|
81
|
+
* resulting ref groups into the instruction params the SDK passes on-chain.
|
|
82
|
+
*/
|
|
83
|
+
export declare function resolveDecreaseCarryCpiPlan(plan: DecreaseCarryPositionPlan): ResolvedDecreaseCarryCpiPlan;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toAnchorAllocationConfig = toAnchorAllocationConfig;
|
|
4
|
+
exports.buildCarryTradeAccountMetas = buildCarryTradeAccountMetas;
|
|
5
|
+
exports.buildRebalanceTokenInitialAccounts = buildRebalanceTokenInitialAccounts;
|
|
6
|
+
exports.resolveDecreaseCarryIxRefs = resolveDecreaseCarryIxRefs;
|
|
7
|
+
exports.resolveDecreaseCarryCpiPlan = resolveDecreaseCarryCpiPlan;
|
|
8
|
+
const common_1 = require("common");
|
|
9
|
+
function toAnchorAssetConfig(cfg) {
|
|
10
|
+
return {
|
|
11
|
+
oracle: (0, common_1.toWeb3Pk)(cfg.oracle),
|
|
12
|
+
oracleType: cfg.oracleType,
|
|
13
|
+
externalLiquidity: cfg.externalLiquidityType,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function toAnchorAssetAllocationConfig(cfg) {
|
|
17
|
+
return {
|
|
18
|
+
mint: (0, common_1.toWeb3Pk)(cfg.mint),
|
|
19
|
+
decimals: cfg.decimals,
|
|
20
|
+
tokenProgram: cfg.tokenProgram,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function toAnchorExternalPositionConfig(cfg) {
|
|
24
|
+
return {
|
|
25
|
+
lendingPlatform: cfg.lendingPlatform,
|
|
26
|
+
lendingType: cfg.lendingType,
|
|
27
|
+
pool: (0, common_1.toWeb3Pk)(cfg.pool),
|
|
28
|
+
collateralReserve: (0, common_1.toWeb3Pk)(cfg.collateralReserve),
|
|
29
|
+
debtReserve: (0, common_1.toWeb3Pk)(cfg.debtReserve),
|
|
30
|
+
protocolUserAcc: (0, common_1.toWeb3Pk)(cfg.protocolUserAcc),
|
|
31
|
+
collateral: toAnchorAssetAllocationConfig(cfg.collateral),
|
|
32
|
+
debt: toAnchorAssetAllocationConfig(cfg.debt),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function toAnchorAllocationConfig(cfg) {
|
|
36
|
+
return {
|
|
37
|
+
assetHolding: cfg.assetHolding ? toAnchorAssetConfig(cfg.assetHolding) : null,
|
|
38
|
+
externalPosition: cfg.externalPosition
|
|
39
|
+
? toAnchorExternalPositionConfig(cfg.externalPosition)
|
|
40
|
+
: null,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Build the carry-trade account metas that are prepended to remaining_accounts
|
|
45
|
+
* for increase/decrease carry position instructions.
|
|
46
|
+
*
|
|
47
|
+
* The two ATA accounts are tagged with `isRequiredAta` so that
|
|
48
|
+
* `getCreateAtaInstructions` will create them if they don't yet exist.
|
|
49
|
+
*
|
|
50
|
+
* Order must match `parse_carry_trade_accounts` on the Rust side:
|
|
51
|
+
* 0. token (writable)
|
|
52
|
+
* 1. yieldingBank (writable)
|
|
53
|
+
* 2. tokenLpDebtTa (writable, ATA)
|
|
54
|
+
* 3. yieldingBankTa (writable, ATA)
|
|
55
|
+
* 4. lendingPositionUserAccount (readonly)
|
|
56
|
+
* 5. lendingPositionCollateralReserve (readonly)
|
|
57
|
+
* 6. debtOracle (readonly)
|
|
58
|
+
* 7. debtTokenProgram (readonly)
|
|
59
|
+
* 8. instructions_sysvar (readonly)
|
|
60
|
+
*/
|
|
61
|
+
function buildCarryTradeAccountMetas(token, yieldingBank, tokenLpDebtTa, yieldingBankTa, lendingPositionUserAccount, lendingPositionCollateralReserve, debtOracle, debtMint, debtTokenProgram) {
|
|
62
|
+
return [
|
|
63
|
+
(0, common_1.toCustomAccountMeta)(token, true),
|
|
64
|
+
(0, common_1.toCustomAccountMeta)(yieldingBank, true),
|
|
65
|
+
(0, common_1.toCustomAccountMeta)(tokenLpDebtTa, true, {
|
|
66
|
+
owner: token,
|
|
67
|
+
mint: debtMint,
|
|
68
|
+
tokenProgram: debtTokenProgram,
|
|
69
|
+
}),
|
|
70
|
+
(0, common_1.toCustomAccountMeta)(yieldingBankTa, true, {
|
|
71
|
+
owner: yieldingBank,
|
|
72
|
+
mint: debtMint,
|
|
73
|
+
tokenProgram: debtTokenProgram,
|
|
74
|
+
}),
|
|
75
|
+
(0, common_1.toCustomAccountMeta)(lendingPositionUserAccount),
|
|
76
|
+
(0, common_1.toCustomAccountMeta)(lendingPositionCollateralReserve),
|
|
77
|
+
(0, common_1.toCustomAccountMeta)(debtOracle),
|
|
78
|
+
(0, common_1.toCustomAccountMeta)(debtTokenProgram),
|
|
79
|
+
common_1.IX_SYSVAR_META,
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Build the initial remaining-accounts prefix for `rebalance_token`.
|
|
84
|
+
*
|
|
85
|
+
* Order must match `RebalanceTokenAccounts::parse` on the Rust side:
|
|
86
|
+
* 0. token (writable)
|
|
87
|
+
* 1. yieldingBank (writable)
|
|
88
|
+
* 2. sourceDebtTokenProgram (readonly)
|
|
89
|
+
* 3. yieldingBankSourceDebtAta (writable, ATA)
|
|
90
|
+
* 4. sourceLpUserAccount (readonly)
|
|
91
|
+
* 5. sourceLpCollateralReserve (readonly)
|
|
92
|
+
* 6. sourceLpDebtOracle (readonly — also serves as the
|
|
93
|
+
* dust-sweep source_debt_oracle)
|
|
94
|
+
* 7. destinationLpUserAccount (readonly)
|
|
95
|
+
* 8. destinationLpCollateralReserve (readonly)
|
|
96
|
+
* 9. destinationLpDebtOracle (readonly)
|
|
97
|
+
*
|
|
98
|
+
* The destination debt mint is referenced by inner CPIs (borrow / swap) and
|
|
99
|
+
* reaches the pool through CPI dedup; it does not need a fixed slot here.
|
|
100
|
+
* The token PDA's source-debt ATA is part of the flash-borrow / repay path
|
|
101
|
+
* and is also resolved at runtime from the CPI account pool — only the
|
|
102
|
+
* yielding-bank's source-debt ATA needs an explicit slot for the dust sweep.
|
|
103
|
+
*/
|
|
104
|
+
function buildRebalanceTokenInitialAccounts(args) {
|
|
105
|
+
return [
|
|
106
|
+
(0, common_1.toCustomAccountMeta)(args.token, true),
|
|
107
|
+
(0, common_1.toCustomAccountMeta)(args.yieldingBank, true),
|
|
108
|
+
(0, common_1.toCustomAccountMeta)(args.sourceDebtTokenProgram),
|
|
109
|
+
(0, common_1.toCustomAccountMeta)(args.yieldingBankSourceDebtAta, true, {
|
|
110
|
+
owner: args.yieldingBank,
|
|
111
|
+
mint: args.sourceDebtMint,
|
|
112
|
+
tokenProgram: args.sourceDebtTokenProgram,
|
|
113
|
+
}),
|
|
114
|
+
(0, common_1.toCustomAccountMeta)(args.lpUserAccount),
|
|
115
|
+
(0, common_1.toCustomAccountMeta)(args.sourceDebtOracle),
|
|
116
|
+
(0, common_1.toCustomAccountMeta)(args.destinationDebtOracle),
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Normalize grouped CPI refs for `decrease_carry_position`.
|
|
121
|
+
*
|
|
122
|
+
* The plan can contain either:
|
|
123
|
+
* - one group: repay only, or
|
|
124
|
+
* - two groups: yielding-bank swap/redeem first, then repay.
|
|
125
|
+
*/
|
|
126
|
+
function resolveDecreaseCarryIxRefs(refsGroups, options) {
|
|
127
|
+
const hasTokenPrerequisiteCpis = options?.hasTokenPrerequisiteCpis ?? false;
|
|
128
|
+
const lastRefs = refsGroups[refsGroups.length - 1];
|
|
129
|
+
if (!lastRefs) {
|
|
130
|
+
throw new Error("Expected at least one CPI ref group for decrease carry flow");
|
|
131
|
+
}
|
|
132
|
+
const prerequisiteCpis = hasTokenPrerequisiteCpis ? refsGroups[refsGroups.length - 2] : undefined;
|
|
133
|
+
if (hasTokenPrerequisiteCpis && !prerequisiteCpis) {
|
|
134
|
+
throw new Error("Expected prerequisite CPI ref group for decrease carry flow");
|
|
135
|
+
}
|
|
136
|
+
const ybIxRefs = refsGroups[0] && refsGroups[0] !== prerequisiteCpis && refsGroups[0] !== lastRefs
|
|
137
|
+
? refsGroups[0]
|
|
138
|
+
: undefined;
|
|
139
|
+
return {
|
|
140
|
+
tokenIxRefs: lastRefs,
|
|
141
|
+
...(prerequisiteCpis ? { prerequisiteCpis } : {}),
|
|
142
|
+
...(ybIxRefs ? { ybIxRefs } : {}),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Build the grouped CPI pool for `decrease_carry_position` and normalize the
|
|
147
|
+
* resulting ref groups into the instruction params the SDK passes on-chain.
|
|
148
|
+
*/
|
|
149
|
+
function resolveDecreaseCarryCpiPlan(plan) {
|
|
150
|
+
const cpiDataGroups = [
|
|
151
|
+
...(plan.cpiDataGroups.length === 2 ? [plan.cpiDataGroups[0]] : []),
|
|
152
|
+
...(plan.tokenPrerequisiteCpis?.length ? [plan.tokenPrerequisiteCpis] : []),
|
|
153
|
+
plan.cpiDataGroups[plan.cpiDataGroups.length - 1],
|
|
154
|
+
];
|
|
155
|
+
const { accounts, refsGroups, lookupTables } = (0, common_1.createMultiCpiRefs)(cpiDataGroups, {
|
|
156
|
+
initialAccounts: plan.initialAccounts,
|
|
157
|
+
});
|
|
158
|
+
return {
|
|
159
|
+
accounts,
|
|
160
|
+
lookupTables,
|
|
161
|
+
...resolveDecreaseCarryIxRefs(refsGroups, {
|
|
162
|
+
hasTokenPrerequisiteCpis: Boolean(plan.tokenPrerequisiteCpis?.length),
|
|
163
|
+
}),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type Address } from "@solana/kit";
|
|
2
|
+
import { LendingPlatform } from "common";
|
|
3
|
+
import { type LendingPlatformClientBase, type LendingPlatformData } from "lending-platforms";
|
|
4
|
+
import type { LYCToken } from "../models/lycToken";
|
|
5
|
+
import type { CreateTokenLendingPositionAccounts, CreateTokenLendingPositionParams } from "../client/types";
|
|
6
|
+
export interface BuildLendingPositionAllocationArgs {
|
|
7
|
+
/** Lending platform client used to resolve reserves and user accounts. */
|
|
8
|
+
lendingClient: LendingPlatformClientBase<LendingPlatformData>;
|
|
9
|
+
/** Token PDA that will own the lending position. */
|
|
10
|
+
tokenPda: Address;
|
|
11
|
+
/** Collateral mint address. Used to resolve the collateral reserve in the pool. */
|
|
12
|
+
collateralMint: Address;
|
|
13
|
+
/** Debt mint address. Decimals and token program are resolved from the mint registry. */
|
|
14
|
+
debtMint: Address;
|
|
15
|
+
/** Debt reserve address. If omitted, looked up from the pool by `debtMint`. */
|
|
16
|
+
debtReserve?: Address;
|
|
17
|
+
/** Obligation / user-account ID within the lending pool. */
|
|
18
|
+
userAccountId: number;
|
|
19
|
+
/**
|
|
20
|
+
* Lending pool address. When omitted, resolved automatically from the
|
|
21
|
+
* collateral mint via {@link getEligiblePools}. Throws if the mint is
|
|
22
|
+
* listed in zero or multiple pools (caller must disambiguate).
|
|
23
|
+
*/
|
|
24
|
+
pool?: Address;
|
|
25
|
+
/** @default LendingPlatform.Kamino */
|
|
26
|
+
lendingPlatform?: LendingPlatform;
|
|
27
|
+
/** @default 9000 */
|
|
28
|
+
targetUtilizationRateBps?: number;
|
|
29
|
+
/** @default 150 */
|
|
30
|
+
maxDeviationAboveTargetUtilBps?: number;
|
|
31
|
+
/** @default 300 */
|
|
32
|
+
maxDeviationBelowTargetUtilBps?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface LendingPositionAllocation {
|
|
35
|
+
params: CreateTokenLendingPositionParams;
|
|
36
|
+
accounts: CreateTokenLendingPositionAccounts;
|
|
37
|
+
pool: Address;
|
|
38
|
+
collateralReserve: Address;
|
|
39
|
+
debtReserve: Address;
|
|
40
|
+
protocolUserAccount: Address;
|
|
41
|
+
userAccountId: number;
|
|
42
|
+
}
|
|
43
|
+
export interface GetAvailableTokenLendingUserAccountIdArgs {
|
|
44
|
+
lendingClient: LendingPlatformClientBase<LendingPlatformData>;
|
|
45
|
+
token: LYCToken;
|
|
46
|
+
pool: Address;
|
|
47
|
+
lendingPlatform?: LendingPlatform;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Resolves the lending pool for a collateral mint when the caller didn't
|
|
51
|
+
* supply one explicitly. Uses the static `KAMINO_ACCOUNTS` registry to
|
|
52
|
+
* find which pool(s) list the mint.
|
|
53
|
+
*
|
|
54
|
+
* - Exactly one pool → returns it.
|
|
55
|
+
* - Zero pools → throws (mint not listed anywhere).
|
|
56
|
+
* - Multiple pools → throws (caller must pass `pool` to disambiguate).
|
|
57
|
+
*/
|
|
58
|
+
export declare function resolveDefaultPool(collateralMint: Address): Address;
|
|
59
|
+
export declare function getAvailableTokenLendingUserAccountId({ lendingClient, token, pool, lendingPlatform, }: GetAvailableTokenLendingUserAccountIdArgs): Promise<number>;
|
|
60
|
+
/**
|
|
61
|
+
* Resolves reserves, oracle data, and user-account PDA, then assembles a
|
|
62
|
+
* `CreateTokenLendingPositionParams` ready for `ix.createTokenLendingPosition`.
|
|
63
|
+
*
|
|
64
|
+
* The collateral reserve is resolved from the collateral mint against the pool.
|
|
65
|
+
* Debt metadata (decimals, token program) is resolved from the mint registry;
|
|
66
|
+
* the debt reserve address is either provided directly or looked up by mint.
|
|
67
|
+
*/
|
|
68
|
+
export declare function buildLendingPositionAllocation(args: BuildLendingPositionAllocationArgs): Promise<LendingPositionAllocation>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveDefaultPool = resolveDefaultPool;
|
|
4
|
+
exports.getAvailableTokenLendingUserAccountId = getAvailableTokenLendingUserAccountId;
|
|
5
|
+
exports.buildLendingPositionAllocation = buildLendingPositionAllocation;
|
|
6
|
+
const common_1 = require("common");
|
|
7
|
+
const lending_platforms_1 = require("lending-platforms");
|
|
8
|
+
const oracle_1 = require("oracle");
|
|
9
|
+
const DEFAULT_TARGET_UTILIZATION_RATE_BPS = 9000;
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Pool resolution
|
|
12
|
+
// =============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the lending pool for a collateral mint when the caller didn't
|
|
15
|
+
* supply one explicitly. Uses the static `KAMINO_ACCOUNTS` registry to
|
|
16
|
+
* find which pool(s) list the mint.
|
|
17
|
+
*
|
|
18
|
+
* - Exactly one pool → returns it.
|
|
19
|
+
* - Zero pools → throws (mint not listed anywhere).
|
|
20
|
+
* - Multiple pools → throws (caller must pass `pool` to disambiguate).
|
|
21
|
+
*/
|
|
22
|
+
function resolveDefaultPool(collateralMint) {
|
|
23
|
+
const mintInfo = common_1.mints.get(collateralMint);
|
|
24
|
+
const symbol = mintInfo?.symbol ?? String(collateralMint);
|
|
25
|
+
const eligible = (0, lending_platforms_1.getEligiblePools)(symbol);
|
|
26
|
+
if (eligible.length === 0) {
|
|
27
|
+
throw new Error(`resolveDefaultPool: collateral mint ${symbol} (${collateralMint}) is not listed in any known lending pool`);
|
|
28
|
+
}
|
|
29
|
+
if (eligible.length > 1) {
|
|
30
|
+
throw new Error(`resolveDefaultPool: collateral mint ${symbol} is listed in multiple pools — ` +
|
|
31
|
+
`pass \`pool\` explicitly. Eligible pools:\n` +
|
|
32
|
+
eligible.map((m) => ` ${m}`).join("\n"));
|
|
33
|
+
}
|
|
34
|
+
return eligible[0];
|
|
35
|
+
}
|
|
36
|
+
async function getAvailableTokenLendingUserAccountId({ lendingClient, token, pool, lendingPlatform = common_1.LendingPlatform.Kamino, }) {
|
|
37
|
+
const activeProtocolUserAccounts = token.activeLendingPositions
|
|
38
|
+
.filter(({ data }) => (0, common_1.lendingPlatformToEnum)(data.platform) === lendingPlatform)
|
|
39
|
+
.map(({ data }) => (0, common_1.fromWeb3Pk)(data.protocolUserAcc));
|
|
40
|
+
return lendingClient.getAvailableUserAccountId(pool, token.address, activeProtocolUserAccounts);
|
|
41
|
+
}
|
|
42
|
+
// =============================================================================
|
|
43
|
+
// Builder
|
|
44
|
+
// =============================================================================
|
|
45
|
+
/**
|
|
46
|
+
* Resolves reserves, oracle data, and user-account PDA, then assembles a
|
|
47
|
+
* `CreateTokenLendingPositionParams` ready for `ix.createTokenLendingPosition`.
|
|
48
|
+
*
|
|
49
|
+
* The collateral reserve is resolved from the collateral mint against the pool.
|
|
50
|
+
* Debt metadata (decimals, token program) is resolved from the mint registry;
|
|
51
|
+
* the debt reserve address is either provided directly or looked up by mint.
|
|
52
|
+
*/
|
|
53
|
+
async function buildLendingPositionAllocation(args) {
|
|
54
|
+
const { lendingClient, tokenPda, collateralMint, debtMint, userAccountId, lendingPlatform = common_1.LendingPlatform.Kamino, targetUtilizationRateBps = DEFAULT_TARGET_UTILIZATION_RATE_BPS, maxDeviationAboveTargetUtilBps = 150, maxDeviationBelowTargetUtilBps = 300, } = args;
|
|
55
|
+
const debtMintInfo = common_1.mints.get(debtMint);
|
|
56
|
+
if (!debtMintInfo) {
|
|
57
|
+
throw new Error(`buildLendingPositionAllocation: debt mint ${debtMint} not found in mint registry`);
|
|
58
|
+
}
|
|
59
|
+
const pool = args.pool ?? resolveDefaultPool(collateralMint);
|
|
60
|
+
const collateralReserve = await lendingClient.data.fetchReserveByMint(pool, collateralMint);
|
|
61
|
+
if (!collateralReserve) {
|
|
62
|
+
throw new Error(`buildLendingPositionAllocation: no reserve found for collateral mint ${collateralMint} in pool ${pool}`);
|
|
63
|
+
}
|
|
64
|
+
const collateralReserveAddress = collateralReserve.address;
|
|
65
|
+
let debtReserveAddress;
|
|
66
|
+
if (args.debtReserve) {
|
|
67
|
+
debtReserveAddress = args.debtReserve;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const reserve = await lendingClient.data.fetchReserveByMint(pool, debtMint);
|
|
71
|
+
if (!reserve) {
|
|
72
|
+
throw new Error(`buildLendingPositionAllocation: no reserve found for debt mint ${debtMint} in pool ${pool}`);
|
|
73
|
+
}
|
|
74
|
+
debtReserveAddress = reserve.address;
|
|
75
|
+
}
|
|
76
|
+
const protocolUserAccount = await lendingClient.accounts.getUserAccountAddress(pool, tokenPda, userAccountId);
|
|
77
|
+
const debtOracleData = oracle_1.oracle.getOracleData(debtMint);
|
|
78
|
+
const debtTokenProgram = (0, common_1.enumToTokenProgram)(debtMintInfo.isToken2022 ? common_1.TokenProgram.Token2022 : common_1.TokenProgram.Spl);
|
|
79
|
+
const params = {
|
|
80
|
+
lendingPlatform: (0, common_1.enumToLendingPlatform)(lendingPlatform),
|
|
81
|
+
pool,
|
|
82
|
+
debtReserve: debtReserveAddress,
|
|
83
|
+
targetUtilizationRateBps,
|
|
84
|
+
maxDeviationAboveTargetUtilBps,
|
|
85
|
+
maxDeviationBelowTargetUtilBps,
|
|
86
|
+
debtMint,
|
|
87
|
+
debtDecimals: debtMintInfo.decimals,
|
|
88
|
+
debtTokenProgram,
|
|
89
|
+
debtOracleType: (0, common_1.enumToOracleType)(debtOracleData.oracleType),
|
|
90
|
+
};
|
|
91
|
+
const accounts = {
|
|
92
|
+
protocolUserAcc: protocolUserAccount,
|
|
93
|
+
collateralReserve: collateralReserveAddress,
|
|
94
|
+
debtOracle: debtOracleData.oracle,
|
|
95
|
+
};
|
|
96
|
+
return {
|
|
97
|
+
params,
|
|
98
|
+
accounts,
|
|
99
|
+
pool,
|
|
100
|
+
collateralReserve: collateralReserveAddress,
|
|
101
|
+
debtReserve: debtReserveAddress,
|
|
102
|
+
protocolUserAccount,
|
|
103
|
+
userAccountId,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Address, Rpc, SolanaRpcApi, TransactionSigner } from "@solana/kit";
|
|
2
|
+
import { type Environment } from "common";
|
|
3
|
+
import { LongYieldCarryClient } from "../client/client";
|
|
4
|
+
import { LYCToken } from "../models/lycToken";
|
|
5
|
+
/**
|
|
6
|
+
* Get the specific lookup table for the given Token PDA (if it exists).
|
|
7
|
+
*
|
|
8
|
+
* `TOKEN_LOOKUP_TABLES` is keyed by Token PDA address.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getLookupTableForToken(tokenPda: Address): Address | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Assembles lookup table addresses for LYC transaction plans: the deployment
|
|
13
|
+
* general LUT (when not `local`), any registered per-token LUT for the given
|
|
14
|
+
* token PDAs, then any CPI/swap tables. Entries are omitted when missing or
|
|
15
|
+
* equal to the default (unused) public key; duplicates are removed in first-seen
|
|
16
|
+
* order.
|
|
17
|
+
*/
|
|
18
|
+
export declare function mergeLycLookupTables(environment: Environment, tokenPda?: Address | readonly Address[], existingLookupTables?: readonly Address[]): Address[];
|
|
19
|
+
/**
|
|
20
|
+
* Refresh per-token lookup tables for every Token account owned by the program.
|
|
21
|
+
*
|
|
22
|
+
* @param client - Initialized client (provides RPC-backed account fetch and Kamino helpers).
|
|
23
|
+
*/
|
|
24
|
+
export declare function updateTokenLutsIfNeeded(signer: TransactionSigner, rpc: Rpc<SolanaRpcApi>, client: LongYieldCarryClient): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Extend the per-token lookup table with addresses needed for that token's
|
|
27
|
+
* instructions: mints, token/YB ATAs, registry debt-mint ATAs for the token PDA, lending protocol accounts, Kamino
|
|
28
|
+
* obligation ATAs when applicable. Lending reserve accounts live on the
|
|
29
|
+
* lending-platform LUT; price oracles for registry-listed debt/YBAs and risk
|
|
30
|
+
* assets live on the general LUT.
|
|
31
|
+
*
|
|
32
|
+
* Collateral mint is read from on-chain token state (it is not a PDA).
|
|
33
|
+
*
|
|
34
|
+
* @param client - Used for Kamino reserve metadata and reserve interaction ATAs.
|
|
35
|
+
* @param token - Fetched token model (`LYCToken`); avoids an extra fetch.
|
|
36
|
+
*/
|
|
37
|
+
export declare function updateTokenLutIfNeeded(signer: TransactionSigner, rpc: Rpc<SolanaRpcApi>, client: LongYieldCarryClient, token: LYCToken): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Extend the shared general lookup table: program IDs, well-known SPL programs,
|
|
40
|
+
* stablecoin and YBA mints (plus registry oracles), Standard + LST oracle accounts,
|
|
41
|
+
* Perena program id, every on-chain YieldingBank PDA, each bank’s ATAs for
|
|
42
|
+
* all registry debt mints (stablecoins) and yield-bearing assets, the canonical
|
|
43
|
+
* Jito tip accounts (referenced by every Jito-bundle tip ix), the ComputeBudget
|
|
44
|
+
* program (referenced by every CU-limit ix), and the deployment's role wallets:
|
|
45
|
+
* manager, protocol admin, circuit-breaker controller, and protocol fee wallet.
|
|
46
|
+
*
|
|
47
|
+
* Risk asset (Standard + LST) mints are omitted here; they appear on each token LUT
|
|
48
|
+
* as collateral.
|
|
49
|
+
*
|
|
50
|
+
* Uses {@link GENERAL_LOOKUP_TABLES} for {@link LongYieldCarryClient.environment}
|
|
51
|
+
* (`test` | `prod` only) and only that tier’s program ID.
|
|
52
|
+
*
|
|
53
|
+
* @throws If `client.environment` is `local` — there is no pinned general LUT for local.
|
|
54
|
+
*/
|
|
55
|
+
export declare function updateGeneralLutIfNeeded(signer: TransactionSigner, rpc: Rpc<SolanaRpcApi>, client: LongYieldCarryClient): Promise<Address>;
|