@kamino-finance/kliquidity-sdk 8.4.5 → 8.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@codegen/kliquidity/instructions/addKaminoRewards.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/addKaminoRewards.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/changePool.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/changePool.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/checkExpectedVaultsBalances.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/checkExpectedVaultsBalances.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/closeProgramAccount.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/closeProgramAccount.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/closeStrategy.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/closeStrategy.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/collectFeesAndRewards.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/collectFeesAndRewards.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/deposit.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/deposit.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/depositAndInvest.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/depositAndInvest.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/emergencySwap.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/emergencySwap.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/executiveWithdraw.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/executiveWithdraw.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/flashSwapUnevenVaultsEnd.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/flashSwapUnevenVaultsEnd.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/flashSwapUnevenVaultsStart.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/flashSwapUnevenVaultsStart.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/initializeCollateralInfo.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/initializeCollateralInfo.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/initializeGlobalConfig.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/initializeGlobalConfig.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/initializeKaminoReward.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/initializeKaminoReward.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/initializeSharesMetadata.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/initializeSharesMetadata.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/initializeStrategy.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/initializeStrategy.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/insertCollateralInfo.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/insertCollateralInfo.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/invest.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/invest.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/openLiquidityPosition.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/openLiquidityPosition.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/orcaSwap.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/orcaSwap.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/permisionlessWithdrawFromTreasury.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/permisionlessWithdrawFromTreasury.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/signTerms.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/signTerms.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/singleTokenDepositAndInvestWithMin.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/singleTokenDepositAndInvestWithMin.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/singleTokenDepositWithMin.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/singleTokenDepositWithMin.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/swapRewards.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/swapRewards.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/updateCollateralInfo.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/updateCollateralInfo.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/updateGlobalConfig.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/updateGlobalConfig.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/updateRewardMapping.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/updateRewardMapping.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/updateSharesMetadata.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/updateSharesMetadata.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/updateStrategyAdmin.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/updateStrategyAdmin.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/updateStrategyConfig.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/updateStrategyConfig.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/updateTreasuryFeeVault.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/updateTreasuryFeeVault.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/withdraw.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/withdraw.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/withdrawFromTopup.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/withdrawFromTopup.d.ts.map +1 -1
- package/dist/@codegen/kliquidity/instructions/withdrawFromTreasury.d.ts +2 -2
- package/dist/@codegen/kliquidity/instructions/withdrawFromTreasury.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/addLiquidity.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/addLiquidity.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/addLiquidityByStrategy.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/addLiquidityByStrategy.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/addLiquidityByStrategyOneSide.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/addLiquidityByStrategyOneSide.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/addLiquidityByWeight.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/addLiquidityByWeight.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/addLiquidityOneSide.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/addLiquidityOneSide.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/addLiquidityOneSidePrecise.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/addLiquidityOneSidePrecise.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/claimFee.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/claimFee.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/claimReward.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/claimReward.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/closePosition.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/closePosition.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/closePresetParameter.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/closePresetParameter.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/fundReward.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/fundReward.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/goToABin.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/goToABin.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/increaseOracleLength.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/increaseOracleLength.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/initializeBinArray.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/initializeBinArray.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/initializeBinArrayBitmapExtension.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/initializeBinArrayBitmapExtension.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/initializeLbPair.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/initializeLbPair.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/initializePermissionLbPair.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/initializePermissionLbPair.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/initializePosition.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/initializePosition.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/initializePositionByOperator.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/initializePositionByOperator.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/initializePositionPda.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/initializePositionPda.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/initializePresetParameter.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/initializePresetParameter.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/initializeReward.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/initializeReward.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/migrateBinArray.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/migrateBinArray.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/migratePosition.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/migratePosition.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/removeAllLiquidity.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/removeAllLiquidity.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/removeLiquidity.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/removeLiquidity.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/removeLiquidityByRange.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/removeLiquidityByRange.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/setActivationSlot.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/setActivationSlot.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/setLockReleaseSlot.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/setLockReleaseSlot.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/setPreActivationSlotDuration.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/setPreActivationSlotDuration.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/setPreActivationSwapAddress.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/setPreActivationSwapAddress.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/swap.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/swap.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/togglePairStatus.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/togglePairStatus.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/updateFeeOwner.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/updateFeeOwner.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/updateFeeParameters.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/updateFeeParameters.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/updateFeesAndRewards.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/updateFeesAndRewards.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/updatePositionOperator.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/updatePositionOperator.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/updateRewardDuration.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/updateRewardDuration.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/updateRewardFunder.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/updateRewardFunder.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/updateWhitelistedWallet.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/updateWhitelistedWallet.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/withdrawIneligibleReward.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/withdrawIneligibleReward.d.ts.map +1 -1
- package/dist/@codegen/meteora/instructions/withdrawProtocolFee.d.ts +2 -2
- package/dist/@codegen/meteora/instructions/withdrawProtocolFee.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/closePosition.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/closePosition.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/collectFundFee.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/collectFundFee.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/collectProtocolFee.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/collectProtocolFee.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/collectRemainingRewards.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/collectRemainingRewards.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/createAmmConfig.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/createAmmConfig.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/createOperationAccount.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/createOperationAccount.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/createPool.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/createPool.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/decreaseLiquidity.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/decreaseLiquidity.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/decreaseLiquidityV2.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/decreaseLiquidityV2.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/increaseLiquidity.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/increaseLiquidity.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/increaseLiquidityV2.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/increaseLiquidityV2.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/initializeReward.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/initializeReward.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/openPosition.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/openPosition.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/openPositionV2.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/openPositionV2.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/setRewardParams.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/setRewardParams.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/swap.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/swap.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/swapRouterBaseIn.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/swapRouterBaseIn.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/swapV2.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/swapV2.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/transferRewardOwner.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/transferRewardOwner.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/updateAmmConfig.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/updateAmmConfig.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/updateOperationAccount.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/updateOperationAccount.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/updatePoolStatus.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/updatePoolStatus.d.ts.map +1 -1
- package/dist/@codegen/raydium/instructions/updateRewardInfos.d.ts +2 -2
- package/dist/@codegen/raydium/instructions/updateRewardInfos.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/closeBundledPosition.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/closeBundledPosition.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/closePosition.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/closePosition.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/collectFees.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/collectFees.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/collectFeesV2.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/collectFeesV2.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/collectProtocolFees.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/collectProtocolFees.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/collectProtocolFeesV2.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/collectProtocolFeesV2.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/collectReward.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/collectReward.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/collectRewardV2.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/collectRewardV2.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/decreaseLiquidity.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/decreaseLiquidity.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/decreaseLiquidityV2.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/decreaseLiquidityV2.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/deletePositionBundle.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/deletePositionBundle.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/deleteTokenBadge.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/deleteTokenBadge.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/increaseLiquidity.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/increaseLiquidity.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/increaseLiquidityV2.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/increaseLiquidityV2.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/initializeConfig.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/initializeConfig.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/initializeConfigExtension.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/initializeConfigExtension.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/initializeFeeTier.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/initializeFeeTier.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/initializePool.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/initializePool.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/initializePoolV2.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/initializePoolV2.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/initializePositionBundle.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/initializePositionBundle.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/initializePositionBundleWithMetadata.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/initializePositionBundleWithMetadata.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/initializeReward.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/initializeReward.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/initializeRewardV2.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/initializeRewardV2.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/initializeTickArray.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/initializeTickArray.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/initializeTokenBadge.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/initializeTokenBadge.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/openBundledPosition.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/openBundledPosition.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/openPosition.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/openPosition.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/openPositionWithMetadata.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/openPositionWithMetadata.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setCollectProtocolFeesAuthority.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setCollectProtocolFeesAuthority.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setConfigExtensionAuthority.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setConfigExtensionAuthority.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setDefaultFeeRate.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setDefaultFeeRate.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setDefaultProtocolFeeRate.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setDefaultProtocolFeeRate.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setFeeAuthority.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setFeeAuthority.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setFeeRate.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setFeeRate.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setProtocolFeeRate.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setProtocolFeeRate.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setRewardAuthority.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setRewardAuthority.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setRewardAuthorityBySuperAuthority.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setRewardAuthorityBySuperAuthority.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setRewardEmissions.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setRewardEmissions.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setRewardEmissionsSuperAuthority.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setRewardEmissionsSuperAuthority.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setRewardEmissionsV2.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setRewardEmissionsV2.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/setTokenBadgeAuthority.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/setTokenBadgeAuthority.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/swap.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/swap.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/swapV2.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/swapV2.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/twoHopSwap.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/twoHopSwap.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/twoHopSwapV2.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/twoHopSwapV2.d.ts.map +1 -1
- package/dist/@codegen/whirlpools/instructions/updateFeesAndRewards.d.ts +2 -2
- package/dist/@codegen/whirlpools/instructions/updateFeesAndRewards.d.ts.map +1 -1
- package/dist/Kamino.d.ts +35 -39
- package/dist/Kamino.d.ts.map +1 -1
- package/dist/Kamino.js +3 -7
- package/dist/Kamino.js.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/services/JupService.d.ts +11 -11
- package/dist/services/JupService.d.ts.map +1 -1
- package/dist/services/JupService.js.map +1 -1
- package/dist/services/MeteoraPoolsResponse.d.ts +60 -0
- package/dist/services/MeteoraPoolsResponse.d.ts.map +1 -0
- package/dist/services/MeteoraPoolsResponse.js +3 -0
- package/dist/services/MeteoraPoolsResponse.js.map +1 -0
- package/dist/services/MeteoraService.d.ts +3 -0
- package/dist/services/MeteoraService.d.ts.map +1 -1
- package/dist/services/MeteoraService.js +55 -0
- package/dist/services/MeteoraService.js.map +1 -1
- package/dist/services/OrcaService.d.ts +1 -2
- package/dist/services/OrcaService.d.ts.map +1 -1
- package/dist/services/OrcaService.js +1 -1
- package/dist/services/OrcaService.js.map +1 -1
- package/dist/services/RaydiumService.d.ts +17 -5
- package/dist/services/RaydiumService.d.ts.map +1 -1
- package/dist/services/RaydiumService.js +245 -9
- package/dist/services/RaydiumService.js.map +1 -1
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +2 -0
- package/dist/services/index.js.map +1 -1
- package/dist/utils/jupiter.d.ts +3 -3
- package/dist/utils/jupiter.d.ts.map +1 -1
- package/dist/utils/jupiter.js +5 -5
- package/dist/utils/jupiter.js.map +1 -1
- package/dist/utils/tokenUtils.d.ts +8 -3
- package/dist/utils/tokenUtils.d.ts.map +1 -1
- package/dist/utils/tokenUtils.js +27 -5
- package/dist/utils/tokenUtils.js.map +1 -1
- package/dist/utils/transactions.d.ts +5 -5
- package/dist/utils/transactions.d.ts.map +1 -1
- package/dist/utils/transactions.js.map +1 -1
- package/dist/utils/types.d.ts +15 -15
- package/dist/utils/types.d.ts.map +1 -1
- package/dist/utils/types.js.map +1 -1
- package/dist/utils/utils.d.ts +5 -2
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +16 -0
- package/dist/utils/utils.js.map +1 -1
- package/package.json +1 -2
- package/src/Kamino.ts +49 -56
- package/src/constants/index.ts +1 -0
- package/src/services/JupService.ts +17 -12
- package/src/services/MeteoraPoolsResponse.ts +61 -0
- package/src/services/MeteoraService.ts +64 -1
- package/src/services/OrcaService.ts +0 -2
- package/src/services/RaydiumService.ts +334 -18
- package/src/services/index.ts +2 -0
- package/src/utils/jupiter.ts +4 -4
- package/src/utils/tokenUtils.ts +39 -7
- package/src/utils/transactions.ts +9 -9
- package/src/utils/types.ts +15 -15
- package/src/utils/utils.ts +17 -2
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Account,
|
|
3
|
+
address,
|
|
4
|
+
Address,
|
|
5
|
+
Base58EncodedBytes,
|
|
6
|
+
getAddressEncoder,
|
|
7
|
+
getProgramDerivedAddress,
|
|
8
|
+
ProgramDerivedAddress,
|
|
9
|
+
Rpc,
|
|
10
|
+
SolanaRpcApi,
|
|
11
|
+
} from '@solana/kit';
|
|
2
12
|
import {
|
|
3
13
|
LiquidityDistribution as RaydiumLiquidityDistribuion,
|
|
4
14
|
Pool,
|
|
@@ -12,8 +22,14 @@ import {
|
|
|
12
22
|
aprToApy,
|
|
13
23
|
GenericPoolInfo,
|
|
14
24
|
getStrategyPriceRangeRaydium,
|
|
25
|
+
getTokenAccountBalanceLamports,
|
|
15
26
|
LiquidityDistribution,
|
|
16
27
|
LiquidityForPrice,
|
|
28
|
+
optionGetValue,
|
|
29
|
+
optionGetValueOrUndefined,
|
|
30
|
+
solToWSol,
|
|
31
|
+
toLegacyPublicKey,
|
|
32
|
+
WSOL_MINT,
|
|
17
33
|
ZERO,
|
|
18
34
|
} from '../utils';
|
|
19
35
|
import axios from 'axios';
|
|
@@ -22,24 +38,30 @@ import { PROGRAM_ID as RAYDIUM_PROGRAM_ID } from '../@codegen/raydium/programId'
|
|
|
22
38
|
import { priceToTickIndexWithRounding } from '../utils/raydium';
|
|
23
39
|
import {
|
|
24
40
|
ApiV3PoolInfoConcentratedItem,
|
|
25
|
-
|
|
41
|
+
ClmmConfigLayout,
|
|
42
|
+
ClmmRpcData,
|
|
43
|
+
ComputeClmmPoolInfo,
|
|
44
|
+
POOL_TICK_ARRAY_BITMAP_SEED,
|
|
45
|
+
PoolInfoLayout,
|
|
26
46
|
PoolUtils,
|
|
27
47
|
PositionInfoLayout,
|
|
28
|
-
|
|
29
|
-
|
|
48
|
+
ReturnTypeFetchExBitmaps,
|
|
49
|
+
ReturnTypeFetchMultipleMintInfos,
|
|
50
|
+
ReturnTypeGetTickPrice,
|
|
30
51
|
SqrtPriceMath,
|
|
52
|
+
TickArrayBitmapExtensionLayout,
|
|
31
53
|
TickMath,
|
|
32
54
|
} from '@raydium-io/raydium-sdk-v2/lib';
|
|
33
|
-
import {
|
|
55
|
+
import { fromLegacyPublicKey } from '@solana/compat';
|
|
56
|
+
import { fetchAllMint, Mint } from '@solana-program/token-2022';
|
|
57
|
+
import { DEFAULT_PUBLIC_KEY } from '../constants/pubkeys';
|
|
34
58
|
|
|
35
59
|
export class RaydiumService {
|
|
36
60
|
private readonly _rpc: Rpc<SolanaRpcApi>;
|
|
37
|
-
private readonly _legacyConnection: Connection;
|
|
38
61
|
private readonly _raydiumProgramId: Address;
|
|
39
62
|
|
|
40
|
-
constructor(rpc: Rpc<SolanaRpcApi>,
|
|
63
|
+
constructor(rpc: Rpc<SolanaRpcApi>, raydiumProgramId: Address = RAYDIUM_PROGRAM_ID) {
|
|
41
64
|
this._rpc = rpc;
|
|
42
|
-
this._legacyConnection = legacyConnection;
|
|
43
65
|
this._raydiumProgramId = raydiumProgramId;
|
|
44
66
|
}
|
|
45
67
|
|
|
@@ -52,12 +74,7 @@ export class RaydiumService {
|
|
|
52
74
|
}
|
|
53
75
|
|
|
54
76
|
async getRaydiumPoolInfo(poolPubkey: Address): Promise<ApiV3PoolInfoConcentratedItem> {
|
|
55
|
-
|
|
56
|
-
const raydium = await Raydium.load(raydiumLoadParams);
|
|
57
|
-
const rayClmm = new Clmm({ scope: raydium, moduleName: '' });
|
|
58
|
-
const otherPoolInfo = await rayClmm.getPoolInfoFromRpc(poolPubkey.toString());
|
|
59
|
-
console.log('otherPoolInfo', otherPoolInfo);
|
|
60
|
-
return otherPoolInfo.poolInfo;
|
|
77
|
+
return this.getPoolInfoFromRpc(poolPubkey.toString());
|
|
61
78
|
}
|
|
62
79
|
|
|
63
80
|
async getRaydiumPoolLiquidityDistribution(
|
|
@@ -179,7 +196,7 @@ export class RaydiumService {
|
|
|
179
196
|
const { apr, feeApr, rewardsApr } = PoolUtils.estimateAprsForPriceRangeMultiplier(params);
|
|
180
197
|
const totalApr = new Decimal(apr).div(100);
|
|
181
198
|
const fee = new Decimal(feeApr).div(100);
|
|
182
|
-
const rewards = rewardsApr.map((reward) => new Decimal(reward).div(100));
|
|
199
|
+
const rewards = rewardsApr.map((reward: number) => new Decimal(reward).div(100));
|
|
183
200
|
|
|
184
201
|
return {
|
|
185
202
|
totalApr,
|
|
@@ -187,7 +204,7 @@ export class RaydiumService {
|
|
|
187
204
|
feeApr: fee,
|
|
188
205
|
feeApy: aprToApy(fee, 365),
|
|
189
206
|
rewardsApr: rewards,
|
|
190
|
-
rewardsApy: rewards.map((x) => aprToApy(x, 365)),
|
|
207
|
+
rewardsApy: rewards.map((x: Decimal) => aprToApy(x, 365)),
|
|
191
208
|
...priceRange,
|
|
192
209
|
};
|
|
193
210
|
};
|
|
@@ -265,7 +282,7 @@ export class RaydiumService {
|
|
|
265
282
|
const { apr, feeApr, rewardsApr } = PoolUtils.estimateAprsForPriceRangeMultiplier(params);
|
|
266
283
|
const totalApr = new Decimal(apr).div(100);
|
|
267
284
|
const fee = new Decimal(feeApr).div(100);
|
|
268
|
-
const rewards = rewardsApr.map((reward) => new Decimal(reward).div(100));
|
|
285
|
+
const rewards = rewardsApr.map((reward: number) => new Decimal(reward).div(100));
|
|
269
286
|
|
|
270
287
|
return {
|
|
271
288
|
totalApr,
|
|
@@ -273,7 +290,7 @@ export class RaydiumService {
|
|
|
273
290
|
feeApr: fee,
|
|
274
291
|
feeApy: aprToApy(fee, 365),
|
|
275
292
|
rewardsApr: rewards,
|
|
276
|
-
rewardsApy: rewards.map((x) => aprToApy(x, 365)),
|
|
293
|
+
rewardsApy: rewards.map((x: Decimal) => aprToApy(x, 365)),
|
|
277
294
|
...priceRange,
|
|
278
295
|
};
|
|
279
296
|
};
|
|
@@ -332,4 +349,303 @@ export class RaydiumService {
|
|
|
332
349
|
|
|
333
350
|
return positions.length;
|
|
334
351
|
}
|
|
352
|
+
|
|
353
|
+
getTickPrice(
|
|
354
|
+
tick: number,
|
|
355
|
+
tokenADecimals: number,
|
|
356
|
+
tokenBDecimals: number,
|
|
357
|
+
baseIn: boolean = true
|
|
358
|
+
): ReturnTypeGetTickPrice {
|
|
359
|
+
const tickSqrtPriceX64 = SqrtPriceMath.getSqrtPriceX64FromTick(tick);
|
|
360
|
+
const tickPrice = SqrtPriceMath.sqrtPriceX64ToPrice(tickSqrtPriceX64, tokenADecimals, tokenBDecimals);
|
|
361
|
+
|
|
362
|
+
return baseIn
|
|
363
|
+
? { tick, price: tickPrice, tickSqrtPriceX64 }
|
|
364
|
+
: { tick, price: new Decimal(1).div(tickPrice), tickSqrtPriceX64 };
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
async getRpcClmmPoolInfo(poolId: string): Promise<ClmmRpcData> {
|
|
368
|
+
const poolAccountInfo = await this._rpc
|
|
369
|
+
.getAccountInfo(address(poolId), { commitment: 'confirmed', encoding: 'base64' })
|
|
370
|
+
.send();
|
|
371
|
+
if (!poolAccountInfo.value) {
|
|
372
|
+
throw Error(`Raydium pool state ${poolId} does not exist`);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
const poolState = await PoolState.fetch(this._rpc, address(poolId));
|
|
376
|
+
if (!poolState) {
|
|
377
|
+
throw Error(`Raydium pool state ${poolId} does not exist`);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
const rpc = PoolInfoLayout.decode(Buffer.from(poolAccountInfo.value.data[0], 'base64'));
|
|
381
|
+
const currentPrice = SqrtPriceMath.sqrtPriceX64ToPrice(
|
|
382
|
+
poolState.sqrtPriceX64,
|
|
383
|
+
poolState.mintDecimals0,
|
|
384
|
+
poolState.mintDecimals1
|
|
385
|
+
).toNumber();
|
|
386
|
+
|
|
387
|
+
const data: ClmmRpcData = {
|
|
388
|
+
...rpc,
|
|
389
|
+
currentPrice,
|
|
390
|
+
programId: toLegacyPublicKey(this._raydiumProgramId),
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
return data;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
async fetchComputeClmmInfo(poolInfoWithAddress: ClmmRpcDataWithAddress): Promise<ComputeClmmPoolInfo> {
|
|
397
|
+
const { address: poolAddress } = poolInfoWithAddress;
|
|
398
|
+
return (await this.fetchComputeMultipleClmmInfo([poolInfoWithAddress]))[poolAddress.toString()];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
async fetchExBitmaps(exBitmapAddress: Address[]): Promise<ReturnTypeFetchExBitmaps> {
|
|
402
|
+
const fetchedBitmapAccount = await this._rpc
|
|
403
|
+
.getMultipleAccounts(exBitmapAddress, { commitment: 'confirmed', encoding: 'base64' })
|
|
404
|
+
.send();
|
|
405
|
+
const fetchedBitmapAccountWithAddress = exBitmapAddress.map((address, index) => ({
|
|
406
|
+
address,
|
|
407
|
+
data: fetchedBitmapAccount.value[index]?.data,
|
|
408
|
+
}));
|
|
409
|
+
|
|
410
|
+
const returnTypeFetchExBitmaps: ReturnTypeFetchExBitmaps = {};
|
|
411
|
+
for (const { address, data } of fetchedBitmapAccountWithAddress) {
|
|
412
|
+
if (!data) continue;
|
|
413
|
+
returnTypeFetchExBitmaps[address.toString()] = TickArrayBitmapExtensionLayout.decode(
|
|
414
|
+
Buffer.from(data[0], 'base64')
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
return returnTypeFetchExBitmaps;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
async fetchComputeMultipleClmmInfo(poolList: ClmmRpcDataWithAddress[]): Promise<Record<string, ComputeClmmPoolInfo>> {
|
|
421
|
+
const fetchRpcList = poolList.map((p) => p.address);
|
|
422
|
+
const rpcRes = await this._rpc
|
|
423
|
+
.getMultipleAccounts(fetchRpcList, { commitment: 'confirmed', encoding: 'base64' })
|
|
424
|
+
.send();
|
|
425
|
+
const rpcResWithAddress = fetchRpcList.map((address, index) => ({
|
|
426
|
+
address,
|
|
427
|
+
data: rpcRes.value[index]?.data,
|
|
428
|
+
}));
|
|
429
|
+
|
|
430
|
+
const rpcDataMap: Record<string, ReturnType<typeof PoolInfoLayout.decode>> = {};
|
|
431
|
+
for (const { address, data } of rpcResWithAddress) {
|
|
432
|
+
if (!data) continue;
|
|
433
|
+
rpcDataMap[address.toString()] = PoolInfoLayout.decode(Buffer.from(data[0], 'base64'));
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// Fetch amm configs
|
|
437
|
+
const configSet = Array.from(new Set(poolList.map((p) => p.clmmPoolRpcInfo.ammConfig.toBase58())));
|
|
438
|
+
const configRes = await this._rpc
|
|
439
|
+
.getMultipleAccounts(
|
|
440
|
+
configSet.map((s) => address(s)),
|
|
441
|
+
{ commitment: 'confirmed', encoding: 'base64' }
|
|
442
|
+
)
|
|
443
|
+
.send();
|
|
444
|
+
|
|
445
|
+
const clmmConfigs: Record<string, ReturnType<typeof ClmmConfigLayout.decode>> = {};
|
|
446
|
+
configSet.forEach((configAddress, index) => {
|
|
447
|
+
const data = configRes.value[index]?.data;
|
|
448
|
+
if (data) {
|
|
449
|
+
clmmConfigs[configAddress] = ClmmConfigLayout.decode(Buffer.from(data[0], 'base64'));
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
// Fetch mint infos
|
|
454
|
+
const allMints = Array.from(
|
|
455
|
+
new Set(poolList.flatMap((p) => [p.clmmPoolRpcInfo.mintA.toBase58(), p.clmmPoolRpcInfo.mintB.toBase58()]))
|
|
456
|
+
);
|
|
457
|
+
const mintInfos = await this.fetchMultipleMintInfos(allMints.map((m) => address(m)));
|
|
458
|
+
|
|
459
|
+
const pdaList = await Promise.all(
|
|
460
|
+
poolList.map(async (poolInfo) => {
|
|
461
|
+
const pda = await getPdaExBitmapAccount(
|
|
462
|
+
fromLegacyPublicKey(poolInfo.clmmPoolRpcInfo.programId),
|
|
463
|
+
poolInfo.address
|
|
464
|
+
);
|
|
465
|
+
return address(pda[0]);
|
|
466
|
+
})
|
|
467
|
+
);
|
|
468
|
+
|
|
469
|
+
const exBitData = await this.fetchExBitmaps(pdaList);
|
|
470
|
+
|
|
471
|
+
const result: Record<string, ComputeClmmPoolInfo> = {};
|
|
472
|
+
for (let i = 0; i < poolList.length; i++) {
|
|
473
|
+
const cur = poolList[i];
|
|
474
|
+
const pda = await getPdaExBitmapAccount(fromLegacyPublicKey(cur.clmmPoolRpcInfo.programId), cur.address);
|
|
475
|
+
|
|
476
|
+
const ammConfigKey = cur.clmmPoolRpcInfo.ammConfig.toBase58();
|
|
477
|
+
const ammConfigData = clmmConfigs[ammConfigKey];
|
|
478
|
+
const mintAKey = cur.clmmPoolRpcInfo.mintA.toBase58();
|
|
479
|
+
const mintBKey = cur.clmmPoolRpcInfo.mintB.toBase58();
|
|
480
|
+
|
|
481
|
+
result[cur.address.toString()] = {
|
|
482
|
+
...rpcDataMap[cur.address.toString()],
|
|
483
|
+
id: toLegacyPublicKey(cur.address),
|
|
484
|
+
version: 6,
|
|
485
|
+
programId: fromLegacyPublicKey(cur.clmmPoolRpcInfo.programId),
|
|
486
|
+
mintA: {
|
|
487
|
+
chainId: 101,
|
|
488
|
+
address: mintAKey,
|
|
489
|
+
programId: mintInfos[mintAKey]?.programId.toBase58() || 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
|
|
490
|
+
logoURI: '',
|
|
491
|
+
symbol: '',
|
|
492
|
+
name: '',
|
|
493
|
+
decimals: cur.clmmPoolRpcInfo.mintDecimalsA,
|
|
494
|
+
tags: [],
|
|
495
|
+
extensions: { feeConfig: mintInfos[mintAKey]?.feeConfig },
|
|
496
|
+
},
|
|
497
|
+
mintB: {
|
|
498
|
+
chainId: 101,
|
|
499
|
+
address: mintBKey,
|
|
500
|
+
programId: mintInfos[mintBKey]?.programId.toBase58() || 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
|
|
501
|
+
logoURI: '',
|
|
502
|
+
symbol: '',
|
|
503
|
+
name: '',
|
|
504
|
+
decimals: cur.clmmPoolRpcInfo.mintDecimalsB,
|
|
505
|
+
tags: [],
|
|
506
|
+
extensions: { feeConfig: mintInfos[mintBKey]?.feeConfig },
|
|
507
|
+
},
|
|
508
|
+
ammConfig: {
|
|
509
|
+
...ammConfigData,
|
|
510
|
+
id: toLegacyPublicKey(address(ammConfigKey)),
|
|
511
|
+
fundFeeRate: 0,
|
|
512
|
+
description: '',
|
|
513
|
+
defaultRange: 0,
|
|
514
|
+
defaultRangePoint: [],
|
|
515
|
+
fundOwner: '',
|
|
516
|
+
},
|
|
517
|
+
currentPrice: new Decimal(cur.clmmPoolRpcInfo.currentPrice),
|
|
518
|
+
exBitmapAccount: toLegacyPublicKey(pda[0]),
|
|
519
|
+
exBitmapInfo: exBitData[pda[0].toString()],
|
|
520
|
+
startTime: rpcDataMap[cur.address.toString()].startTime.toNumber(),
|
|
521
|
+
rewardInfos: rpcDataMap[cur.address.toString()].rewardInfos,
|
|
522
|
+
} as any;
|
|
523
|
+
}
|
|
524
|
+
return result;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
async fetchMultipleMintInfos(mints: Address[]): Promise<ReturnTypeFetchMultipleMintInfos> {
|
|
528
|
+
if (mints.length === 0) return {};
|
|
529
|
+
|
|
530
|
+
const cleanedMints = mints.map((i) => solToWSol(i));
|
|
531
|
+
// fetch in chunks of 100
|
|
532
|
+
const mintInfos: Account<Mint>[] = [];
|
|
533
|
+
for (let i = 0; i < cleanedMints.length; i += 100) {
|
|
534
|
+
const chunk = cleanedMints.slice(i, i + 100);
|
|
535
|
+
const chunkMintInfos = await fetchAllMint(this._rpc, chunk);
|
|
536
|
+
mintInfos.push(...chunkMintInfos);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
const mintInfosWithAddress = cleanedMints.map((mint, index) => ({
|
|
540
|
+
address: mint,
|
|
541
|
+
data: mintInfos[index],
|
|
542
|
+
}));
|
|
543
|
+
|
|
544
|
+
const mintK: ReturnTypeFetchMultipleMintInfos = {};
|
|
545
|
+
for (const { address, data } of mintInfosWithAddress) {
|
|
546
|
+
if (!data) {
|
|
547
|
+
console.log('invalid mint account', address.toString());
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
mintK[address] = {
|
|
551
|
+
mintAuthority: optionGetValueOrUndefined(data.data.mintAuthority)
|
|
552
|
+
? toLegacyPublicKey(optionGetValue(data.data.mintAuthority)!)
|
|
553
|
+
: null,
|
|
554
|
+
programId: toLegacyPublicKey(data.programAddress),
|
|
555
|
+
feeConfig: undefined,
|
|
556
|
+
address: toLegacyPublicKey(address),
|
|
557
|
+
isInitialized: true,
|
|
558
|
+
tlvData: Buffer.from([]),
|
|
559
|
+
supply: data.data.supply,
|
|
560
|
+
decimals: data.data.decimals,
|
|
561
|
+
freezeAuthority: optionGetValueOrUndefined(data.data.freezeAuthority)
|
|
562
|
+
? toLegacyPublicKey(optionGetValue(data.data.freezeAuthority)!)
|
|
563
|
+
: null,
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
mintK[DEFAULT_PUBLIC_KEY.toString()] = mintK[WSOL_MINT.toString()];
|
|
567
|
+
|
|
568
|
+
return mintK;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
public async getComputeClmmPoolInfo(
|
|
572
|
+
clmmPoolRpcInfoWithAddress: ClmmRpcDataWithAddress
|
|
573
|
+
): Promise<ComputeClmmPoolInfo> {
|
|
574
|
+
const computeClmmPoolInfo = await this.fetchComputeClmmInfo(clmmPoolRpcInfoWithAddress);
|
|
575
|
+
return computeClmmPoolInfo;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
async getPoolInfoFromRpc(poolId: string): Promise<ApiV3PoolInfoConcentratedItem> {
|
|
579
|
+
const rpcData = await this.getRpcClmmPoolInfo(poolId);
|
|
580
|
+
|
|
581
|
+
const poolInfoWithAddress = {
|
|
582
|
+
address: address(poolId),
|
|
583
|
+
clmmPoolRpcInfo: rpcData,
|
|
584
|
+
};
|
|
585
|
+
const computeClmmPoolInfo = await this.getComputeClmmPoolInfo(poolInfoWithAddress);
|
|
586
|
+
|
|
587
|
+
const poolInfo = this.clmmComputeInfoToApiInfo(computeClmmPoolInfo);
|
|
588
|
+
|
|
589
|
+
poolInfo.mintAmountA = await getTokenAccountBalanceLamports(this._rpc, fromLegacyPublicKey(rpcData.vaultA));
|
|
590
|
+
poolInfo.mintAmountB = await getTokenAccountBalanceLamports(this._rpc, fromLegacyPublicKey(rpcData.vaultB));
|
|
591
|
+
|
|
592
|
+
return poolInfo;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
clmmComputeInfoToApiInfo(pool: ComputeClmmPoolInfo): ApiV3PoolInfoConcentratedItem {
|
|
596
|
+
return {
|
|
597
|
+
...pool,
|
|
598
|
+
type: 'Concentrated',
|
|
599
|
+
programId: pool.programId.toString(),
|
|
600
|
+
id: pool.id.toString(),
|
|
601
|
+
rewardDefaultInfos: [],
|
|
602
|
+
rewardDefaultPoolInfos: 'Clmm',
|
|
603
|
+
price: pool.currentPrice.toNumber(),
|
|
604
|
+
mintAmountA: 0,
|
|
605
|
+
mintAmountB: 0,
|
|
606
|
+
feeRate: pool.ammConfig.tradeFeeRate,
|
|
607
|
+
openTime: pool.startTime.toString(),
|
|
608
|
+
tvl: 0,
|
|
609
|
+
|
|
610
|
+
day: mockRewardData,
|
|
611
|
+
week: mockRewardData,
|
|
612
|
+
month: mockRewardData,
|
|
613
|
+
pooltype: [],
|
|
614
|
+
|
|
615
|
+
farmUpcomingCount: 0,
|
|
616
|
+
farmOngoingCount: 0,
|
|
617
|
+
farmFinishedCount: 0,
|
|
618
|
+
burnPercent: 0,
|
|
619
|
+
config: {
|
|
620
|
+
...pool.ammConfig,
|
|
621
|
+
id: pool.ammConfig.id.toString(),
|
|
622
|
+
defaultRange: 0,
|
|
623
|
+
defaultRangePoint: [],
|
|
624
|
+
},
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
export interface ClmmRpcDataWithAddress {
|
|
630
|
+
address: Address;
|
|
631
|
+
clmmPoolRpcInfo: ClmmRpcData;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
export async function getPdaExBitmapAccount(programId: Address, poolId: Address): Promise<ProgramDerivedAddress> {
|
|
635
|
+
const addressEncoder = getAddressEncoder();
|
|
636
|
+
return getProgramDerivedAddress({
|
|
637
|
+
seeds: [POOL_TICK_ARRAY_BITMAP_SEED, addressEncoder.encode(poolId)],
|
|
638
|
+
programAddress: programId,
|
|
639
|
+
});
|
|
335
640
|
}
|
|
641
|
+
|
|
642
|
+
const mockRewardData = {
|
|
643
|
+
volume: 0,
|
|
644
|
+
volumeQuote: 0,
|
|
645
|
+
volumeFee: 0,
|
|
646
|
+
apr: 0,
|
|
647
|
+
feeApr: 0,
|
|
648
|
+
priceMin: 0,
|
|
649
|
+
priceMax: 0,
|
|
650
|
+
rewardApr: [],
|
|
651
|
+
};
|
package/src/services/index.ts
CHANGED
package/src/utils/jupiter.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Instruction } from '@jup-ag/api';
|
|
2
|
-
import { AccountRole, address,
|
|
2
|
+
import { AccountRole, address, Instruction as SolanaInstruction } from '@solana/kit';
|
|
3
3
|
|
|
4
|
-
export function
|
|
4
|
+
export function jupInstructionToSolanaInstruction(ix: Instruction): SolanaInstruction {
|
|
5
5
|
return {
|
|
6
6
|
data: ix.data ? Buffer.from(ix.data, 'base64') : undefined,
|
|
7
7
|
programAddress: address(ix.programId),
|
|
@@ -12,8 +12,8 @@ export function instructionToIInstruction(ix: Instruction): IInstruction {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export function
|
|
16
|
-
return ixs.map((ix) =>
|
|
15
|
+
export function jupInstructionsToSolanaInstructions(ixs: Instruction[]): SolanaInstruction[] {
|
|
16
|
+
return ixs.map((ix) => jupInstructionToSolanaInstruction(ix));
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export function getAccountRole({ isSigner, isMut }: { isSigner: boolean; isMut: boolean }): AccountRole {
|
package/src/utils/tokenUtils.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Address,
|
|
3
|
+
Instruction,
|
|
4
|
+
address,
|
|
5
|
+
TransactionSigner,
|
|
6
|
+
Rpc,
|
|
7
|
+
GetAccountInfoApi,
|
|
8
|
+
Account,
|
|
9
|
+
SolanaRpcApi,
|
|
10
|
+
} from '@solana/kit';
|
|
2
11
|
import { WhirlpoolStrategy } from '../@codegen/kliquidity/accounts';
|
|
3
12
|
import Decimal from 'decimal.js';
|
|
4
13
|
import { CollateralInfo } from '../@codegen/kliquidity/types';
|
|
@@ -16,10 +25,10 @@ import { SYSTEM_PROGRAM_ADDRESS } from '@solana-program/system';
|
|
|
16
25
|
import { getSetComputeUnitLimitInstruction } from '@solana-program/compute-budget';
|
|
17
26
|
import { tickIndexToPrice } from '@orca-so/whirlpools-core';
|
|
18
27
|
|
|
19
|
-
export const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
];
|
|
28
|
+
export const SOL_MINT = address('So11111111111111111111111111111111111111111');
|
|
29
|
+
export const WSOL_MINT = address('So11111111111111111111111111111111111111112');
|
|
30
|
+
|
|
31
|
+
export const SOL_MINTS = [SOL_MINT, WSOL_MINT];
|
|
23
32
|
export const DECIMALS_SOL = 9;
|
|
24
33
|
|
|
25
34
|
export async function getAssociatedTokenAddressAndAccount(
|
|
@@ -57,7 +66,7 @@ export function createAssociatedTokenAccountInstruction(
|
|
|
57
66
|
mint: Address,
|
|
58
67
|
programId: Address = TOKEN_PROGRAM_ADDRESS,
|
|
59
68
|
associatedTokenProgramId: Address = ASSOCIATED_TOKEN_PROGRAM_ADDRESS
|
|
60
|
-
):
|
|
69
|
+
): Instruction {
|
|
61
70
|
return getCreateAssociatedTokenInstruction(
|
|
62
71
|
{
|
|
63
72
|
mint,
|
|
@@ -71,7 +80,7 @@ export function createAssociatedTokenAccountInstruction(
|
|
|
71
80
|
);
|
|
72
81
|
}
|
|
73
82
|
|
|
74
|
-
export function createComputeUnitLimitIx(units: number = 400000):
|
|
83
|
+
export function createComputeUnitLimitIx(units: number = 400000): Instruction {
|
|
75
84
|
return getSetComputeUnitLimitInstruction({ units });
|
|
76
85
|
}
|
|
77
86
|
|
|
@@ -166,3 +175,26 @@ export async function getMintDecimals(rpc: Rpc<GetAccountInfoApi>, mint: Address
|
|
|
166
175
|
}
|
|
167
176
|
return acc.data.decimals;
|
|
168
177
|
}
|
|
178
|
+
|
|
179
|
+
export function solToWSol(mint: Address): Address {
|
|
180
|
+
if (mint === SOL_MINT) {
|
|
181
|
+
return WSOL_MINT;
|
|
182
|
+
}
|
|
183
|
+
return mint;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export async function getTokenAccountBalance(rpc: Rpc<SolanaRpcApi>, tokenAccount: Address): Promise<Decimal> {
|
|
187
|
+
const tokenAccountBalance = await rpc.getTokenAccountBalance(tokenAccount).send();
|
|
188
|
+
if (!tokenAccountBalance.value) {
|
|
189
|
+
throw new Error(`Could not get token account balance for ${tokenAccount.toString()}.`);
|
|
190
|
+
}
|
|
191
|
+
return new Decimal(tokenAccountBalance.value.uiAmountString!);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export async function getTokenAccountBalanceLamports(rpc: Rpc<SolanaRpcApi>, tokenAccount: Address): Promise<number> {
|
|
195
|
+
const tokenAccountBalance = await rpc.getTokenAccountBalance(tokenAccount).send();
|
|
196
|
+
if (!tokenAccountBalance.value) {
|
|
197
|
+
throw new Error(`Could not get token account balance for ${tokenAccount.toString()}.`);
|
|
198
|
+
}
|
|
199
|
+
return Number(tokenAccountBalance.value.amount);
|
|
200
|
+
}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Address,
|
|
3
3
|
GetAccountInfoApi,
|
|
4
4
|
GetTokenAccountBalanceApi,
|
|
5
|
-
|
|
5
|
+
Instruction,
|
|
6
6
|
Rpc,
|
|
7
7
|
TransactionSigner,
|
|
8
8
|
} from '@solana/kit';
|
|
@@ -27,8 +27,8 @@ import { getTransferSolInstruction } from '@solana-program/system';
|
|
|
27
27
|
|
|
28
28
|
export const MAX_ACCOUNTS_PER_TRANSACTION = 64;
|
|
29
29
|
|
|
30
|
-
export const getComputeBudgetAndPriorityFeeIxns = (units: number, priorityFeeLamports?: Decimal):
|
|
31
|
-
const ixns:
|
|
30
|
+
export const getComputeBudgetAndPriorityFeeIxns = (units: number, priorityFeeLamports?: Decimal): Instruction[] => {
|
|
31
|
+
const ixns: Instruction[] = [];
|
|
32
32
|
|
|
33
33
|
ixns.push(getSetComputeUnitLimitInstruction({ units }));
|
|
34
34
|
|
|
@@ -45,7 +45,7 @@ export const createAtaIfMissingIx = async (
|
|
|
45
45
|
mint: Address,
|
|
46
46
|
owner: TransactionSigner,
|
|
47
47
|
programId: Address
|
|
48
|
-
): Promise<
|
|
48
|
+
): Promise<Instruction | undefined> => {
|
|
49
49
|
const ata = await getAssociatedTokenAddress(mint, owner.address, programId);
|
|
50
50
|
const doesAtaExist = Boolean(await checkIfAccountExists(connection, ata));
|
|
51
51
|
const createIxn = !doesAtaExist
|
|
@@ -58,7 +58,7 @@ export const getAtasWithCreateIxnsIfMissing = async (
|
|
|
58
58
|
connection: Rpc<any>,
|
|
59
59
|
mints: [Address, Address][],
|
|
60
60
|
owner: TransactionSigner
|
|
61
|
-
): Promise<
|
|
61
|
+
): Promise<Instruction[]> => {
|
|
62
62
|
const requests = mints.map(async ([mint, tokenProgram]) => {
|
|
63
63
|
const createAtaIx = await createAtaIfMissingIx(connection, mint, owner, tokenProgram);
|
|
64
64
|
if (createAtaIx) {
|
|
@@ -68,7 +68,7 @@ export const getAtasWithCreateIxnsIfMissing = async (
|
|
|
68
68
|
});
|
|
69
69
|
const result = (await Promise.all(requests.filter((x) => x !== undefined))).filter(
|
|
70
70
|
(ix) => ix !== undefined
|
|
71
|
-
) as
|
|
71
|
+
) as Instruction[];
|
|
72
72
|
|
|
73
73
|
return result;
|
|
74
74
|
};
|
|
@@ -79,8 +79,8 @@ export const createWsolAtaIfMissing = async (
|
|
|
79
79
|
owner: TransactionSigner,
|
|
80
80
|
method: 'deposit' | 'withdraw' = 'deposit'
|
|
81
81
|
): Promise<CreateAta> => {
|
|
82
|
-
const createIxns:
|
|
83
|
-
const closeIxns:
|
|
82
|
+
const createIxns: Instruction[] = [];
|
|
83
|
+
const closeIxns: Instruction[] = [];
|
|
84
84
|
|
|
85
85
|
const wsolAta: Address = await getAssociatedTokenAddress(WRAPPED_SOL_MINT, owner.address);
|
|
86
86
|
|
|
@@ -157,7 +157,7 @@ export async function checkIfAccountExists(connection: Rpc<GetAccountInfoApi>, a
|
|
|
157
157
|
return (await connection.getAccountInfo(account, { encoding: 'base64' }).send()).value != null;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
export function removeBudgetAndAtaIxns(ixns:
|
|
160
|
+
export function removeBudgetAndAtaIxns(ixns: Instruction[], mints: Address[]): Instruction[] {
|
|
161
161
|
return ixns.filter((ixn) => {
|
|
162
162
|
const { programAddress, accounts } = ixn;
|
|
163
163
|
|
package/src/utils/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BN } from '@coral-xyz/anchor';
|
|
2
2
|
|
|
3
|
-
import { address, Address,
|
|
3
|
+
import { address, Address, Instruction, TransactionMessage, TransactionSigner } from '@solana/kit';
|
|
4
4
|
import { WhirlpoolStrategy } from '../@codegen/kliquidity/accounts';
|
|
5
5
|
import { Dex, collToLamportsDecimal } from './utils';
|
|
6
6
|
import Decimal from 'decimal.js';
|
|
@@ -214,7 +214,7 @@ export interface SwapperIxBuilder {
|
|
|
214
214
|
owner: TransactionSigner,
|
|
215
215
|
slippage: Decimal,
|
|
216
216
|
allKeys: Address[]
|
|
217
|
-
): Promise<[
|
|
217
|
+
): Promise<[Instruction[], Address[]]>;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
export interface ProfiledFunctionExecution {
|
|
@@ -227,8 +227,8 @@ export function noopProfiledFunctionExecution(promise: Promise<any>): Promise<an
|
|
|
227
227
|
|
|
228
228
|
export interface CreateAta {
|
|
229
229
|
ata: Address;
|
|
230
|
-
createIxns:
|
|
231
|
-
closeIxns:
|
|
230
|
+
createIxns: Instruction[];
|
|
231
|
+
closeIxns: Instruction[];
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
export interface DeserializedVersionedTransaction {
|
|
@@ -237,7 +237,7 @@ export interface DeserializedVersionedTransaction {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
export interface InstructionsWithLookupTables {
|
|
240
|
-
instructions:
|
|
240
|
+
instructions: Instruction[];
|
|
241
241
|
lookupTablesAddresses: Address[];
|
|
242
242
|
}
|
|
243
243
|
|
|
@@ -269,16 +269,16 @@ export interface InputRebalanceFieldInfo {
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
export interface InitStrategyIxs {
|
|
272
|
-
initStrategyIx:
|
|
273
|
-
updateStrategyParamsIxs:
|
|
274
|
-
updateRebalanceParamsIx:
|
|
275
|
-
openPositionIxs:
|
|
272
|
+
initStrategyIx: Instruction;
|
|
273
|
+
updateStrategyParamsIxs: Instruction[];
|
|
274
|
+
updateRebalanceParamsIx: Instruction;
|
|
275
|
+
openPositionIxs: Instruction[];
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
export interface WithdrawShares {
|
|
279
|
-
prerequisiteIxs:
|
|
280
|
-
withdrawIx:
|
|
281
|
-
closeSharesAtaIx?:
|
|
279
|
+
prerequisiteIxs: Instruction[];
|
|
280
|
+
withdrawIx: Instruction;
|
|
281
|
+
closeSharesAtaIx?: Instruction;
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
export interface MetadataProgramAddressesOrca {
|
|
@@ -304,13 +304,13 @@ export interface LowerAndUpperTickPubkeys {
|
|
|
304
304
|
upperTickBump: number;
|
|
305
305
|
}
|
|
306
306
|
export interface WithdrawAllAndCloseIxns {
|
|
307
|
-
withdrawIxns:
|
|
308
|
-
closeIxn:
|
|
307
|
+
withdrawIxns: Instruction[];
|
|
308
|
+
closeIxn: Instruction;
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
export interface InitPoolTickIfNeeded {
|
|
312
312
|
tick: Address;
|
|
313
|
-
initTickIx:
|
|
313
|
+
initTickIx: Instruction | undefined;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
export type Percentage = {
|