@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,19 @@
|
|
|
1
|
+
import type { Program } from "@anchor-lang/core";
|
|
2
|
+
import type { Rpc, SolanaRpcApi } from "@solana/kit";
|
|
3
|
+
import type { Environment, SwapClient } from "common";
|
|
4
|
+
import type { LongYieldCarry } from "../../idl/long_yield_carry";
|
|
5
|
+
import type { AccountClient } from "../account";
|
|
6
|
+
import type { LongYieldCarryExternalLiquidityResolver } from "../externalLiquidityResolver";
|
|
7
|
+
import type { LendingPlatformClientRegistry } from "../lendingPlatformClients";
|
|
8
|
+
import type { PdaClient } from "../pda";
|
|
9
|
+
|
|
10
|
+
export interface LongYieldCarryBuilderContext {
|
|
11
|
+
rpc: Rpc<SolanaRpcApi>;
|
|
12
|
+
environment: Environment;
|
|
13
|
+
program: Program<LongYieldCarry>;
|
|
14
|
+
account: AccountClient;
|
|
15
|
+
pda: PdaClient;
|
|
16
|
+
swap: SwapClient;
|
|
17
|
+
externalLiquidityResolver: LongYieldCarryExternalLiquidityResolver;
|
|
18
|
+
lendingPlatformClients: LendingPlatformClientRegistry;
|
|
19
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// --- InterestDistribution ---
|
|
2
|
+
|
|
3
|
+
export type AnchorInterestDistribution = { intoTokenPrice: {} } | { intoWallets: {} };
|
|
4
|
+
|
|
5
|
+
export enum InterestDistribution {
|
|
6
|
+
IntoTokenPrice = 0,
|
|
7
|
+
IntoWallets = 1,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function interestDistributionToEnum(v: AnchorInterestDistribution): InterestDistribution {
|
|
11
|
+
if ("intoTokenPrice" in v) return InterestDistribution.IntoTokenPrice;
|
|
12
|
+
if ("intoWallets" in v) return InterestDistribution.IntoWallets;
|
|
13
|
+
throw new Error("Unknown InterestDistribution variant");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function enumToInterestDistribution(t: InterestDistribution): AnchorInterestDistribution {
|
|
17
|
+
switch (t) {
|
|
18
|
+
case InterestDistribution.IntoTokenPrice:
|
|
19
|
+
return { intoTokenPrice: {} };
|
|
20
|
+
case InterestDistribution.IntoWallets:
|
|
21
|
+
return { intoWallets: {} };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// --- LendingType ---
|
|
26
|
+
|
|
27
|
+
export type AnchorLendingType = { lendingMarket: {} } | { vault: {} };
|
|
28
|
+
|
|
29
|
+
export enum LendingType {
|
|
30
|
+
LendingMarket = 0,
|
|
31
|
+
Vault = 1,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function lendingTypeToEnum(v: AnchorLendingType): LendingType {
|
|
35
|
+
if ("lendingMarket" in v) return LendingType.LendingMarket;
|
|
36
|
+
if ("vault" in v) return LendingType.Vault;
|
|
37
|
+
throw new Error("Unknown LendingType variant");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function enumToLendingType(t: LendingType): AnchorLendingType {
|
|
41
|
+
switch (t) {
|
|
42
|
+
case LendingType.LendingMarket:
|
|
43
|
+
return { lendingMarket: {} };
|
|
44
|
+
case LendingType.Vault:
|
|
45
|
+
return { vault: {} };
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { type BN } from "@anchor-lang/core";
|
|
2
|
+
import { type Address } from "@solana/kit";
|
|
3
|
+
import { type AnchorOracleType } from "common";
|
|
4
|
+
import type { LYCToken } from "../../models/lycToken";
|
|
5
|
+
|
|
6
|
+
// =============================================================================
|
|
7
|
+
// Account snapshot types
|
|
8
|
+
// =============================================================================
|
|
9
|
+
|
|
10
|
+
/** Lightweight read-only snapshot of a `RedemptionEpoch` account. */
|
|
11
|
+
export interface RedemptionEpochSnapshot {
|
|
12
|
+
pda: Address;
|
|
13
|
+
tokenPda: Address;
|
|
14
|
+
epochId: bigint;
|
|
15
|
+
/** SOL rent payer recorded when the epoch PDA was first funded (`Pubkey.default` on legacy accounts). */
|
|
16
|
+
payer: Address;
|
|
17
|
+
status: number;
|
|
18
|
+
requestCount: number;
|
|
19
|
+
processedRequestCount: number;
|
|
20
|
+
grossCollateralClaim: bigint;
|
|
21
|
+
realizedUnwindLoss: bigint;
|
|
22
|
+
fundedCollateral: bigint;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// Shared param types
|
|
27
|
+
// =============================================================================
|
|
28
|
+
|
|
29
|
+
export interface OracleConfigDetails {
|
|
30
|
+
/** Oracle account address */
|
|
31
|
+
oracle: Address;
|
|
32
|
+
/** Oracle type */
|
|
33
|
+
oracleType: AnchorOracleType;
|
|
34
|
+
/** Optional secondary oracle account for composite oracle types (e.g. the
|
|
35
|
+
* SPL stake pool account for `PythSplStake`). Omit for single-account types. */
|
|
36
|
+
secondaryOracle?: Address;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Accounts required to reference a priced SPL mint: the mint itself, the
|
|
41
|
+
* SPL token program that governs it, and the oracle that prices it.
|
|
42
|
+
*/
|
|
43
|
+
export interface PricedMint {
|
|
44
|
+
mint: Address;
|
|
45
|
+
tokenProgram: Address;
|
|
46
|
+
oracle: Address;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface FeeConfig {
|
|
50
|
+
/** Management fee in basis points */
|
|
51
|
+
performanceFeeBps: number;
|
|
52
|
+
/** Minting fee in basis points */
|
|
53
|
+
mintingFeeBps: number;
|
|
54
|
+
/** Burning fee in basis points */
|
|
55
|
+
burningFeeBps: number;
|
|
56
|
+
/** Percentage of mint/burn fees that go to the protocol (in bps) */
|
|
57
|
+
protocolMintBurnPctBps: number;
|
|
58
|
+
/** Percentage of mint/burn fees that go to the curator (in bps) */
|
|
59
|
+
curatorMintBurnPctBps: number;
|
|
60
|
+
/** Curator's share of performance fees (in bps); protocol implicitly gets the rest. */
|
|
61
|
+
curatorPerfPctBps: number;
|
|
62
|
+
/**
|
|
63
|
+
* Cap (in bps) on the annualized token-price growth contributed by the fee
|
|
64
|
+
* drip. `0` disables the cap (release limited only by the linear rate).
|
|
65
|
+
* Omit to default to 200 bps on test/prod or `0` on local.
|
|
66
|
+
*/
|
|
67
|
+
feeDripMaxApyBps?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Duration (in seconds) over which absorbed mint/burn fees release into the
|
|
70
|
+
* price. `0` parks fees until recollateralization consumes them.
|
|
71
|
+
* Omit to default to three days on test/prod or parked-buffer mode on local.
|
|
72
|
+
*/
|
|
73
|
+
feeDripDurationSecs?: BN;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// =============================================================================
|
|
77
|
+
// Computed result types
|
|
78
|
+
// =============================================================================
|
|
79
|
+
|
|
80
|
+
/** Base-unit breakdown of the accounting effects of a mint. */
|
|
81
|
+
export interface MintAmounts {
|
|
82
|
+
tokensToUser: bigint;
|
|
83
|
+
protocolFee: bigint;
|
|
84
|
+
curatorFee: bigint;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Base-unit breakdown of the accounting effects of a burn. */
|
|
88
|
+
export interface BurnAmounts {
|
|
89
|
+
collateralToUser: bigint;
|
|
90
|
+
protocolFee: bigint;
|
|
91
|
+
curatorFee: bigint;
|
|
92
|
+
supplyReduction: bigint;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* A single LYC yToken position held by a wallet.
|
|
97
|
+
*
|
|
98
|
+
* Returned by `AccountClient.fetchUserHoldings`. `token` is the full
|
|
99
|
+
* {@link LYCToken} model so callers can access price, label, decimals, and all
|
|
100
|
+
* on-chain accounting without a second fetch.
|
|
101
|
+
*/
|
|
102
|
+
export interface UserHolding {
|
|
103
|
+
/** The LYC Token domain object (price, label, decimals, TVL, etc.). */
|
|
104
|
+
token: LYCToken;
|
|
105
|
+
/** User's ATA address for this yToken mint. */
|
|
106
|
+
tokenAccount: Address;
|
|
107
|
+
/** Raw balance in the yToken's smallest unit. */
|
|
108
|
+
balance: bigint;
|
|
109
|
+
/** Decimal-adjusted balance (e.g. `1.5` for 1.5 yTokens). */
|
|
110
|
+
uiBalance: number;
|
|
111
|
+
/**
|
|
112
|
+
* Wallet USD notional when the caller supplies a collateral USD price
|
|
113
|
+
* (`uiBalance × token.price × priceMap[collateralMint]`). Omitted if no
|
|
114
|
+
* usable collateral price was available.
|
|
115
|
+
*/
|
|
116
|
+
valueUsd?: number;
|
|
117
|
+
}
|
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import { type BN } from "@anchor-lang/core";
|
|
2
|
+
import { type Address } from "@solana/kit";
|
|
3
|
+
import { type AnchorInterestDistribution, type AnchorLendingType } from "./enums";
|
|
4
|
+
import { type OracleConfigDetails, type FeeConfig, type PricedMint } from "./general";
|
|
5
|
+
import {
|
|
6
|
+
type AnchorTokenProgram,
|
|
7
|
+
type AnchorLendingPlatform,
|
|
8
|
+
type AnchorOracleType,
|
|
9
|
+
type InstructionRefs,
|
|
10
|
+
type CustomAccountMeta,
|
|
11
|
+
AnchorExternalLiquidityType,
|
|
12
|
+
} from "common";
|
|
13
|
+
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// create_cpi_plan
|
|
16
|
+
// =============================================================================
|
|
17
|
+
|
|
18
|
+
export interface CreateCpiPlanParams {
|
|
19
|
+
/** Unique ID used in PDA derivation. For rebalance_token this is the Token PDA. */
|
|
20
|
+
uniqueId: Address;
|
|
21
|
+
/** Unix timestamp seconds used in PDA derivation. */
|
|
22
|
+
createdTs: BN;
|
|
23
|
+
/** Up to 10 instruction refs packed into the zero-copy CPI plan account. */
|
|
24
|
+
refs: InstructionRefs[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// =============================================================================
|
|
28
|
+
// create_yielding_bank
|
|
29
|
+
// =============================================================================
|
|
30
|
+
|
|
31
|
+
export interface CreateYieldingBankParams {
|
|
32
|
+
/** Unique ID for this yielding bank (u8), used in PDA derivation */
|
|
33
|
+
id: number;
|
|
34
|
+
/** Oracle configuration for pricing the base asset */
|
|
35
|
+
oracleConfig: OracleConfigDetails;
|
|
36
|
+
/** The mint used as the default source when redeeming from the bank */
|
|
37
|
+
defaultRedemptionMint: Address;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// update_yielding_bank_config
|
|
42
|
+
// =============================================================================
|
|
43
|
+
|
|
44
|
+
export interface UpdateYieldingBankConfigParams {
|
|
45
|
+
/** New default redemption mint (passed as a named account, not a param) */
|
|
46
|
+
defaultRedemptionMint: Address;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// =============================================================================
|
|
50
|
+
// update_token_configuration
|
|
51
|
+
// =============================================================================
|
|
52
|
+
|
|
53
|
+
export interface UpdateTokenConfigurationParams {
|
|
54
|
+
performanceFeeBps: number;
|
|
55
|
+
mintingFeeBps: number;
|
|
56
|
+
burningFeeBps: number;
|
|
57
|
+
protocolMintBurnPctBps: number;
|
|
58
|
+
curatorMintBurnPctBps: number;
|
|
59
|
+
curatorPerfPctBps: number;
|
|
60
|
+
/**
|
|
61
|
+
* Cap (bps) on annualized price growth from the fee drip; `0` disables.
|
|
62
|
+
* Omit to preserve the token's current on-chain value.
|
|
63
|
+
*/
|
|
64
|
+
feeDripMaxApyBps?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Seconds over which absorbed mint/burn fees release into the price.
|
|
67
|
+
* `0` parks fees until recollateralization consumes them.
|
|
68
|
+
* Omit to preserve the token's current on-chain value.
|
|
69
|
+
*/
|
|
70
|
+
feeDripDurationSecs?: BN;
|
|
71
|
+
burnRateLimit?: {
|
|
72
|
+
maxAmount: BN;
|
|
73
|
+
windowDurationSecs: BN;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* When set, updates the deposit cap in raw collateral base units. Omit to leave unchanged.
|
|
77
|
+
* Pass `new BN(0)` to disable the cap (same semantics as `mint_token`).
|
|
78
|
+
*/
|
|
79
|
+
depositLimit?: BN;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// =============================================================================
|
|
83
|
+
// create_token
|
|
84
|
+
// =============================================================================
|
|
85
|
+
|
|
86
|
+
export interface CreateTokenParams {
|
|
87
|
+
/** Unique ID for this token (u8), used in PDA derivation */
|
|
88
|
+
id: number;
|
|
89
|
+
/** How interest is distributed */
|
|
90
|
+
interestDistribution: AnchorInterestDistribution;
|
|
91
|
+
/** Oracle configuration for pricing the collateral asset */
|
|
92
|
+
oracleConfig: OracleConfigDetails;
|
|
93
|
+
/** Fee configuration */
|
|
94
|
+
feeConfig: FeeConfig;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// =============================================================================
|
|
98
|
+
// rebalance_yielding_bank
|
|
99
|
+
// =============================================================================
|
|
100
|
+
|
|
101
|
+
/** Configuration for the collateral or debt side of an external position */
|
|
102
|
+
export interface AssetAllocationConfig {
|
|
103
|
+
mint: Address;
|
|
104
|
+
decimals: number;
|
|
105
|
+
tokenProgram: AnchorTokenProgram;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Configuration for adding a new asset holding.
|
|
110
|
+
*
|
|
111
|
+
* `mint` resolves the `allocation_mint` account — it is not serialized as an
|
|
112
|
+
* instruction param. Decimals and token program are read from the mint
|
|
113
|
+
* account on-chain.
|
|
114
|
+
*/
|
|
115
|
+
export interface AssetConfig {
|
|
116
|
+
mint: Address;
|
|
117
|
+
oracle: Address;
|
|
118
|
+
oracleType: AnchorOracleType;
|
|
119
|
+
externalLiquidityType: AnchorExternalLiquidityType;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Configuration for adding a new external yielding position */
|
|
123
|
+
export interface ExternalPositionConfig {
|
|
124
|
+
lendingPlatform: AnchorLendingPlatform;
|
|
125
|
+
lendingType: AnchorLendingType;
|
|
126
|
+
pool: Address;
|
|
127
|
+
collateralReserve: Address;
|
|
128
|
+
debtReserve: Address;
|
|
129
|
+
protocolUserAcc: Address;
|
|
130
|
+
collateral: AssetAllocationConfig;
|
|
131
|
+
debt: AssetAllocationConfig;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Registers one new holding or external position before a rebalance.
|
|
136
|
+
* At most one of `assetHolding` or `externalPosition` may be set per call.
|
|
137
|
+
*/
|
|
138
|
+
export interface YieldingBankAllocationConfig {
|
|
139
|
+
assetHolding?: AssetConfig;
|
|
140
|
+
externalPosition?: ExternalPositionConfig;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface RebalanceYieldingBankParams {
|
|
144
|
+
/**
|
|
145
|
+
* Pre-built instruction refs containing deduplicated CPI account indices,
|
|
146
|
+
* CPI type registry indices, and packed args.
|
|
147
|
+
*
|
|
148
|
+
* Build with `createCpiRefs(cpis, { initialAccounts: oracleAccounts })` so
|
|
149
|
+
* that oracle and CPI accounts are deduplicated into a single pool and the
|
|
150
|
+
* indices in `ixRefs` already account for the oracle account positions.
|
|
151
|
+
*/
|
|
152
|
+
ixRefs: InstructionRefs;
|
|
153
|
+
/**
|
|
154
|
+
* The fully deduplicated remaining-accounts pool for this instruction —
|
|
155
|
+
* oracle accounts at the front followed by any CPI-only accounts.
|
|
156
|
+
*
|
|
157
|
+
* This is the `accounts` array returned by `createCpiRefs` when called with
|
|
158
|
+
* `initialAccounts: oracleAccounts`.
|
|
159
|
+
*/
|
|
160
|
+
remainingAccounts: CustomAccountMeta[];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// =============================================================================
|
|
164
|
+
// create_token_lending_position
|
|
165
|
+
// =============================================================================
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Parameters for `createTokenLendingPosition`. Account-backed values (protocol
|
|
169
|
+
* user account, collateral reserve, debt oracle) are passed as accounts via
|
|
170
|
+
* `CreateTokenLendingPositionIxArgs.lpPosition`, not duplicated here.
|
|
171
|
+
*/
|
|
172
|
+
export interface CreateTokenLendingPositionParams {
|
|
173
|
+
lendingPlatform: AnchorLendingPlatform;
|
|
174
|
+
pool: Address;
|
|
175
|
+
debtReserve: Address;
|
|
176
|
+
targetUtilizationRateBps: number;
|
|
177
|
+
maxDeviationAboveTargetUtilBps: number;
|
|
178
|
+
maxDeviationBelowTargetUtilBps: number;
|
|
179
|
+
debtMint: Address;
|
|
180
|
+
debtDecimals: number;
|
|
181
|
+
debtTokenProgram: AnchorTokenProgram;
|
|
182
|
+
debtOracleType: AnchorOracleType;
|
|
183
|
+
/**
|
|
184
|
+
* Optional setup CPIs (e.g. Kamino init_user_metadata, init_obligation,
|
|
185
|
+
* refresh_reserve, refresh_obligation) signed by the Token PDA and executed
|
|
186
|
+
* before the final refresh. When provided, the on-chain refresh reads the
|
|
187
|
+
* freshly-initialized protocol user account; otherwise the refresh is a
|
|
188
|
+
* no-op over an empty account.
|
|
189
|
+
*/
|
|
190
|
+
tokenCpis?: InstructionRefs;
|
|
191
|
+
/** Fully deduplicated remaining-accounts pool for `tokenCpis`. */
|
|
192
|
+
remainingAccounts?: CustomAccountMeta[];
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Accounts that describe and back a new lending position. Their pubkeys are
|
|
197
|
+
* stored on the position; their on-chain state is read by the final refresh.
|
|
198
|
+
*/
|
|
199
|
+
export interface CreateTokenLendingPositionAccounts {
|
|
200
|
+
/** The program's user/authority account on the lending protocol. */
|
|
201
|
+
protocolUserAcc: Address;
|
|
202
|
+
/** The lending protocol's reserve/bank for the collateral asset. */
|
|
203
|
+
collateralReserve: Address;
|
|
204
|
+
/** Oracle for the debt asset's price. */
|
|
205
|
+
debtOracle: Address;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// =============================================================================
|
|
209
|
+
// update_lending_position_config
|
|
210
|
+
// =============================================================================
|
|
211
|
+
|
|
212
|
+
export interface UpdateLendingPositionConfigParams {
|
|
213
|
+
lendingPositionIndex: number;
|
|
214
|
+
targetUtilizationRateBps: number;
|
|
215
|
+
maxDeviationAboveTargetUtilBps: number;
|
|
216
|
+
maxDeviationBelowTargetUtilBps: number;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// =============================================================================
|
|
220
|
+
// deposit_unlent_collateral
|
|
221
|
+
// =============================================================================
|
|
222
|
+
|
|
223
|
+
export interface DepositUnlentCollateralParams {
|
|
224
|
+
/** Pre-built deposit CPI refs (must contain exactly one Deposit CPI). */
|
|
225
|
+
ixRefs: InstructionRefs;
|
|
226
|
+
/** Index into the token's lending_positions array for the target position. */
|
|
227
|
+
lendingPositionIndex: number;
|
|
228
|
+
/** Fully deduplicated remaining-accounts pool for the deposit CPI. */
|
|
229
|
+
remainingAccounts: CustomAccountMeta[];
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// =============================================================================
|
|
233
|
+
// increase_carry_position
|
|
234
|
+
// =============================================================================
|
|
235
|
+
|
|
236
|
+
export interface IncreaseCarryPositionParams {
|
|
237
|
+
/** Optional prerequisite CPIs executed before any lending-position refresh. */
|
|
238
|
+
prerequisiteCpis?: InstructionRefs;
|
|
239
|
+
/** Pre-built borrow CPI refs (must contain exactly one Borrow CPI). */
|
|
240
|
+
ixRefs: InstructionRefs;
|
|
241
|
+
/** Index into the token's lending_positions array for the position to borrow against. */
|
|
242
|
+
lendingPositionIndex: number;
|
|
243
|
+
/**
|
|
244
|
+
* The fully deduplicated remaining-accounts pool for the borrow CPI.
|
|
245
|
+
* Carry-trade accounts (token, yieldingBank, tokenLpDebtTa, yieldingBankTa,
|
|
246
|
+
* lendingPositionUserAccount, lendingPositionCollateralReserve, debtOracle,
|
|
247
|
+
* debtTokenProgram) are prepended automatically.
|
|
248
|
+
*/
|
|
249
|
+
remainingAccounts: CustomAccountMeta[];
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// =============================================================================
|
|
253
|
+
// claim_incentives
|
|
254
|
+
// =============================================================================
|
|
255
|
+
|
|
256
|
+
export interface ClaimIncentivesParams {
|
|
257
|
+
/** Optional prerequisite CPIs (reserve / obligation refresh) executed before the claim CPI. */
|
|
258
|
+
prerequisiteCpis?: InstructionRefs;
|
|
259
|
+
/** Pre-built Kamino claim-incentive CPI refs. */
|
|
260
|
+
tokenIxRefs: InstructionRefs;
|
|
261
|
+
/** Index into the token's lending_positions array. */
|
|
262
|
+
lendingPositionIndex: number;
|
|
263
|
+
/** Incentive reward mint expected to be claimed. */
|
|
264
|
+
expectedIncentiveMint: Address;
|
|
265
|
+
/** Token program for the incentive mint. */
|
|
266
|
+
incentiveTokenProgram: Address;
|
|
267
|
+
/** Oracle type for `incentiveOracle`. Required on debt and collateral branches. */
|
|
268
|
+
incentiveOracleType: AnchorOracleType;
|
|
269
|
+
/**
|
|
270
|
+
* Yielding bank that receives the claimed rewards and mints carry shares.
|
|
271
|
+
* Required on the debt branch; null otherwise.
|
|
272
|
+
*/
|
|
273
|
+
yieldingBank: Address | null;
|
|
274
|
+
/**
|
|
275
|
+
* Oracle pricing `expectedIncentiveMint`. Required on the debt and
|
|
276
|
+
* collateral branches; null on the fee branch.
|
|
277
|
+
*/
|
|
278
|
+
incentiveOracle: Address | null;
|
|
279
|
+
/**
|
|
280
|
+
* Optional curator fee wallet override. When null/omitted, builders resolve
|
|
281
|
+
* `token.roles.curator_fee_wallet()` and still pass the fee wallet accounts.
|
|
282
|
+
*/
|
|
283
|
+
feeWallet?: Address | null;
|
|
284
|
+
/** Fully deduplicated remaining-accounts pool for the claim CPI. */
|
|
285
|
+
remainingAccounts: CustomAccountMeta[];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// =============================================================================
|
|
289
|
+
// rebalance_token
|
|
290
|
+
// =============================================================================
|
|
291
|
+
|
|
292
|
+
export interface TokenLpPositionAccountOverrides {
|
|
293
|
+
/** Override for the lending position protocol user account. */
|
|
294
|
+
userAccount?: Address;
|
|
295
|
+
/** Override for the lending position collateral reserve. */
|
|
296
|
+
collateralReserve?: Address;
|
|
297
|
+
/** Override for the lending position debt oracle. */
|
|
298
|
+
debtOracle?: Address;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface RebalanceTokenParams {
|
|
302
|
+
/** Index into the token's lending_positions array for the position to rebalance in place. */
|
|
303
|
+
lpIndex: number;
|
|
304
|
+
/** Oracle type for the destination debt mint. Used to update the stored oracle_type after swapping debt in place. */
|
|
305
|
+
destinationDebtOracleType: AnchorOracleType;
|
|
306
|
+
/**
|
|
307
|
+
* Flash-loan fee in source-debt base units. The on-chain handler derives
|
|
308
|
+
* the total flash-repay amount from this plus the source-debt ATA balance
|
|
309
|
+
* observed at handler entry (= what Kamino actually flash-borrowed),
|
|
310
|
+
* caps it at 5 bps of the principal as a sanity check, and uses it as
|
|
311
|
+
* the post-swap balance threshold + dust-sweep cutoff + SPL Approve
|
|
312
|
+
* delegation amount.
|
|
313
|
+
*/
|
|
314
|
+
flashFeeAmount: BN;
|
|
315
|
+
/**
|
|
316
|
+
* Source LP repay amount in the flash-borrowed mint's base units. The on-chain
|
|
317
|
+
* handler injects this into the repay CPI loaded from the CPI plan.
|
|
318
|
+
*/
|
|
319
|
+
repayAmount: BN;
|
|
320
|
+
/** CPI plan PDA holding refs in order: repay, borrow, swap. */
|
|
321
|
+
cpiPlan: Address;
|
|
322
|
+
/**
|
|
323
|
+
* Fully deduplicated remaining-accounts pool. The first 7 slots must hold
|
|
324
|
+
* the rebalance-token initial accounts (see `buildRebalanceTokenInitialAccounts`),
|
|
325
|
+
* followed by any CPI accounts referenced by the CPI plan's refs.
|
|
326
|
+
*/
|
|
327
|
+
remainingAccounts: CustomAccountMeta[];
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// =============================================================================
|
|
331
|
+
// decrease_carry_position
|
|
332
|
+
// =============================================================================
|
|
333
|
+
|
|
334
|
+
export interface DecreaseCarryPositionParams {
|
|
335
|
+
/** Optional prerequisite CPIs executed before any lending-position refresh. */
|
|
336
|
+
prerequisiteCpis?: InstructionRefs;
|
|
337
|
+
/**
|
|
338
|
+
* Optional manager-only target utilization override used for the post-repay
|
|
339
|
+
* utilization check.
|
|
340
|
+
*/
|
|
341
|
+
targetUtilizationRateBps?: number;
|
|
342
|
+
/**
|
|
343
|
+
* Optional CPI refs for yielding-bank operations (withdraw from external
|
|
344
|
+
* positions, swap yield-bearing asset into debt token). Omit this when the
|
|
345
|
+
* yielding bank already holds the debt tokens.
|
|
346
|
+
*/
|
|
347
|
+
ybIxRefs?: InstructionRefs;
|
|
348
|
+
/** Pre-built repay CPI refs (must contain exactly one Repay CPI). */
|
|
349
|
+
tokenIxRefs: InstructionRefs;
|
|
350
|
+
/** Index into the token's lending_positions array for the position to repay. */
|
|
351
|
+
lendingPositionIndex: number;
|
|
352
|
+
/**
|
|
353
|
+
* Amount of debt tokens to repay. When omitted, `ybIxRefs` must be provided
|
|
354
|
+
* and the amount is derived from the yielding bank TA balance change.
|
|
355
|
+
* `AMOUNT_ALL_SENTINEL` repays the maximum available amount, capped by
|
|
356
|
+
* current debt. When set with `ybIxRefs`, the on-chain instruction only swaps
|
|
357
|
+
* if the yielding bank is short and caps non-manager swap over-output.
|
|
358
|
+
*/
|
|
359
|
+
repayAmount?: BN;
|
|
360
|
+
/**
|
|
361
|
+
* Index of the asset holding used as the swap source (0 = base_asset,
|
|
362
|
+
* 1–12 = assets[0–11]). Required when `ybIxRefs` is provided.
|
|
363
|
+
* Non-manager signers may only specify a holding whose mint matches the
|
|
364
|
+
* bank's `default_redemption_mint`.
|
|
365
|
+
*/
|
|
366
|
+
sourceAssetHoldingIndex?: number;
|
|
367
|
+
/** Optional redemption epoch that absorbs DCP unwind loss for async burns. */
|
|
368
|
+
redemptionEpoch?: Address;
|
|
369
|
+
/**
|
|
370
|
+
* The fully deduplicated remaining-accounts pool for the CPIs.
|
|
371
|
+
* Carry-trade accounts (token, yieldingBank, tokenLpDebtTa, yieldingBankTa,
|
|
372
|
+
* lendingPositionUserAccount, lendingPositionCollateralReserve, debtOracle,
|
|
373
|
+
* debtTokenProgram) are prepended automatically.
|
|
374
|
+
*/
|
|
375
|
+
remainingAccounts: CustomAccountMeta[];
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// =============================================================================
|
|
379
|
+
// burn_token
|
|
380
|
+
// =============================================================================
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Low-level params for `ix.burnToken`. Pre-built refs and accounts must be
|
|
384
|
+
* assembled by the caller (typically `tx.getBurnTokenTx`).
|
|
385
|
+
*/
|
|
386
|
+
export interface BurnTokenIxParams {
|
|
387
|
+
burnAmount: BN | number;
|
|
388
|
+
asyncFallback?: {
|
|
389
|
+
epochId: BN | number;
|
|
390
|
+
requestSequence: BN | number;
|
|
391
|
+
redemptionEpoch?: Address;
|
|
392
|
+
request?: Address;
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export interface SetRedemptionEpochStatusParams {
|
|
397
|
+
status: number;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export interface TopUpUnlentReservesParams {
|
|
401
|
+
prerequisiteCpis: InstructionRefs;
|
|
402
|
+
ixRefs: InstructionRefs;
|
|
403
|
+
lendingPositionIndex: number;
|
|
404
|
+
remainingAccounts: CustomAccountMeta[];
|
|
405
|
+
redemptionEpoch?: Address;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// =============================================================================
|
|
409
|
+
// update_token_metadata
|
|
410
|
+
// =============================================================================
|
|
411
|
+
|
|
412
|
+
export interface UpdateTokenMetadataParams {
|
|
413
|
+
/** Pre-built Metaplex UpdateMetadataAccountV2 CPI refs (exactly one CPI). */
|
|
414
|
+
ixRefs: InstructionRefs;
|
|
415
|
+
/** Fully deduplicated remaining-accounts pool for the metadata CPI. */
|
|
416
|
+
remainingAccounts: CustomAccountMeta[];
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// =============================================================================
|
|
420
|
+
// recollateralize_loss
|
|
421
|
+
// =============================================================================
|
|
422
|
+
|
|
423
|
+
export interface RecollateralizeLossParams {
|
|
424
|
+
/** Optional prerequisite CPIs executed before any lending-position refresh. */
|
|
425
|
+
prerequisiteCpis?: InstructionRefs;
|
|
426
|
+
/**
|
|
427
|
+
* CPI refs for the Withdraw -> Swap -> Repay sequence (exactly 1 of each,
|
|
428
|
+
* in that order). All three CPIs share one deduplicated account pool.
|
|
429
|
+
*/
|
|
430
|
+
ixRefs: InstructionRefs;
|
|
431
|
+
/** Index into the token's lending_positions array. */
|
|
432
|
+
lendingPositionIndex: number;
|
|
433
|
+
/** Fully deduplicated remaining-accounts pool for the withdraw/swap/repay CPIs. */
|
|
434
|
+
remainingAccounts: CustomAccountMeta[];
|
|
435
|
+
/** Yielding bank to deposit any excess debt tokens after repay. Required for execution; may be omitted when testing pre-condition failures. */
|
|
436
|
+
yieldingBank?: Address;
|
|
437
|
+
/** Optional explicit overrides for LP refresh accounts. */
|
|
438
|
+
lpPosition?: TokenLpPositionAccountOverrides;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// =============================================================================
|
|
442
|
+
// collect_interest
|
|
443
|
+
// =============================================================================
|
|
444
|
+
|
|
445
|
+
export interface CollectInterestParams {
|
|
446
|
+
/** Default redemption asset being sold in the swap. */
|
|
447
|
+
redemption: PricedMint;
|
|
448
|
+
/** Pre-built swap CPI refs (yielding bank assets -> collateral). */
|
|
449
|
+
refs: InstructionRefs;
|
|
450
|
+
/** Fully deduplicated remaining-accounts pool for the swap CPIs. */
|
|
451
|
+
remainingAccounts: CustomAccountMeta[];
|
|
452
|
+
}
|