@exponent-labs/exponent-sdk 0.1.8 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/CodamaEventDecoder.d.ts +49 -0
- package/build/CodamaEventDecoder.js +113 -0
- package/build/CodamaEventDecoder.js.map +1 -0
- package/build/addressLookupTableUtil.d.ts +23 -18
- package/build/addressLookupTableUtil.js +31 -5
- package/build/addressLookupTableUtil.js.map +1 -1
- package/build/client/clmm/accounts/lpPosition.d.ts +29 -0
- package/build/client/clmm/accounts/lpPosition.js +82 -0
- package/build/client/clmm/accounts/lpPosition.js.map +1 -0
- package/build/client/clmm/accounts/marketThree.d.ts +47 -0
- package/build/client/clmm/accounts/marketThree.js +139 -0
- package/build/client/clmm/accounts/marketThree.js.map +1 -0
- package/build/client/clmm/accounts/vault.d.ts +48 -0
- package/build/client/clmm/accounts/vault.js +128 -0
- package/build/client/clmm/accounts/vault.js.map +1 -0
- package/build/client/clmm/eventRegistry.d.ts +59 -0
- package/build/client/clmm/eventRegistry.js +58 -0
- package/build/client/clmm/eventRegistry.js.map +1 -0
- package/build/client/clmm/index.d.ts +78 -0
- package/build/client/clmm/index.js +96 -0
- package/build/client/clmm/index.js.map +1 -0
- package/build/client/clmm/instructions/addFarm.d.ts +19 -0
- package/build/client/clmm/instructions/addFarm.js +31 -0
- package/build/client/clmm/instructions/addFarm.js.map +1 -0
- package/build/client/clmm/instructions/addLiquidity.d.ts +26 -0
- package/build/client/clmm/instructions/addLiquidity.js +38 -0
- package/build/client/clmm/instructions/addLiquidity.js.map +1 -0
- package/build/client/clmm/instructions/addMarketEmission.d.ts +15 -0
- package/build/client/clmm/instructions/addMarketEmission.js +27 -0
- package/build/client/clmm/instructions/addMarketEmission.js.map +1 -0
- package/build/client/clmm/instructions/buyPt.d.ts +24 -0
- package/build/client/clmm/instructions/buyPt.js +36 -0
- package/build/client/clmm/instructions/buyPt.js.map +1 -0
- package/build/client/clmm/instructions/buyYt.d.ts +26 -0
- package/build/client/clmm/instructions/buyYt.js +42 -0
- package/build/client/clmm/instructions/buyYt.js.map +1 -0
- package/build/client/clmm/instructions/claimFarmEmission.d.ts +18 -0
- package/build/client/clmm/instructions/claimFarmEmission.js +30 -0
- package/build/client/clmm/instructions/claimFarmEmission.js.map +1 -0
- package/build/client/clmm/instructions/closeMarket.d.ts +17 -0
- package/build/client/clmm/instructions/closeMarket.js +26 -0
- package/build/client/clmm/instructions/closeMarket.js.map +1 -0
- package/build/client/clmm/instructions/depositLiquidity.d.ts +25 -0
- package/build/client/clmm/instructions/depositLiquidity.js +37 -0
- package/build/client/clmm/instructions/depositLiquidity.js.map +1 -0
- package/build/client/clmm/instructions/initializeMarket.d.ts +47 -0
- package/build/client/clmm/instructions/initializeMarket.js +63 -0
- package/build/client/clmm/instructions/initializeMarket.js.map +1 -0
- package/build/client/clmm/instructions/marketAccrueEmission.d.ts +13 -0
- package/build/client/clmm/instructions/marketAccrueEmission.js +22 -0
- package/build/client/clmm/instructions/marketAccrueEmission.js.map +1 -0
- package/build/client/clmm/instructions/marketCollectEmission.d.ts +18 -0
- package/build/client/clmm/instructions/marketCollectEmission.js +30 -0
- package/build/client/clmm/instructions/marketCollectEmission.js.map +1 -0
- package/build/client/clmm/instructions/modifyFarm.d.ts +17 -0
- package/build/client/clmm/instructions/modifyFarm.js +29 -0
- package/build/client/clmm/instructions/modifyFarm.js.map +1 -0
- package/build/client/clmm/instructions/modifyMarketSetting.d.ts +11 -0
- package/build/client/clmm/instructions/modifyMarketSetting.js +23 -0
- package/build/client/clmm/instructions/modifyMarketSetting.js.map +1 -0
- package/build/client/clmm/instructions/sellPt.d.ts +24 -0
- package/build/client/clmm/instructions/sellPt.js +36 -0
- package/build/client/clmm/instructions/sellPt.js.map +1 -0
- package/build/client/clmm/instructions/sellYt.d.ts +26 -0
- package/build/client/clmm/instructions/sellYt.js +42 -0
- package/build/client/clmm/instructions/sellYt.js.map +1 -0
- package/build/client/clmm/instructions/tradePt.d.ts +25 -0
- package/build/client/clmm/instructions/tradePt.js +37 -0
- package/build/client/clmm/instructions/tradePt.js.map +1 -0
- package/build/client/clmm/instructions/tradePtExactOut.d.ts +25 -0
- package/build/client/clmm/instructions/tradePtExactOut.js +37 -0
- package/build/client/clmm/instructions/tradePtExactOut.js.map +1 -0
- package/build/client/clmm/instructions/withdrawLiquidity.d.ts +23 -0
- package/build/client/clmm/instructions/withdrawLiquidity.js +35 -0
- package/build/client/clmm/instructions/withdrawLiquidity.js.map +1 -0
- package/build/client/clmm/instructions/wrapperBuyYt.d.ts +28 -0
- package/build/client/clmm/instructions/wrapperBuyYt.js +48 -0
- package/build/client/clmm/instructions/wrapperBuyYt.js.map +1 -0
- package/build/client/clmm/instructions/wrapperProvideLiquidity.d.ts +33 -0
- package/build/client/clmm/instructions/wrapperProvideLiquidity.js +53 -0
- package/build/client/clmm/instructions/wrapperProvideLiquidity.js.map +1 -0
- package/build/client/clmm/instructions/wrapperProvideLiquidityBase.d.ts +32 -0
- package/build/client/clmm/instructions/wrapperProvideLiquidityBase.js +52 -0
- package/build/client/clmm/instructions/wrapperProvideLiquidityBase.js.map +1 -0
- package/build/client/clmm/instructions/wrapperProvideLiquidityClassic.d.ts +28 -0
- package/build/client/clmm/instructions/wrapperProvideLiquidityClassic.js +44 -0
- package/build/client/clmm/instructions/wrapperProvideLiquidityClassic.js.map +1 -0
- package/build/client/clmm/instructions/wrapperSellYt.d.ts +27 -0
- package/build/client/clmm/instructions/wrapperSellYt.js +47 -0
- package/build/client/clmm/instructions/wrapperSellYt.js.map +1 -0
- package/build/client/clmm/instructions/wrapperWithdrawLiquidity.d.ts +25 -0
- package/build/client/clmm/instructions/wrapperWithdrawLiquidity.js +41 -0
- package/build/client/clmm/instructions/wrapperWithdrawLiquidity.js.map +1 -0
- package/build/client/clmm/instructions/wrapperWithdrawLiquidityClassic.d.ts +22 -0
- package/build/client/clmm/instructions/wrapperWithdrawLiquidityClassic.js +38 -0
- package/build/client/clmm/instructions/wrapperWithdrawLiquidityClassic.js.map +1 -0
- package/build/client/clmm/types/addFarmEvent.d.ts +35 -0
- package/build/client/clmm/types/addFarmEvent.js +24 -0
- package/build/client/clmm/types/addFarmEvent.js.map +1 -0
- package/build/client/clmm/types/amount.d.ts +33 -0
- package/build/client/clmm/types/amount.js +20 -0
- package/build/client/clmm/types/amount.js.map +1 -0
- package/build/client/clmm/types/buyPtEvent.d.ts +23 -0
- package/build/client/clmm/types/buyPtEvent.js +18 -0
- package/build/client/clmm/types/buyPtEvent.js.map +1 -0
- package/build/client/clmm/types/buyYtEvent.d.ts +56 -0
- package/build/client/clmm/types/buyYtEvent.js +36 -0
- package/build/client/clmm/types/buyYtEvent.js.map +1 -0
- package/build/client/clmm/types/claimFarmEmissionsEvent.d.ts +171 -0
- package/build/client/clmm/types/claimFarmEmissionsEvent.js +42 -0
- package/build/client/clmm/types/claimFarmEmissionsEvent.js.map +1 -0
- package/build/client/clmm/types/claimLimits.d.ts +22 -0
- package/build/client/clmm/types/claimLimits.js +11 -0
- package/build/client/clmm/types/claimLimits.js.map +1 -0
- package/build/client/clmm/types/closeMarketEvent.d.ts +23 -0
- package/build/client/clmm/types/closeMarketEvent.js +18 -0
- package/build/client/clmm/types/closeMarketEvent.js.map +1 -0
- package/build/client/clmm/types/configurationOptions.d.ts +34 -0
- package/build/client/clmm/types/configurationOptions.js +14 -0
- package/build/client/clmm/types/configurationOptions.js.map +1 -0
- package/build/client/clmm/types/cpiAccounts.d.ts +107 -0
- package/build/client/clmm/types/cpiAccounts.js +13 -0
- package/build/client/clmm/types/cpiAccounts.js.map +1 -0
- package/build/client/clmm/types/cpiCoreAccounts.d.ts +47 -0
- package/build/client/clmm/types/cpiCoreAccounts.js +10 -0
- package/build/client/clmm/types/cpiCoreAccounts.js.map +1 -0
- package/build/client/clmm/types/cpiInterfaceContext.d.ts +18 -0
- package/build/client/clmm/types/cpiInterfaceContext.js +10 -0
- package/build/client/clmm/types/cpiInterfaceContext.js.map +1 -0
- package/build/client/clmm/types/crossingSplit.d.ts +124 -0
- package/build/client/clmm/types/crossingSplit.js +20 -0
- package/build/client/clmm/types/crossingSplit.js.map +1 -0
- package/build/client/clmm/types/depositLiquidityEvent.d.ts +171 -0
- package/build/client/clmm/types/depositLiquidityEvent.js +42 -0
- package/build/client/clmm/types/depositLiquidityEvent.js.map +1 -0
- package/build/client/clmm/types/depositLiquidityReturnData.d.ts +67 -0
- package/build/client/clmm/types/depositLiquidityReturnData.js +38 -0
- package/build/client/clmm/types/depositLiquidityReturnData.js.map +1 -0
- package/build/client/clmm/types/emissionInfo.d.ts +36 -0
- package/build/client/clmm/types/emissionInfo.js +22 -0
- package/build/client/clmm/types/emissionInfo.js.map +1 -0
- package/build/client/clmm/types/farmEmission.d.ts +24 -0
- package/build/client/clmm/types/farmEmission.js +16 -0
- package/build/client/clmm/types/farmEmission.js.map +1 -0
- package/build/client/clmm/types/index.d.ts +48 -0
- package/build/client/clmm/types/index.js +65 -0
- package/build/client/clmm/types/index.js.map +1 -0
- package/build/client/clmm/types/liquidityNetBalanceLimits.d.ts +26 -0
- package/build/client/clmm/types/liquidityNetBalanceLimits.js +12 -0
- package/build/client/clmm/types/liquidityNetBalanceLimits.js.map +1 -0
- package/build/client/clmm/types/lpFarm.d.ts +35 -0
- package/build/client/clmm/types/lpFarm.js +10 -0
- package/build/client/clmm/types/lpFarm.js.map +1 -0
- package/build/client/clmm/types/marketAccrueEmissionEvent.d.ts +151 -0
- package/build/client/clmm/types/marketAccrueEmissionEvent.js +31 -0
- package/build/client/clmm/types/marketAccrueEmissionEvent.js.map +1 -0
- package/build/client/clmm/types/marketAdminAction.d.ts +359 -0
- package/build/client/clmm/types/marketAdminAction.js +72 -0
- package/build/client/clmm/types/marketAdminAction.js.map +1 -0
- package/build/client/clmm/types/marketCollectEmissionEvent.d.ts +163 -0
- package/build/client/clmm/types/marketCollectEmissionEvent.js +37 -0
- package/build/client/clmm/types/marketCollectEmissionEvent.js.map +1 -0
- package/build/client/clmm/types/marketEmission.d.ts +20 -0
- package/build/client/clmm/types/marketEmission.js +15 -0
- package/build/client/clmm/types/marketEmission.js.map +1 -0
- package/build/client/clmm/types/marketEmissions.d.ts +27 -0
- package/build/client/clmm/types/marketEmissions.js +9 -0
- package/build/client/clmm/types/marketEmissions.js.map +1 -0
- package/build/client/clmm/types/marketFinancials.d.ts +26 -0
- package/build/client/clmm/types/marketFinancials.js +12 -0
- package/build/client/clmm/types/marketFinancials.js.map +1 -0
- package/build/client/clmm/types/marketThreeInitEvent.d.ts +71 -0
- package/build/client/clmm/types/marketThreeInitEvent.js +42 -0
- package/build/client/clmm/types/marketThreeInitEvent.js.map +1 -0
- package/build/client/clmm/types/mergeEvent.d.ts +84 -0
- package/build/client/clmm/types/mergeEvent.js +55 -0
- package/build/client/clmm/types/mergeEvent.js.map +1 -0
- package/build/client/clmm/types/modifiedTick.d.ts +18 -0
- package/build/client/clmm/types/modifiedTick.js +10 -0
- package/build/client/clmm/types/modifiedTick.js.map +1 -0
- package/build/client/clmm/types/modifiedTicks.d.ts +43 -0
- package/build/client/clmm/types/modifiedTicks.js +13 -0
- package/build/client/clmm/types/modifiedTicks.js.map +1 -0
- package/build/client/clmm/types/modifyFarmEvent.d.ts +43 -0
- package/build/client/clmm/types/modifyFarmEvent.js +26 -0
- package/build/client/clmm/types/modifyFarmEvent.js.map +1 -0
- package/build/client/clmm/types/number.d.ts +2 -0
- package/build/client/clmm/types/number.js +8 -0
- package/build/client/clmm/types/number.js.map +1 -0
- package/build/client/clmm/types/personalYieldTracker.d.ts +15 -0
- package/build/client/clmm/types/personalYieldTracker.js +10 -0
- package/build/client/clmm/types/personalYieldTracker.js.map +1 -0
- package/build/client/clmm/types/personalYieldTrackers.d.ts +23 -0
- package/build/client/clmm/types/personalYieldTrackers.js +9 -0
- package/build/client/clmm/types/personalYieldTrackers.js.map +1 -0
- package/build/client/clmm/types/principalShare.d.ts +51 -0
- package/build/client/clmm/types/principalShare.js +14 -0
- package/build/client/clmm/types/principalShare.js.map +1 -0
- package/build/client/clmm/types/principalShareTrackers.d.ts +63 -0
- package/build/client/clmm/types/principalShareTrackers.js +9 -0
- package/build/client/clmm/types/principalShareTrackers.js.map +1 -0
- package/build/client/clmm/types/sellPtEvent.d.ts +23 -0
- package/build/client/clmm/types/sellPtEvent.js +18 -0
- package/build/client/clmm/types/sellPtEvent.js.map +1 -0
- package/build/client/clmm/types/sellYtEvent.d.ts +47 -0
- package/build/client/clmm/types/sellYtEvent.js +33 -0
- package/build/client/clmm/types/sellYtEvent.js.map +1 -0
- package/build/client/clmm/types/stripEvent.d.ts +84 -0
- package/build/client/clmm/types/stripEvent.js +58 -0
- package/build/client/clmm/types/stripEvent.js.map +1 -0
- package/build/client/clmm/types/swapDirection.d.ts +5 -0
- package/build/client/clmm/types/swapDirection.js +11 -0
- package/build/client/clmm/types/swapDirection.js.map +1 -0
- package/build/client/clmm/types/tradePtEvent.d.ts +110 -0
- package/build/client/clmm/types/tradePtEvent.js +37 -0
- package/build/client/clmm/types/tradePtEvent.js.map +1 -0
- package/build/client/clmm/types/withdrawLiquidityEvent.d.ts +183 -0
- package/build/client/clmm/types/withdrawLiquidityEvent.js +45 -0
- package/build/client/clmm/types/withdrawLiquidityEvent.js.map +1 -0
- package/build/client/clmm/types/withdrawLiquidityReturnData.d.ts +46 -0
- package/build/client/clmm/types/withdrawLiquidityReturnData.js +17 -0
- package/build/client/clmm/types/withdrawLiquidityReturnData.js.map +1 -0
- package/build/client/clmm/types/wrapperBuyYtEvent.d.ts +23 -0
- package/build/client/clmm/types/wrapperBuyYtEvent.js +18 -0
- package/build/client/clmm/types/wrapperBuyYtEvent.js.map +1 -0
- package/build/client/clmm/types/wrapperProvideLiquidityBaseEvent.d.ts +56 -0
- package/build/client/clmm/types/wrapperProvideLiquidityBaseEvent.js +30 -0
- package/build/client/clmm/types/wrapperProvideLiquidityBaseEvent.js.map +1 -0
- package/build/client/clmm/types/wrapperProvideLiquidityClassicEvent.d.ts +52 -0
- package/build/client/clmm/types/wrapperProvideLiquidityClassicEvent.js +29 -0
- package/build/client/clmm/types/wrapperProvideLiquidityClassicEvent.js.map +1 -0
- package/build/client/clmm/types/wrapperProvideLiquidityEvent.d.ts +56 -0
- package/build/client/clmm/types/wrapperProvideLiquidityEvent.js +30 -0
- package/build/client/clmm/types/wrapperProvideLiquidityEvent.js.map +1 -0
- package/build/client/clmm/types/wrapperSellYtEvent.d.ts +23 -0
- package/build/client/clmm/types/wrapperSellYtEvent.js +18 -0
- package/build/client/clmm/types/wrapperSellYtEvent.js.map +1 -0
- package/build/client/clmm/types/wrapperWithdrawLiquidityClassicEvent.d.ts +60 -0
- package/build/client/clmm/types/wrapperWithdrawLiquidityClassicEvent.js +31 -0
- package/build/client/clmm/types/wrapperWithdrawLiquidityClassicEvent.js.map +1 -0
- package/build/client/clmm/types/wrapperWithdrawLiquidityEvent.d.ts +60 -0
- package/build/client/clmm/types/wrapperWithdrawLiquidityEvent.js +31 -0
- package/build/client/clmm/types/wrapperWithdrawLiquidityEvent.js.map +1 -0
- package/build/client/core/accounts/admin.d.ts +18 -0
- package/build/client/core/accounts/admin.js +71 -0
- package/build/client/core/accounts/admin.js.map +1 -0
- package/build/client/core/accounts/lpPosition.d.ts +20 -0
- package/build/client/core/accounts/lpPosition.js +73 -0
- package/build/client/core/accounts/lpPosition.js.map +1 -0
- package/build/client/core/accounts/marketTwo.d.ts +42 -0
- package/build/client/core/accounts/marketTwo.js +122 -0
- package/build/client/core/accounts/marketTwo.js.map +1 -0
- package/build/client/core/accounts/vault.d.ts +48 -0
- package/build/client/core/accounts/vault.js +128 -0
- package/build/client/core/accounts/vault.js.map +1 -0
- package/build/client/core/accounts/yieldTokenPosition.d.ts +20 -0
- package/build/client/core/accounts/yieldTokenPosition.js +74 -0
- package/build/client/core/accounts/yieldTokenPosition.js.map +1 -0
- package/build/client/core/eventRegistry.d.ts +87 -0
- package/build/client/core/eventRegistry.js +86 -0
- package/build/client/core/eventRegistry.js.map +1 -0
- package/build/client/core/index.d.ts +109 -0
- package/build/client/core/index.js +127 -0
- package/build/client/core/index.js.map +1 -0
- package/build/client/core/instructions/addEmission.d.ts +19 -0
- package/build/client/core/instructions/addEmission.js +35 -0
- package/build/client/core/instructions/addEmission.js.map +1 -0
- package/build/client/core/instructions/addFarm.d.ts +17 -0
- package/build/client/core/instructions/addFarm.js +29 -0
- package/build/client/core/instructions/addFarm.js.map +1 -0
- package/build/client/core/instructions/addLpTokensMetadata.d.ts +16 -0
- package/build/client/core/instructions/addLpTokensMetadata.js +32 -0
- package/build/client/core/instructions/addLpTokensMetadata.js.map +1 -0
- package/build/client/core/instructions/addMarketEmission.d.ts +16 -0
- package/build/client/core/instructions/addMarketEmission.js +28 -0
- package/build/client/core/instructions/addMarketEmission.js.map +1 -0
- package/build/client/core/instructions/buyYt.d.ts +28 -0
- package/build/client/core/instructions/buyYt.js +44 -0
- package/build/client/core/instructions/buyYt.js.map +1 -0
- package/build/client/core/instructions/claimFarmEmissions.d.ts +17 -0
- package/build/client/core/instructions/claimFarmEmissions.js +29 -0
- package/build/client/core/instructions/claimFarmEmissions.js.map +1 -0
- package/build/client/core/instructions/collectEmission.d.ts +21 -0
- package/build/client/core/instructions/collectEmission.js +37 -0
- package/build/client/core/instructions/collectEmission.js.map +1 -0
- package/build/client/core/instructions/collectInterest.d.ts +20 -0
- package/build/client/core/instructions/collectInterest.js +36 -0
- package/build/client/core/instructions/collectInterest.js.map +1 -0
- package/build/client/core/instructions/collectTreasuryEmission.d.ts +21 -0
- package/build/client/core/instructions/collectTreasuryEmission.js +33 -0
- package/build/client/core/instructions/collectTreasuryEmission.js.map +1 -0
- package/build/client/core/instructions/collectTreasuryInterest.d.ts +20 -0
- package/build/client/core/instructions/collectTreasuryInterest.js +32 -0
- package/build/client/core/instructions/collectTreasuryInterest.js.map +1 -0
- package/build/client/core/instructions/depositYt.d.ts +19 -0
- package/build/client/core/instructions/depositYt.js +31 -0
- package/build/client/core/instructions/depositYt.js.map +1 -0
- package/build/client/core/instructions/initLpPosition.d.ts +11 -0
- package/build/client/core/instructions/initLpPosition.js +20 -0
- package/build/client/core/instructions/initLpPosition.js.map +1 -0
- package/build/client/core/instructions/initMarketTwo.d.ts +37 -0
- package/build/client/core/instructions/initMarketTwo.js +53 -0
- package/build/client/core/instructions/initMarketTwo.js.map +1 -0
- package/build/client/core/instructions/initializeVault.d.ts +34 -0
- package/build/client/core/instructions/initializeVault.js +58 -0
- package/build/client/core/instructions/initializeVault.js.map +1 -0
- package/build/client/core/instructions/initializeYieldPosition.d.ts +10 -0
- package/build/client/core/instructions/initializeYieldPosition.js +19 -0
- package/build/client/core/instructions/initializeYieldPosition.js.map +1 -0
- package/build/client/core/instructions/marketCollectEmission.d.ts +17 -0
- package/build/client/core/instructions/marketCollectEmission.js +29 -0
- package/build/client/core/instructions/marketCollectEmission.js.map +1 -0
- package/build/client/core/instructions/marketDepositLp.d.ts +19 -0
- package/build/client/core/instructions/marketDepositLp.js +31 -0
- package/build/client/core/instructions/marketDepositLp.js.map +1 -0
- package/build/client/core/instructions/marketTwoDepositLiquidity.d.ts +22 -0
- package/build/client/core/instructions/marketTwoDepositLiquidity.js +34 -0
- package/build/client/core/instructions/marketTwoDepositLiquidity.js.map +1 -0
- package/build/client/core/instructions/marketTwoWithdrawLiquidity.d.ts +22 -0
- package/build/client/core/instructions/marketTwoWithdrawLiquidity.js +34 -0
- package/build/client/core/instructions/marketTwoWithdrawLiquidity.js.map +1 -0
- package/build/client/core/instructions/marketWithdrawLp.d.ts +19 -0
- package/build/client/core/instructions/marketWithdrawLp.js +31 -0
- package/build/client/core/instructions/marketWithdrawLp.js.map +1 -0
- package/build/client/core/instructions/merge.d.ts +22 -0
- package/build/client/core/instructions/merge.js +32 -0
- package/build/client/core/instructions/merge.js.map +1 -0
- package/build/client/core/instructions/modifyFarm.d.ts +15 -0
- package/build/client/core/instructions/modifyFarm.js +27 -0
- package/build/client/core/instructions/modifyFarm.js.map +1 -0
- package/build/client/core/instructions/modifyMarketSetting.d.ts +12 -0
- package/build/client/core/instructions/modifyMarketSetting.js +24 -0
- package/build/client/core/instructions/modifyMarketSetting.js.map +1 -0
- package/build/client/core/instructions/modifyVaultSetting.d.ts +12 -0
- package/build/client/core/instructions/modifyVaultSetting.js +24 -0
- package/build/client/core/instructions/modifyVaultSetting.js.map +1 -0
- package/build/client/core/instructions/reallocMarket.d.ts +12 -0
- package/build/client/core/instructions/reallocMarket.js +24 -0
- package/build/client/core/instructions/reallocMarket.js.map +1 -0
- package/build/client/core/instructions/sellYt.d.ts +28 -0
- package/build/client/core/instructions/sellYt.js +44 -0
- package/build/client/core/instructions/sellYt.js.map +1 -0
- package/build/client/core/instructions/stageYtYield.d.ts +13 -0
- package/build/client/core/instructions/stageYtYield.js +22 -0
- package/build/client/core/instructions/stageYtYield.js.map +1 -0
- package/build/client/core/instructions/strip.d.ts +22 -0
- package/build/client/core/instructions/strip.js +32 -0
- package/build/client/core/instructions/strip.js.map +1 -0
- package/build/client/core/instructions/tradePt.d.ts +20 -0
- package/build/client/core/instructions/tradePt.js +32 -0
- package/build/client/core/instructions/tradePt.js.map +1 -0
- package/build/client/core/instructions/withdrawYt.d.ts +20 -0
- package/build/client/core/instructions/withdrawYt.js +32 -0
- package/build/client/core/instructions/withdrawYt.js.map +1 -0
- package/build/client/core/instructions/wrapperBuyPt.d.ts +21 -0
- package/build/client/core/instructions/wrapperBuyPt.js +33 -0
- package/build/client/core/instructions/wrapperBuyPt.js.map +1 -0
- package/build/client/core/instructions/wrapperBuyYt.d.ts +32 -0
- package/build/client/core/instructions/wrapperBuyYt.js +52 -0
- package/build/client/core/instructions/wrapperBuyYt.js.map +1 -0
- package/build/client/core/instructions/wrapperCollectInterest.d.ts +19 -0
- package/build/client/core/instructions/wrapperCollectInterest.js +35 -0
- package/build/client/core/instructions/wrapperCollectInterest.js.map +1 -0
- package/build/client/core/instructions/wrapperMerge.d.ts +24 -0
- package/build/client/core/instructions/wrapperMerge.js +44 -0
- package/build/client/core/instructions/wrapperMerge.js.map +1 -0
- package/build/client/core/instructions/wrapperProvideLiquidity.d.ts +35 -0
- package/build/client/core/instructions/wrapperProvideLiquidity.js +59 -0
- package/build/client/core/instructions/wrapperProvideLiquidity.js.map +1 -0
- package/build/client/core/instructions/wrapperProvideLiquidityBase.d.ts +28 -0
- package/build/client/core/instructions/wrapperProvideLiquidityBase.js +44 -0
- package/build/client/core/instructions/wrapperProvideLiquidityBase.js.map +1 -0
- package/build/client/core/instructions/wrapperProvideLiquidityClassic.d.ts +26 -0
- package/build/client/core/instructions/wrapperProvideLiquidityClassic.js +42 -0
- package/build/client/core/instructions/wrapperProvideLiquidityClassic.js.map +1 -0
- package/build/client/core/instructions/wrapperSellPt.d.ts +21 -0
- package/build/client/core/instructions/wrapperSellPt.js +33 -0
- package/build/client/core/instructions/wrapperSellPt.js.map +1 -0
- package/build/client/core/instructions/wrapperSellYt.d.ts +29 -0
- package/build/client/core/instructions/wrapperSellYt.js +49 -0
- package/build/client/core/instructions/wrapperSellYt.js.map +1 -0
- package/build/client/core/instructions/wrapperStrip.d.ts +26 -0
- package/build/client/core/instructions/wrapperStrip.js +46 -0
- package/build/client/core/instructions/wrapperStrip.js.map +1 -0
- package/build/client/core/instructions/wrapperWithdrawLiquidity.d.ts +26 -0
- package/build/client/core/instructions/wrapperWithdrawLiquidity.js +42 -0
- package/build/client/core/instructions/wrapperWithdrawLiquidity.js.map +1 -0
- package/build/client/core/instructions/wrapperWithdrawLiquidityClassic.d.ts +24 -0
- package/build/client/core/instructions/wrapperWithdrawLiquidityClassic.js +40 -0
- package/build/client/core/instructions/wrapperWithdrawLiquidityClassic.js.map +1 -0
- package/build/client/core/types/adminAction.d.ts +326 -0
- package/build/client/core/types/adminAction.js +87 -0
- package/build/client/core/types/adminAction.js.map +1 -0
- package/build/client/core/types/amount.d.ts +33 -0
- package/build/client/core/types/amount.js +20 -0
- package/build/client/core/types/amount.js.map +1 -0
- package/build/client/core/types/buyPtEvent.d.ts +27 -0
- package/build/client/core/types/buyPtEvent.js +19 -0
- package/build/client/core/types/buyPtEvent.js.map +1 -0
- package/build/client/core/types/buyYtEvent.d.ts +68 -0
- package/build/client/core/types/buyYtEvent.js +45 -0
- package/build/client/core/types/buyYtEvent.js.map +1 -0
- package/build/client/core/types/claimFarmEmissionsEvent.d.ts +43 -0
- package/build/client/core/types/claimFarmEmissionsEvent.js +35 -0
- package/build/client/core/types/claimFarmEmissionsEvent.js.map +1 -0
- package/build/client/core/types/claimFarmEmissionsEventV2.d.ts +98 -0
- package/build/client/core/types/claimFarmEmissionsEventV2.js +38 -0
- package/build/client/core/types/claimFarmEmissionsEventV2.js.map +1 -0
- package/build/client/core/types/claimLimits.d.ts +22 -0
- package/build/client/core/types/claimLimits.js +11 -0
- package/build/client/core/types/claimLimits.js.map +1 -0
- package/build/client/core/types/collectEmissionEvent.d.ts +35 -0
- package/build/client/core/types/collectEmissionEvent.js +24 -0
- package/build/client/core/types/collectEmissionEvent.js.map +1 -0
- package/build/client/core/types/collectEmissionEventV2.d.ts +68 -0
- package/build/client/core/types/collectEmissionEventV2.js +27 -0
- package/build/client/core/types/collectEmissionEventV2.js.map +1 -0
- package/build/client/core/types/collectInterestEvent.d.ts +31 -0
- package/build/client/core/types/collectInterestEvent.js +23 -0
- package/build/client/core/types/collectInterestEvent.js.map +1 -0
- package/build/client/core/types/collectInterestEventV2.d.ts +64 -0
- package/build/client/core/types/collectInterestEventV2.js +26 -0
- package/build/client/core/types/collectInterestEventV2.js.map +1 -0
- package/build/client/core/types/collectTreasuryEmissionKind.d.ts +5 -0
- package/build/client/core/types/collectTreasuryEmissionKind.js +11 -0
- package/build/client/core/types/collectTreasuryEmissionKind.js.map +1 -0
- package/build/client/core/types/collectTreasuryInterestKind.d.ts +5 -0
- package/build/client/core/types/collectTreasuryInterestKind.js +11 -0
- package/build/client/core/types/collectTreasuryInterestKind.js.map +1 -0
- package/build/client/core/types/cpiAccounts.d.ts +107 -0
- package/build/client/core/types/cpiAccounts.js +13 -0
- package/build/client/core/types/cpiAccounts.js.map +1 -0
- package/build/client/core/types/cpiInterfaceContext.d.ts +18 -0
- package/build/client/core/types/cpiInterfaceContext.js +10 -0
- package/build/client/core/types/cpiInterfaceContext.js.map +1 -0
- package/build/client/core/types/depositLiquidityEvent.d.ts +67 -0
- package/build/client/core/types/depositLiquidityEvent.js +47 -0
- package/build/client/core/types/depositLiquidityEvent.js.map +1 -0
- package/build/client/core/types/depositLpEvent.d.ts +43 -0
- package/build/client/core/types/depositLpEvent.js +35 -0
- package/build/client/core/types/depositLpEvent.js.map +1 -0
- package/build/client/core/types/depositLpEventV2.d.ts +98 -0
- package/build/client/core/types/depositLpEventV2.js +38 -0
- package/build/client/core/types/depositLpEventV2.js.map +1 -0
- package/build/client/core/types/depositYtEvent.d.ts +56 -0
- package/build/client/core/types/depositYtEvent.js +39 -0
- package/build/client/core/types/depositYtEvent.js.map +1 -0
- package/build/client/core/types/depositYtEventV2.d.ts +89 -0
- package/build/client/core/types/depositYtEventV2.js +42 -0
- package/build/client/core/types/depositYtEventV2.js.map +1 -0
- package/build/client/core/types/emissionInfo.d.ts +36 -0
- package/build/client/core/types/emissionInfo.js +22 -0
- package/build/client/core/types/emissionInfo.js.map +1 -0
- package/build/client/core/types/farmEmission.d.ts +24 -0
- package/build/client/core/types/farmEmission.js +16 -0
- package/build/client/core/types/farmEmission.js.map +1 -0
- package/build/client/core/types/index.d.ts +60 -0
- package/build/client/core/types/index.js +77 -0
- package/build/client/core/types/index.js.map +1 -0
- package/build/client/core/types/initLpPositionEvent.d.ts +35 -0
- package/build/client/core/types/initLpPositionEvent.js +27 -0
- package/build/client/core/types/initLpPositionEvent.js.map +1 -0
- package/build/client/core/types/initializeYieldPositionEvent.d.ts +23 -0
- package/build/client/core/types/initializeYieldPositionEvent.js +21 -0
- package/build/client/core/types/initializeYieldPositionEvent.js.map +1 -0
- package/build/client/core/types/liquidityNetBalanceLimits.d.ts +26 -0
- package/build/client/core/types/liquidityNetBalanceLimits.js +12 -0
- package/build/client/core/types/liquidityNetBalanceLimits.js.map +1 -0
- package/build/client/core/types/lpFarm.d.ts +35 -0
- package/build/client/core/types/lpFarm.js +10 -0
- package/build/client/core/types/lpFarm.js.map +1 -0
- package/build/client/core/types/marketAdminAction.d.ts +286 -0
- package/build/client/core/types/marketAdminAction.js +61 -0
- package/build/client/core/types/marketAdminAction.js.map +1 -0
- package/build/client/core/types/marketCollectEmissionEvent.d.ts +39 -0
- package/build/client/core/types/marketCollectEmissionEvent.js +31 -0
- package/build/client/core/types/marketCollectEmissionEvent.js.map +1 -0
- package/build/client/core/types/marketCollectEmissionEventV2.d.ts +94 -0
- package/build/client/core/types/marketCollectEmissionEventV2.js +34 -0
- package/build/client/core/types/marketCollectEmissionEventV2.js.map +1 -0
- package/build/client/core/types/marketEmission.d.ts +20 -0
- package/build/client/core/types/marketEmission.js +15 -0
- package/build/client/core/types/marketEmission.js.map +1 -0
- package/build/client/core/types/marketEmissions.d.ts +27 -0
- package/build/client/core/types/marketEmissions.js +9 -0
- package/build/client/core/types/marketEmissions.js.map +1 -0
- package/build/client/core/types/marketFinancials.d.ts +30 -0
- package/build/client/core/types/marketFinancials.js +13 -0
- package/build/client/core/types/marketFinancials.js.map +1 -0
- package/build/client/core/types/mergeEvent.d.ts +84 -0
- package/build/client/core/types/mergeEvent.js +55 -0
- package/build/client/core/types/mergeEvent.js.map +1 -0
- package/build/client/core/types/number.d.ts +2 -0
- package/build/client/core/types/number.js +8 -0
- package/build/client/core/types/number.js.map +1 -0
- package/build/client/core/types/personalYieldTracker.d.ts +15 -0
- package/build/client/core/types/personalYieldTracker.js +10 -0
- package/build/client/core/types/personalYieldTracker.js.map +1 -0
- package/build/client/core/types/personalYieldTrackers.d.ts +23 -0
- package/build/client/core/types/personalYieldTrackers.js +9 -0
- package/build/client/core/types/personalYieldTrackers.js.map +1 -0
- package/build/client/core/types/principleDetails.d.ts +11 -0
- package/build/client/core/types/principleDetails.js +12 -0
- package/build/client/core/types/principleDetails.js.map +1 -0
- package/build/client/core/types/principles.d.ts +79 -0
- package/build/client/core/types/principles.js +14 -0
- package/build/client/core/types/principles.js.map +1 -0
- package/build/client/core/types/sellPtEvent.d.ts +27 -0
- package/build/client/core/types/sellPtEvent.js +19 -0
- package/build/client/core/types/sellPtEvent.js.map +1 -0
- package/build/client/core/types/sellYtEvent.d.ts +59 -0
- package/build/client/core/types/sellYtEvent.js +42 -0
- package/build/client/core/types/sellYtEvent.js.map +1 -0
- package/build/client/core/types/stageYieldEvent.d.ts +44 -0
- package/build/client/core/types/stageYieldEvent.js +30 -0
- package/build/client/core/types/stageYieldEvent.js.map +1 -0
- package/build/client/core/types/stageYieldEventV2.d.ts +73 -0
- package/build/client/core/types/stageYieldEventV2.js +32 -0
- package/build/client/core/types/stageYieldEventV2.js.map +1 -0
- package/build/client/core/types/stripEvent.d.ts +84 -0
- package/build/client/core/types/stripEvent.js +58 -0
- package/build/client/core/types/stripEvent.js.map +1 -0
- package/build/client/core/types/tradePtEvent.d.ts +52 -0
- package/build/client/core/types/tradePtEvent.js +38 -0
- package/build/client/core/types/tradePtEvent.js.map +1 -0
- package/build/client/core/types/withdrawLiquidityEvent.d.ts +59 -0
- package/build/client/core/types/withdrawLiquidityEvent.js +45 -0
- package/build/client/core/types/withdrawLiquidityEvent.js.map +1 -0
- package/build/client/core/types/withdrawLpEvent.d.ts +43 -0
- package/build/client/core/types/withdrawLpEvent.js +35 -0
- package/build/client/core/types/withdrawLpEvent.js.map +1 -0
- package/build/client/core/types/withdrawLpEventV2.d.ts +98 -0
- package/build/client/core/types/withdrawLpEventV2.js +38 -0
- package/build/client/core/types/withdrawLpEventV2.js.map +1 -0
- package/build/client/core/types/withdrawYtEvent.d.ts +56 -0
- package/build/client/core/types/withdrawYtEvent.js +39 -0
- package/build/client/core/types/withdrawYtEvent.js.map +1 -0
- package/build/client/core/types/withdrawYtEventV2.d.ts +89 -0
- package/build/client/core/types/withdrawYtEventV2.js +42 -0
- package/build/client/core/types/withdrawYtEventV2.js.map +1 -0
- package/build/client/core/types/wrapperBuyYtEvent.d.ts +27 -0
- package/build/client/core/types/wrapperBuyYtEvent.js +19 -0
- package/build/client/core/types/wrapperBuyYtEvent.js.map +1 -0
- package/build/client/core/types/wrapperCollectInterestEvent.d.ts +23 -0
- package/build/client/core/types/wrapperCollectInterestEvent.js +18 -0
- package/build/client/core/types/wrapperCollectInterestEvent.js.map +1 -0
- package/build/client/core/types/wrapperMergeEvent.d.ts +27 -0
- package/build/client/core/types/wrapperMergeEvent.js +19 -0
- package/build/client/core/types/wrapperMergeEvent.js.map +1 -0
- package/build/client/core/types/wrapperProvideLiquidityBaseEvent.d.ts +35 -0
- package/build/client/core/types/wrapperProvideLiquidityBaseEvent.js +21 -0
- package/build/client/core/types/wrapperProvideLiquidityBaseEvent.js.map +1 -0
- package/build/client/core/types/wrapperProvideLiquidityClassicEvent.d.ts +31 -0
- package/build/client/core/types/wrapperProvideLiquidityClassicEvent.js +20 -0
- package/build/client/core/types/wrapperProvideLiquidityClassicEvent.js.map +1 -0
- package/build/client/core/types/wrapperProvideLiquidityEvent.d.ts +31 -0
- package/build/client/core/types/wrapperProvideLiquidityEvent.js +20 -0
- package/build/client/core/types/wrapperProvideLiquidityEvent.js.map +1 -0
- package/build/client/core/types/wrapperSellYtEvent.d.ts +27 -0
- package/build/client/core/types/wrapperSellYtEvent.js +19 -0
- package/build/client/core/types/wrapperSellYtEvent.js.map +1 -0
- package/build/client/core/types/wrapperStripEvent.d.ts +27 -0
- package/build/client/core/types/wrapperStripEvent.js +19 -0
- package/build/client/core/types/wrapperStripEvent.js.map +1 -0
- package/build/client/core/types/wrapperWithdrawLiquidityClassicEvent.d.ts +31 -0
- package/build/client/core/types/wrapperWithdrawLiquidityClassicEvent.js +20 -0
- package/build/client/core/types/wrapperWithdrawLiquidityClassicEvent.js.map +1 -0
- package/build/client/core/types/wrapperWithdrawLiquidityEvent.d.ts +27 -0
- package/build/client/core/types/wrapperWithdrawLiquidityEvent.js +19 -0
- package/build/client/core/types/wrapperWithdrawLiquidityEvent.js.map +1 -0
- package/build/client/core/types/yieldTokenTracker.d.ts +15 -0
- package/build/client/core/types/yieldTokenTracker.js +10 -0
- package/build/client/core/types/yieldTokenTracker.js.map +1 -0
- package/build/client/orderbook/accounts/cpiAccountsOrderbook.d.ts +18 -0
- package/build/client/orderbook/accounts/cpiAccountsOrderbook.js +66 -0
- package/build/client/orderbook/accounts/cpiAccountsOrderbook.js.map +1 -0
- package/build/client/orderbook/accounts/vault.d.ts +48 -0
- package/build/client/orderbook/accounts/vault.js +128 -0
- package/build/client/orderbook/accounts/vault.js.map +1 -0
- package/build/client/orderbook/eventRegistry.d.ts +45 -0
- package/build/client/orderbook/eventRegistry.js +44 -0
- package/build/client/orderbook/eventRegistry.js.map +1 -0
- package/build/client/orderbook/index.d.ts +51 -0
- package/build/client/orderbook/index.js +69 -0
- package/build/client/orderbook/index.js.map +1 -0
- package/build/client/orderbook/instructions/collectAdminEmission.d.ts +14 -0
- package/build/client/orderbook/instructions/collectAdminEmission.js +26 -0
- package/build/client/orderbook/instructions/collectAdminEmission.js.map +1 -0
- package/build/client/orderbook/instructions/collectAdminFee.d.ts +21 -0
- package/build/client/orderbook/instructions/collectAdminFee.js +34 -0
- package/build/client/orderbook/instructions/collectAdminFee.js.map +1 -0
- package/build/client/orderbook/instructions/collectInterest.d.ts +21 -0
- package/build/client/orderbook/instructions/collectInterest.js +37 -0
- package/build/client/orderbook/instructions/collectInterest.js.map +1 -0
- package/build/client/orderbook/instructions/initializeOrderbook.d.ts +36 -0
- package/build/client/orderbook/instructions/initializeOrderbook.js +52 -0
- package/build/client/orderbook/instructions/initializeOrderbook.js.map +1 -0
- package/build/client/orderbook/instructions/marketOffer.d.ts +30 -0
- package/build/client/orderbook/instructions/marketOffer.js +46 -0
- package/build/client/orderbook/instructions/marketOffer.js.map +1 -0
- package/build/client/orderbook/instructions/postOffer.d.ts +33 -0
- package/build/client/orderbook/instructions/postOffer.js +49 -0
- package/build/client/orderbook/instructions/postOffer.js.map +1 -0
- package/build/client/orderbook/instructions/reallocOrderbookAccount.d.ts +12 -0
- package/build/client/orderbook/instructions/reallocOrderbookAccount.js +24 -0
- package/build/client/orderbook/instructions/reallocOrderbookAccount.js.map +1 -0
- package/build/client/orderbook/instructions/removeExpiredOffers.d.ts +12 -0
- package/build/client/orderbook/instructions/removeExpiredOffers.js +21 -0
- package/build/client/orderbook/instructions/removeExpiredOffers.js.map +1 -0
- package/build/client/orderbook/instructions/removeOffer.d.ts +24 -0
- package/build/client/orderbook/instructions/removeOffer.js +40 -0
- package/build/client/orderbook/instructions/removeOffer.js.map +1 -0
- package/build/client/orderbook/instructions/setConfigurationOptions.d.ts +10 -0
- package/build/client/orderbook/instructions/setConfigurationOptions.js +22 -0
- package/build/client/orderbook/instructions/setConfigurationOptions.js.map +1 -0
- package/build/client/orderbook/instructions/withdrawFunds.d.ts +27 -0
- package/build/client/orderbook/instructions/withdrawFunds.js +43 -0
- package/build/client/orderbook/instructions/withdrawFunds.js.map +1 -0
- package/build/client/orderbook/instructions/wrapperCollectAdminFee.d.ts +24 -0
- package/build/client/orderbook/instructions/wrapperCollectAdminFee.js +40 -0
- package/build/client/orderbook/instructions/wrapperCollectAdminFee.js.map +1 -0
- package/build/client/orderbook/instructions/wrapperCollectInterest.d.ts +20 -0
- package/build/client/orderbook/instructions/wrapperCollectInterest.js +36 -0
- package/build/client/orderbook/instructions/wrapperCollectInterest.js.map +1 -0
- package/build/client/orderbook/instructions/wrapperMarketOffer.d.ts +32 -0
- package/build/client/orderbook/instructions/wrapperMarketOffer.js +48 -0
- package/build/client/orderbook/instructions/wrapperMarketOffer.js.map +1 -0
- package/build/client/orderbook/instructions/wrapperPostOffer.d.ts +34 -0
- package/build/client/orderbook/instructions/wrapperPostOffer.js +50 -0
- package/build/client/orderbook/instructions/wrapperPostOffer.js.map +1 -0
- package/build/client/orderbook/instructions/wrapperRemoveOffer.d.ts +25 -0
- package/build/client/orderbook/instructions/wrapperRemoveOffer.js +41 -0
- package/build/client/orderbook/instructions/wrapperRemoveOffer.js.map +1 -0
- package/build/client/orderbook/instructions/wrapperWithdrawFunds.d.ts +28 -0
- package/build/client/orderbook/instructions/wrapperWithdrawFunds.js +44 -0
- package/build/client/orderbook/instructions/wrapperWithdrawFunds.js.map +1 -0
- package/build/client/orderbook/types/amount.d.ts +33 -0
- package/build/client/orderbook/types/amount.js +20 -0
- package/build/client/orderbook/types/amount.js.map +1 -0
- package/build/client/orderbook/types/claimLimits.d.ts +22 -0
- package/build/client/orderbook/types/claimLimits.js +11 -0
- package/build/client/orderbook/types/claimLimits.js.map +1 -0
- package/build/client/orderbook/types/collectAdminEmissionEvent.d.ts +27 -0
- package/build/client/orderbook/types/collectAdminEmissionEvent.js +19 -0
- package/build/client/orderbook/types/collectAdminEmissionEvent.js.map +1 -0
- package/build/client/orderbook/types/collectAdminFeeEvent.d.ts +26 -0
- package/build/client/orderbook/types/collectAdminFeeEvent.js +12 -0
- package/build/client/orderbook/types/collectAdminFeeEvent.js.map +1 -0
- package/build/client/orderbook/types/collectEmissionEventV2.d.ts +68 -0
- package/build/client/orderbook/types/collectEmissionEventV2.js +27 -0
- package/build/client/orderbook/types/collectEmissionEventV2.js.map +1 -0
- package/build/client/orderbook/types/collectInterestEventV2.d.ts +64 -0
- package/build/client/orderbook/types/collectInterestEventV2.js +26 -0
- package/build/client/orderbook/types/collectInterestEventV2.js.map +1 -0
- package/build/client/orderbook/types/collectUserInterestEvent.d.ts +23 -0
- package/build/client/orderbook/types/collectUserInterestEvent.js +18 -0
- package/build/client/orderbook/types/collectUserInterestEvent.js.map +1 -0
- package/build/client/orderbook/types/cpiAccounts.d.ts +107 -0
- package/build/client/orderbook/types/cpiAccounts.js +13 -0
- package/build/client/orderbook/types/cpiAccounts.js.map +1 -0
- package/build/client/orderbook/types/cpiInterfaceContext.d.ts +18 -0
- package/build/client/orderbook/types/cpiInterfaceContext.js +10 -0
- package/build/client/orderbook/types/cpiInterfaceContext.js.map +1 -0
- package/build/client/orderbook/types/emissionInfo.d.ts +36 -0
- package/build/client/orderbook/types/emissionInfo.js +22 -0
- package/build/client/orderbook/types/emissionInfo.js.map +1 -0
- package/build/client/orderbook/types/exponentCoreCpiAccounts.d.ts +107 -0
- package/build/client/orderbook/types/exponentCoreCpiAccounts.js +13 -0
- package/build/client/orderbook/types/exponentCoreCpiAccounts.js.map +1 -0
- package/build/client/orderbook/types/filledOffersEvent.d.ts +30 -0
- package/build/client/orderbook/types/filledOffersEvent.js +13 -0
- package/build/client/orderbook/types/filledOffersEvent.js.map +1 -0
- package/build/client/orderbook/types/index.d.ts +30 -0
- package/build/client/orderbook/types/index.js +47 -0
- package/build/client/orderbook/types/index.js.map +1 -0
- package/build/client/orderbook/types/marketOfferEvent.d.ts +93 -0
- package/build/client/orderbook/types/marketOfferEvent.js +33 -0
- package/build/client/orderbook/types/marketOfferEvent.js.map +1 -0
- package/build/client/orderbook/types/mergeEvent.d.ts +84 -0
- package/build/client/orderbook/types/mergeEvent.js +55 -0
- package/build/client/orderbook/types/mergeEvent.js.map +1 -0
- package/build/client/orderbook/types/number.d.ts +2 -0
- package/build/client/orderbook/types/number.js +8 -0
- package/build/client/orderbook/types/number.js.map +1 -0
- package/build/client/orderbook/types/offerOptions.d.ts +24 -0
- package/build/client/orderbook/types/offerOptions.js +22 -0
- package/build/client/orderbook/types/offerOptions.js.map +1 -0
- package/build/client/orderbook/types/offerType.d.ts +5 -0
- package/build/client/orderbook/types/offerType.js +11 -0
- package/build/client/orderbook/types/offerType.js.map +1 -0
- package/build/client/orderbook/types/orderbookInitEvent.d.ts +39 -0
- package/build/client/orderbook/types/orderbookInitEvent.js +25 -0
- package/build/client/orderbook/types/orderbookInitEvent.js.map +1 -0
- package/build/client/orderbook/types/postOfferEvent.d.ts +118 -0
- package/build/client/orderbook/types/postOfferEvent.js +36 -0
- package/build/client/orderbook/types/postOfferEvent.js.map +1 -0
- package/build/client/orderbook/types/removeOfferEvent.d.ts +39 -0
- package/build/client/orderbook/types/removeOfferEvent.js +31 -0
- package/build/client/orderbook/types/removeOfferEvent.js.map +1 -0
- package/build/client/orderbook/types/setConfigurationOptionsEnum.d.ts +72 -0
- package/build/client/orderbook/types/setConfigurationOptionsEnum.js +34 -0
- package/build/client/orderbook/types/setConfigurationOptionsEnum.js.map +1 -0
- package/build/client/orderbook/types/stripEvent.d.ts +84 -0
- package/build/client/orderbook/types/stripEvent.js +58 -0
- package/build/client/orderbook/types/stripEvent.js.map +1 -0
- package/build/client/orderbook/types/withdrawFundsEvent.d.ts +39 -0
- package/build/client/orderbook/types/withdrawFundsEvent.js +31 -0
- package/build/client/orderbook/types/withdrawFundsEvent.js.map +1 -0
- package/build/client/orderbook/types/wrapperCollectAdminFeeEvent.d.ts +18 -0
- package/build/client/orderbook/types/wrapperCollectAdminFeeEvent.js +10 -0
- package/build/client/orderbook/types/wrapperCollectAdminFeeEvent.js.map +1 -0
- package/build/client/orderbook/types/wrapperCollectInterestEvent.d.ts +15 -0
- package/build/client/orderbook/types/wrapperCollectInterestEvent.js +13 -0
- package/build/client/orderbook/types/wrapperCollectInterestEvent.js.map +1 -0
- package/build/client/orderbook/types/wrapperMarketOfferEvent.d.ts +19 -0
- package/build/client/orderbook/types/wrapperMarketOfferEvent.js +14 -0
- package/build/client/orderbook/types/wrapperMarketOfferEvent.js.map +1 -0
- package/build/client/orderbook/types/wrapperPostOfferEvent.d.ts +39 -0
- package/build/client/orderbook/types/wrapperPostOfferEvent.js +34 -0
- package/build/client/orderbook/types/wrapperPostOfferEvent.js.map +1 -0
- package/build/client/orderbook/types/wrapperRemoveOfferEvent.d.ts +15 -0
- package/build/client/orderbook/types/wrapperRemoveOfferEvent.js +13 -0
- package/build/client/orderbook/types/wrapperRemoveOfferEvent.js.map +1 -0
- package/build/client/orderbook/types/wrapperWithdrawFundsEvent.d.ts +27 -0
- package/build/client/orderbook/types/wrapperWithdrawFundsEvent.js +19 -0
- package/build/client/orderbook/types/wrapperWithdrawFundsEvent.js.map +1 -0
- package/build/client/orderbook/types/yieldTokenTracker.d.ts +15 -0
- package/build/client/orderbook/types/yieldTokenTracker.js +10 -0
- package/build/client/orderbook/types/yieldTokenTracker.js.map +1 -0
- package/build/client/vaults/accounts/actionProposal.d.ts +30 -0
- package/build/client/vaults/accounts/actionProposal.js +84 -0
- package/build/client/vaults/accounts/actionProposal.js.map +1 -0
- package/build/client/vaults/accounts/exponentStrategyVault.d.ts +39 -0
- package/build/client/vaults/accounts/exponentStrategyVault.js +113 -0
- package/build/client/vaults/accounts/exponentStrategyVault.js.map +1 -0
- package/build/client/vaults/accounts/programConfig.d.ts +19 -0
- package/build/client/vaults/accounts/programConfig.js +76 -0
- package/build/client/vaults/accounts/programConfig.js.map +1 -0
- package/build/client/vaults/accounts/voteAccount.d.ts +23 -0
- package/build/client/vaults/accounts/voteAccount.js +80 -0
- package/build/client/vaults/accounts/voteAccount.js.map +1 -0
- package/build/client/vaults/accounts/withdrawalAccount.d.ts +23 -0
- package/build/client/vaults/accounts/withdrawalAccount.js +78 -0
- package/build/client/vaults/accounts/withdrawalAccount.js.map +1 -0
- package/build/client/vaults/eventRegistry.d.ts +27 -0
- package/build/client/vaults/eventRegistry.js +27 -0
- package/build/client/vaults/eventRegistry.js.map +1 -0
- package/build/client/vaults/index.d.ts +106 -0
- package/build/client/vaults/index.js +125 -0
- package/build/client/vaults/index.js.map +1 -0
- package/build/client/vaults/instructions/activateProposal.d.ts +12 -0
- package/build/client/vaults/instructions/activateProposal.js +25 -0
- package/build/client/vaults/instructions/activateProposal.js.map +1 -0
- package/build/client/vaults/instructions/addPolicy.d.ts +16 -0
- package/build/client/vaults/instructions/addPolicy.js +33 -0
- package/build/client/vaults/instructions/addPolicy.js.map +1 -0
- package/build/client/vaults/instructions/appendProposalActions.d.ts +13 -0
- package/build/client/vaults/instructions/appendProposalActions.js +26 -0
- package/build/client/vaults/instructions/appendProposalActions.js.map +1 -0
- package/build/client/vaults/instructions/cancelProposal.d.ts +7 -0
- package/build/client/vaults/instructions/cancelProposal.js +17 -0
- package/build/client/vaults/instructions/cancelProposal.js.map +1 -0
- package/build/client/vaults/instructions/cancelWithdrawal.d.ts +10 -0
- package/build/client/vaults/instructions/cancelWithdrawal.js +20 -0
- package/build/client/vaults/instructions/cancelWithdrawal.js.map +1 -0
- package/build/client/vaults/instructions/collectManagementFee.d.ts +9 -0
- package/build/client/vaults/instructions/collectManagementFee.js +19 -0
- package/build/client/vaults/instructions/collectManagementFee.js.map +1 -0
- package/build/client/vaults/instructions/depositLiquidity.d.ts +20 -0
- package/build/client/vaults/instructions/depositLiquidity.js +33 -0
- package/build/client/vaults/instructions/depositLiquidity.js.map +1 -0
- package/build/client/vaults/instructions/executeProposal.d.ts +11 -0
- package/build/client/vaults/instructions/executeProposal.js +21 -0
- package/build/client/vaults/instructions/executeProposal.js.map +1 -0
- package/build/client/vaults/instructions/executeWithdrawal.d.ts +18 -0
- package/build/client/vaults/instructions/executeWithdrawal.js +31 -0
- package/build/client/vaults/instructions/executeWithdrawal.js.map +1 -0
- package/build/client/vaults/instructions/executeWithdrawalFromReserves.d.ts +22 -0
- package/build/client/vaults/instructions/executeWithdrawalFromReserves.js +35 -0
- package/build/client/vaults/instructions/executeWithdrawalFromReserves.js.map +1 -0
- package/build/client/vaults/instructions/fillWithdrawal.d.ts +17 -0
- package/build/client/vaults/instructions/fillWithdrawal.js +34 -0
- package/build/client/vaults/instructions/fillWithdrawal.js.map +1 -0
- package/build/client/vaults/instructions/finalizeProposal.d.ts +7 -0
- package/build/client/vaults/instructions/finalizeProposal.js +17 -0
- package/build/client/vaults/instructions/finalizeProposal.js.map +1 -0
- package/build/client/vaults/instructions/initProposal.d.ts +12 -0
- package/build/client/vaults/instructions/initProposal.js +25 -0
- package/build/client/vaults/instructions/initProposal.js.map +1 -0
- package/build/client/vaults/instructions/initializePrices.d.ts +7 -0
- package/build/client/vaults/instructions/initializePrices.js +17 -0
- package/build/client/vaults/instructions/initializePrices.js.map +1 -0
- package/build/client/vaults/instructions/initializeVault.d.ts +44 -0
- package/build/client/vaults/instructions/initializeVault.js +80 -0
- package/build/client/vaults/instructions/initializeVault.js.map +1 -0
- package/build/client/vaults/instructions/makeSentienelManager.d.ts +7 -0
- package/build/client/vaults/instructions/makeSentienelManager.js +17 -0
- package/build/client/vaults/instructions/makeSentienelManager.js.map +1 -0
- package/build/client/vaults/instructions/managePrices.d.ts +11 -0
- package/build/client/vaults/instructions/managePrices.js +24 -0
- package/build/client/vaults/instructions/managePrices.js.map +1 -0
- package/build/client/vaults/instructions/manageVaultSettings.d.ts +12 -0
- package/build/client/vaults/instructions/manageVaultSettings.js +25 -0
- package/build/client/vaults/instructions/manageVaultSettings.js.map +1 -0
- package/build/client/vaults/instructions/managerUpdatePosition.d.ts +12 -0
- package/build/client/vaults/instructions/managerUpdatePosition.js +25 -0
- package/build/client/vaults/instructions/managerUpdatePosition.js.map +1 -0
- package/build/client/vaults/instructions/proposeAction.d.ts +16 -0
- package/build/client/vaults/instructions/proposeAction.js +29 -0
- package/build/client/vaults/instructions/proposeAction.js.map +1 -0
- package/build/client/vaults/instructions/queueWithdrawal.d.ts +14 -0
- package/build/client/vaults/instructions/queueWithdrawal.js +27 -0
- package/build/client/vaults/instructions/queueWithdrawal.js.map +1 -0
- package/build/client/vaults/instructions/removePolicy.d.ts +13 -0
- package/build/client/vaults/instructions/removePolicy.js +27 -0
- package/build/client/vaults/instructions/removePolicy.js.map +1 -0
- package/build/client/vaults/instructions/sentinelSetVaultFlags.d.ts +10 -0
- package/build/client/vaults/instructions/sentinelSetVaultFlags.js +23 -0
- package/build/client/vaults/instructions/sentinelSetVaultFlags.js.map +1 -0
- package/build/client/vaults/instructions/stakeVote.d.ts +18 -0
- package/build/client/vaults/instructions/stakeVote.js +31 -0
- package/build/client/vaults/instructions/stakeVote.js.map +1 -0
- package/build/client/vaults/instructions/unstakeVote.d.ts +14 -0
- package/build/client/vaults/instructions/unstakeVote.js +24 -0
- package/build/client/vaults/instructions/unstakeVote.js.map +1 -0
- package/build/client/vaults/instructions/updatePolicy.d.ts +17 -0
- package/build/client/vaults/instructions/updatePolicy.js +34 -0
- package/build/client/vaults/instructions/updatePolicy.js.map +1 -0
- package/build/client/vaults/instructions/updatePolicyManager.d.ts +13 -0
- package/build/client/vaults/instructions/updatePolicyManager.js +27 -0
- package/build/client/vaults/instructions/updatePolicyManager.js.map +1 -0
- package/build/client/vaults/instructions/updatePrice.d.ts +9 -0
- package/build/client/vaults/instructions/updatePrice.js +22 -0
- package/build/client/vaults/instructions/updatePrice.js.map +1 -0
- package/build/client/vaults/instructions/validateInteractionHook.d.ts +16 -0
- package/build/client/vaults/instructions/validateInteractionHook.js +33 -0
- package/build/client/vaults/instructions/validateInteractionHook.js.map +1 -0
- package/build/client/vaults/instructions/wrapperAddPolicy.d.ts +16 -0
- package/build/client/vaults/instructions/wrapperAddPolicy.js +33 -0
- package/build/client/vaults/instructions/wrapperAddPolicy.js.map +1 -0
- package/build/client/vaults/instructions/wrapperExecuteWithdrawal.d.ts +27 -0
- package/build/client/vaults/instructions/wrapperExecuteWithdrawal.js +40 -0
- package/build/client/vaults/instructions/wrapperExecuteWithdrawal.js.map +1 -0
- package/build/client/vaults/instructions/wrapperManageVaultSettings.d.ts +12 -0
- package/build/client/vaults/instructions/wrapperManageVaultSettings.js +25 -0
- package/build/client/vaults/instructions/wrapperManageVaultSettings.js.map +1 -0
- package/build/client/vaults/instructions/wrapperManagerUpdatePosition.d.ts +12 -0
- package/build/client/vaults/instructions/wrapperManagerUpdatePosition.js +25 -0
- package/build/client/vaults/instructions/wrapperManagerUpdatePosition.js.map +1 -0
- package/build/client/vaults/instructions/wrapperRemovePolicy.d.ts +13 -0
- package/build/client/vaults/instructions/wrapperRemovePolicy.js +27 -0
- package/build/client/vaults/instructions/wrapperRemovePolicy.js.map +1 -0
- package/build/client/vaults/instructions/wrapperUpdatePolicy.d.ts +17 -0
- package/build/client/vaults/instructions/wrapperUpdatePolicy.js +34 -0
- package/build/client/vaults/instructions/wrapperUpdatePolicy.js.map +1 -0
- package/build/client/vaults/types/accountConstraint.d.ts +20 -0
- package/build/client/vaults/types/accountConstraint.js +16 -0
- package/build/client/vaults/types/accountConstraint.js.map +1 -0
- package/build/client/vaults/types/accountConstraintType.d.ts +18 -0
- package/build/client/vaults/types/accountConstraintType.js +38 -0
- package/build/client/vaults/types/accountConstraintType.js.map +1 -0
- package/build/client/vaults/types/allowedSettingsChange.d.ts +79 -0
- package/build/client/vaults/types/allowedSettingsChange.js +45 -0
- package/build/client/vaults/types/allowedSettingsChange.js.map +1 -0
- package/build/client/vaults/types/cancelProposalEvent.d.ts +27 -0
- package/build/client/vaults/types/cancelProposalEvent.js +23 -0
- package/build/client/vaults/types/cancelProposalEvent.js.map +1 -0
- package/build/client/vaults/types/clmmPositionEntry.d.ts +88 -0
- package/build/client/vaults/types/clmmPositionEntry.js +20 -0
- package/build/client/vaults/types/clmmPositionEntry.js.map +1 -0
- package/build/client/vaults/types/dataConstraint.d.ts +116 -0
- package/build/client/vaults/types/dataConstraint.js +13 -0
- package/build/client/vaults/types/dataConstraint.js.map +1 -0
- package/build/client/vaults/types/dataOperator.d.ts +9 -0
- package/build/client/vaults/types/dataOperator.js +16 -0
- package/build/client/vaults/types/dataOperator.js.map +1 -0
- package/build/client/vaults/types/dataValue.d.ts +104 -0
- package/build/client/vaults/types/dataValue.js +33 -0
- package/build/client/vaults/types/dataValue.js.map +1 -0
- package/build/client/vaults/types/depositLiquidityEvent.d.ts +55 -0
- package/build/client/vaults/types/depositLiquidityEvent.js +42 -0
- package/build/client/vaults/types/depositLiquidityEvent.js.map +1 -0
- package/build/client/vaults/types/executeProposalEvent.d.ts +27 -0
- package/build/client/vaults/types/executeProposalEvent.js +23 -0
- package/build/client/vaults/types/executeProposalEvent.js.map +1 -0
- package/build/client/vaults/types/executeWithdrawalEvent.d.ts +14 -0
- package/build/client/vaults/types/executeWithdrawalEvent.js +10 -0
- package/build/client/vaults/types/executeWithdrawalEvent.js.map +1 -0
- package/build/client/vaults/types/fillParam.d.ts +14 -0
- package/build/client/vaults/types/fillParam.js +10 -0
- package/build/client/vaults/types/fillParam.js.map +1 -0
- package/build/client/vaults/types/finalizeProposalEvent.d.ts +48 -0
- package/build/client/vaults/types/finalizeProposalEvent.js +26 -0
- package/build/client/vaults/types/finalizeProposalEvent.js.map +1 -0
- package/build/client/vaults/types/hook.d.ts +44 -0
- package/build/client/vaults/types/hook.js +18 -0
- package/build/client/vaults/types/hook.js.map +1 -0
- package/build/client/vaults/types/hookCompiledInstruction.d.ts +18 -0
- package/build/client/vaults/types/hookCompiledInstruction.js +11 -0
- package/build/client/vaults/types/hookCompiledInstruction.js.map +1 -0
- package/build/client/vaults/types/index.d.ts +65 -0
- package/build/client/vaults/types/index.js +83 -0
- package/build/client/vaults/types/index.js.map +1 -0
- package/build/client/vaults/types/instructionConstraint.d.ts +173 -0
- package/build/client/vaults/types/instructionConstraint.js +17 -0
- package/build/client/vaults/types/instructionConstraint.js.map +1 -0
- package/build/client/vaults/types/internalFundTransferPolicyCreationPayload.d.ts +19 -0
- package/build/client/vaults/types/internalFundTransferPolicyCreationPayload.js +18 -0
- package/build/client/vaults/types/internalFundTransferPolicyCreationPayload.js.map +1 -0
- package/build/client/vaults/types/kaminoObligationEntry.d.ts +117 -0
- package/build/client/vaults/types/kaminoObligationEntry.js +23 -0
- package/build/client/vaults/types/kaminoObligationEntry.js.map +1 -0
- package/build/client/vaults/types/limitedQuantityConstraints.d.ts +10 -0
- package/build/client/vaults/types/limitedQuantityConstraints.js +9 -0
- package/build/client/vaults/types/limitedQuantityConstraints.js.map +1 -0
- package/build/client/vaults/types/limitedSpendingLimit.d.ts +105 -0
- package/build/client/vaults/types/limitedSpendingLimit.js +17 -0
- package/build/client/vaults/types/limitedSpendingLimit.js.map +1 -0
- package/build/client/vaults/types/limitedTimeConstraints.d.ts +67 -0
- package/build/client/vaults/types/limitedTimeConstraints.js +12 -0
- package/build/client/vaults/types/limitedTimeConstraints.js.map +1 -0
- package/build/client/vaults/types/loopscaleLoanEntry.d.ts +11 -0
- package/build/client/vaults/types/loopscaleLoanEntry.js +13 -0
- package/build/client/vaults/types/loopscaleLoanEntry.js.map +1 -0
- package/build/client/vaults/types/loopscaleStrategyEntry.d.ts +11 -0
- package/build/client/vaults/types/loopscaleStrategyEntry.js +13 -0
- package/build/client/vaults/types/loopscaleStrategyEntry.js.map +1 -0
- package/build/client/vaults/types/number.d.ts +2 -0
- package/build/client/vaults/types/number.js +9 -0
- package/build/client/vaults/types/number.js.map +1 -0
- package/build/client/vaults/types/obligationType.d.ts +13 -0
- package/build/client/vaults/types/obligationType.js +24 -0
- package/build/client/vaults/types/obligationType.js.map +1 -0
- package/build/client/vaults/types/orderbookEntry.d.ts +64 -0
- package/build/client/vaults/types/orderbookEntry.js +25 -0
- package/build/client/vaults/types/orderbookEntry.js.map +1 -0
- package/build/client/vaults/types/periodV2.d.ts +60 -0
- package/build/client/vaults/types/periodV2.js +24 -0
- package/build/client/vaults/types/periodV2.js.map +1 -0
- package/build/client/vaults/types/permissions.d.ts +10 -0
- package/build/client/vaults/types/permissions.js +7 -0
- package/build/client/vaults/types/permissions.js.map +1 -0
- package/build/client/vaults/types/policyAction.d.ts +61 -0
- package/build/client/vaults/types/policyAction.js +29 -0
- package/build/client/vaults/types/policyAction.js.map +1 -0
- package/build/client/vaults/types/policyConfig.d.ts +10 -0
- package/build/client/vaults/types/policyConfig.js +15 -0
- package/build/client/vaults/types/policyConfig.js.map +1 -0
- package/build/client/vaults/types/policyCreationPayload.d.ts +287 -0
- package/build/client/vaults/types/policyCreationPayload.js +50 -0
- package/build/client/vaults/types/policyCreationPayload.js.map +1 -0
- package/build/client/vaults/types/policyExpirationArgs.d.ts +33 -0
- package/build/client/vaults/types/policyExpirationArgs.js +21 -0
- package/build/client/vaults/types/policyExpirationArgs.js.map +1 -0
- package/build/client/vaults/types/positionUpdate.d.ts +45 -0
- package/build/client/vaults/types/positionUpdate.js +89 -0
- package/build/client/vaults/types/positionUpdate.js.map +1 -0
- package/build/client/vaults/types/priceId.d.ts +40 -0
- package/build/client/vaults/types/priceId.js +21 -0
- package/build/client/vaults/types/priceId.js.map +1 -0
- package/build/client/vaults/types/priceType.d.ts +19 -0
- package/build/client/vaults/types/priceType.js +26 -0
- package/build/client/vaults/types/priceType.js.map +1 -0
- package/build/client/vaults/types/programInteractionPolicyCreationPayload.d.ts +11 -0
- package/build/client/vaults/types/programInteractionPolicyCreationPayload.js +16 -0
- package/build/client/vaults/types/programInteractionPolicyCreationPayload.js.map +1 -0
- package/build/client/vaults/types/proposalAction.d.ts +226 -0
- package/build/client/vaults/types/proposalAction.js +40 -0
- package/build/client/vaults/types/proposalAction.js.map +1 -0
- package/build/client/vaults/types/proposalActionKind.d.ts +7 -0
- package/build/client/vaults/types/proposalActionKind.js +14 -0
- package/build/client/vaults/types/proposalActionKind.js.map +1 -0
- package/build/client/vaults/types/proposalStatus.d.ts +9 -0
- package/build/client/vaults/types/proposalStatus.js +16 -0
- package/build/client/vaults/types/proposalStatus.js.map +1 -0
- package/build/client/vaults/types/proposalVoteConfig.d.ts +46 -0
- package/build/client/vaults/types/proposalVoteConfig.js +18 -0
- package/build/client/vaults/types/proposalVoteConfig.js.map +1 -0
- package/build/client/vaults/types/proposeActionEvent.d.ts +48 -0
- package/build/client/vaults/types/proposeActionEvent.js +29 -0
- package/build/client/vaults/types/proposeActionEvent.js.map +1 -0
- package/build/client/vaults/types/quantityConstraints.d.ts +18 -0
- package/build/client/vaults/types/quantityConstraints.js +11 -0
- package/build/client/vaults/types/quantityConstraints.js.map +1 -0
- package/build/client/vaults/types/reservePriceMapping.d.ts +48 -0
- package/build/client/vaults/types/reservePriceMapping.js +15 -0
- package/build/client/vaults/types/reservePriceMapping.js.map +1 -0
- package/build/client/vaults/types/settingsChangePolicyCreationPayload.d.ts +81 -0
- package/build/client/vaults/types/settingsChangePolicyCreationPayload.js +10 -0
- package/build/client/vaults/types/settingsChangePolicyCreationPayload.js.map +1 -0
- package/build/client/vaults/types/spendingLimitPolicyCreationPayload.d.ts +142 -0
- package/build/client/vaults/types/spendingLimitPolicyCreationPayload.js +24 -0
- package/build/client/vaults/types/spendingLimitPolicyCreationPayload.js.map +1 -0
- package/build/client/vaults/types/stakeVoteEvent.d.ts +40 -0
- package/build/client/vaults/types/stakeVoteEvent.js +27 -0
- package/build/client/vaults/types/stakeVoteEvent.js.map +1 -0
- package/build/client/vaults/types/strategyPosition.d.ts +43 -0
- package/build/client/vaults/types/strategyPosition.js +54 -0
- package/build/client/vaults/types/strategyPosition.js.map +1 -0
- package/build/client/vaults/types/timeConstraints.d.ts +71 -0
- package/build/client/vaults/types/timeConstraints.js +13 -0
- package/build/client/vaults/types/timeConstraints.js.map +1 -0
- package/build/client/vaults/types/tokenAccountBalance.d.ts +52 -0
- package/build/client/vaults/types/tokenAccountBalance.js +19 -0
- package/build/client/vaults/types/tokenAccountBalance.js.map +1 -0
- package/build/client/vaults/types/tokenAccountEntry.d.ts +72 -0
- package/build/client/vaults/types/tokenAccountEntry.js +15 -0
- package/build/client/vaults/types/tokenAccountEntry.js.map +1 -0
- package/build/client/vaults/types/tokenEntry.d.ts +60 -0
- package/build/client/vaults/types/tokenEntry.js +24 -0
- package/build/client/vaults/types/tokenEntry.js.map +1 -0
- package/build/client/vaults/types/unstakeVoteEvent.d.ts +36 -0
- package/build/client/vaults/types/unstakeVoteEvent.js +26 -0
- package/build/client/vaults/types/unstakeVoteEvent.js.map +1 -0
- package/build/client/vaults/types/updatePriceAction.d.ts +174 -0
- package/build/client/vaults/types/updatePriceAction.js +104 -0
- package/build/client/vaults/types/updatePriceAction.js.map +1 -0
- package/build/client/vaults/types/updatePriceInput.d.ts +14 -0
- package/build/client/vaults/types/updatePriceInput.js +10 -0
- package/build/client/vaults/types/updatePriceInput.js.map +1 -0
- package/build/client/vaults/types/usageState.d.ts +14 -0
- package/build/client/vaults/types/usageState.js +10 -0
- package/build/client/vaults/types/usageState.js.map +1 -0
- package/build/client/vaults/types/vaultConfig.d.ts +87 -0
- package/build/client/vaults/types/vaultConfig.js +19 -0
- package/build/client/vaults/types/vaultConfig.js.map +1 -0
- package/build/client/vaults/types/vaultFinancials.d.ts +58 -0
- package/build/client/vaults/types/vaultFinancials.js +21 -0
- package/build/client/vaults/types/vaultFinancials.js.map +1 -0
- package/build/client/vaults/types/vaultFlagAction.d.ts +56 -0
- package/build/client/vaults/types/vaultFlagAction.js +22 -0
- package/build/client/vaults/types/vaultFlagAction.js.map +1 -0
- package/build/client/vaults/types/vaultFlagsUpdatedEvent.d.ts +23 -0
- package/build/client/vaults/types/vaultFlagsUpdatedEvent.js +19 -0
- package/build/client/vaults/types/vaultFlagsUpdatedEvent.js.map +1 -0
- package/build/client/vaults/types/vaultRoleKind.d.ts +7 -0
- package/build/client/vaults/types/vaultRoleKind.js +14 -0
- package/build/client/vaults/types/vaultRoleKind.js.map +1 -0
- package/build/client/vaults/types/vaultRoles.d.ts +23 -0
- package/build/client/vaults/types/vaultRoles.js +25 -0
- package/build/client/vaults/types/vaultRoles.js.map +1 -0
- package/build/client/vaults/types/vaultSettingsAction.d.ts +109 -0
- package/build/client/vaults/types/vaultSettingsAction.js +161 -0
- package/build/client/vaults/types/vaultSettingsAction.js.map +1 -0
- package/build/client/vaults/types/voteChoice.d.ts +5 -0
- package/build/client/vaults/types/voteChoice.js +12 -0
- package/build/client/vaults/types/voteChoice.js.map +1 -0
- package/build/client/vaults/types/withdrawalPeriodSettings.d.ts +48 -0
- package/build/client/vaults/types/withdrawalPeriodSettings.js +28 -0
- package/build/client/vaults/types/withdrawalPeriodSettings.js.map +1 -0
- package/build/client/vaults/types/withdrawalTokenFill.d.ts +19 -0
- package/build/client/vaults/types/withdrawalTokenFill.js +18 -0
- package/build/client/vaults/types/withdrawalTokenFill.js.map +1 -0
- package/build/client/vaults/types/yieldPositionEntry.d.ts +52 -0
- package/build/client/vaults/types/yieldPositionEntry.js +19 -0
- package/build/client/vaults/types/yieldPositionEntry.js.map +1 -0
- package/build/clmm/codamaEvents.d.ts +23 -0
- package/build/clmm/codamaEvents.js +24 -0
- package/build/clmm/codamaEvents.js.map +1 -0
- package/build/clmm/index.d.ts +1 -1
- package/build/clmm/index.js +1 -1
- package/build/clmm/index.js.map +1 -1
- package/build/codamaEvents.d.ts +18 -0
- package/build/codamaEvents.js +21 -0
- package/build/codamaEvents.js.map +1 -0
- package/build/environment.d.ts +8 -7
- package/build/environment.js +8 -7
- package/build/environment.js.map +1 -1
- package/build/exponentVaults/aumCalculator.d.ts +182 -0
- package/build/exponentVaults/aumCalculator.js +778 -0
- package/build/exponentVaults/aumCalculator.js.map +1 -0
- package/build/exponentVaults/events.d.ts +8 -0
- package/build/exponentVaults/events.js +12 -0
- package/build/exponentVaults/events.js.map +1 -0
- package/build/exponentVaults/index.d.ts +30 -0
- package/build/exponentVaults/index.js +176 -0
- package/build/exponentVaults/index.js.map +1 -0
- package/build/exponentVaults/kamino-markets.d.ts +887 -0
- package/build/exponentVaults/kamino-markets.js +345 -0
- package/build/exponentVaults/kamino-markets.js.map +1 -0
- package/build/exponentVaults/loopscale-client.d.ts +541 -0
- package/build/exponentVaults/loopscale-client.js +732 -0
- package/build/exponentVaults/loopscale-client.js.map +1 -0
- package/build/exponentVaults/policyBuilders.d.ts +694 -0
- package/build/exponentVaults/policyBuilders.js +1131 -0
- package/build/exponentVaults/policyBuilders.js.map +1 -0
- package/build/exponentVaults/policyMatcher.d.ts +82 -0
- package/build/exponentVaults/policyMatcher.js +730 -0
- package/build/exponentVaults/policyMatcher.js.map +1 -0
- package/build/exponentVaults/scope-refresh.d.ts +10 -0
- package/build/exponentVaults/scope-refresh.js +140 -0
- package/build/exponentVaults/scope-refresh.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/constants.d.ts +2 -0
- package/build/exponentVaults/squadsVaultTxnResolver/constants.js +61 -0
- package/build/exponentVaults/squadsVaultTxnResolver/constants.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/helpers.d.ts +26 -0
- package/build/exponentVaults/squadsVaultTxnResolver/helpers.js +268 -0
- package/build/exponentVaults/squadsVaultTxnResolver/helpers.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/index.d.ts +5 -0
- package/build/exponentVaults/squadsVaultTxnResolver/index.js +15 -0
- package/build/exponentVaults/squadsVaultTxnResolver/index.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/exponent.d.ts +6 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/exponent.js +361 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/exponent.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/helpers.d.ts +2 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/helpers.js +28 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/helpers.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/index.d.ts +2 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/index.js +25 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/index.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/kamino.d.ts +2 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/kamino.js +67 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/kamino.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/loopscale.d.ts +2 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/loopscale.js +73 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/loopscale.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/titan.d.ts +2 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/titan.js +35 -0
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/titan.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/squadsVaultTxnResolver.d.ts +21 -0
- package/build/exponentVaults/squadsVaultTxnResolver/squadsVaultTxnResolver.js +64 -0
- package/build/exponentVaults/squadsVaultTxnResolver/squadsVaultTxnResolver.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/types.d.ts +111 -0
- package/build/exponentVaults/squadsVaultTxnResolver/types.js +92 -0
- package/build/exponentVaults/squadsVaultTxnResolver/types.js.map +1 -0
- package/build/exponentVaults/squadsVaultTxnResolver/utils.d.ts +3 -0
- package/build/exponentVaults/squadsVaultTxnResolver/utils.js +8 -0
- package/build/exponentVaults/squadsVaultTxnResolver/utils.js.map +1 -0
- package/build/exponentVaults/syncTransaction.d.ts +84 -0
- package/build/exponentVaults/syncTransaction.js +341 -0
- package/build/exponentVaults/syncTransaction.js.map +1 -0
- package/build/exponentVaults/titan-quote.d.ts +22 -0
- package/build/exponentVaults/titan-quote.js +167 -0
- package/build/exponentVaults/titan-quote.js.map +1 -0
- package/build/exponentVaults/vault-interaction.d.ts +3475 -0
- package/build/exponentVaults/vault-interaction.js +2251 -0
- package/build/exponentVaults/vault-interaction.js.map +1 -0
- package/build/exponentVaults/vault.d.ts +613 -0
- package/build/exponentVaults/vault.js +1437 -0
- package/build/exponentVaults/vault.js.map +1 -0
- package/build/exponentVaults/vaultTransactionBuilder.d.ts +319 -0
- package/build/exponentVaults/vaultTransactionBuilder.js +470 -0
- package/build/exponentVaults/vaultTransactionBuilder.js.map +1 -0
- package/build/flavors.d.ts +3 -3
- package/build/flavors.js +115 -111
- package/build/flavors.js.map +1 -1
- package/build/index.d.ts +15 -8
- package/build/index.js +23 -7
- package/build/index.js.map +1 -1
- package/build/lpPosition.d.ts +13 -15
- package/build/lpPosition.js +2 -6
- package/build/lpPosition.js.map +1 -1
- package/build/market.d.ts +203 -230
- package/build/market.js +277 -371
- package/build/market.js.map +1 -1
- package/build/marketThree.d.ts +401 -267
- package/build/marketThree.js +613 -279
- package/build/marketThree.js.map +1 -1
- package/build/marketThree.test.js +12 -12
- package/build/marketThree.test.js.map +1 -1
- package/build/orderbook/codamaEvents.d.ts +19 -0
- package/build/orderbook/codamaEvents.js +22 -0
- package/build/orderbook/codamaEvents.js.map +1 -0
- package/build/orderbook/index.d.ts +6 -3
- package/build/orderbook/index.js +8 -4
- package/build/orderbook/index.js.map +1 -1
- package/build/orderbook/math.d.ts +4 -2
- package/build/orderbook/math.js +23 -11
- package/build/orderbook/math.js.map +1 -1
- package/build/orderbook/orderbook.d.ts +182 -104
- package/build/orderbook/orderbook.js +375 -208
- package/build/orderbook/orderbook.js.map +1 -1
- package/build/orderbook/types.d.ts +6 -20
- package/build/orderbook/types.js +25 -5
- package/build/orderbook/types.js.map +1 -1
- package/build/orderbook/utils.d.ts +1 -3
- package/build/orderbook/utils.js +4 -12
- package/build/orderbook/utils.js.map +1 -1
- package/build/router.d.ts +72 -12
- package/build/router.js +333 -3
- package/build/router.js.map +1 -1
- package/build/syPosition.d.ts +2 -2
- package/build/syPosition.js +7 -7
- package/build/syPosition.js.map +1 -1
- package/build/tokenUtil.d.ts +3 -3
- package/build/tokenUtil.js.map +1 -1
- package/build/utils/index.d.ts +4 -5
- package/build/utils/index.js +3 -24
- package/build/utils/index.js.map +1 -1
- package/build/utils/ix.d.ts +2 -2
- package/build/vault.d.ts +108 -221
- package/build/vault.js +141 -98
- package/build/vault.js.map +1 -1
- package/build/ytPosition.d.ts +28 -36
- package/build/ytPosition.js +71 -62
- package/build/ytPosition.js.map +1 -1
- package/package.json +58 -28
- package/src/CodamaEventDecoder.ts +151 -0
- package/src/addressLookupTableUtil.ts +48 -14
- package/src/client/clmm/accounts/lpPosition.ts +143 -0
- package/src/client/clmm/accounts/marketThree.ts +274 -0
- package/src/client/clmm/accounts/vault.ts +234 -0
- package/src/client/clmm/eventRegistry.ts +92 -0
- package/src/client/clmm/index.ts +82 -0
- package/src/client/clmm/instructions/addFarm.ts +57 -0
- package/src/client/clmm/instructions/addLiquidity.ts +78 -0
- package/src/client/clmm/instructions/addMarketEmission.ts +50 -0
- package/src/client/clmm/instructions/buyPt.ts +73 -0
- package/src/client/clmm/instructions/buyYt.ts +80 -0
- package/src/client/clmm/instructions/claimFarmEmission.ts +56 -0
- package/src/client/clmm/instructions/closeMarket.ts +47 -0
- package/src/client/clmm/instructions/depositLiquidity.ts +71 -0
- package/src/client/clmm/instructions/initializeMarket.ts +127 -0
- package/src/client/clmm/instructions/marketAccrueEmission.ts +39 -0
- package/src/client/clmm/instructions/marketCollectEmission.ts +57 -0
- package/src/client/clmm/instructions/modifyFarm.ts +55 -0
- package/src/client/clmm/instructions/modifyMarketSetting.ts +45 -0
- package/src/client/clmm/instructions/sellPt.ts +73 -0
- package/src/client/clmm/instructions/sellYt.ts +80 -0
- package/src/client/clmm/instructions/tradePt.ts +73 -0
- package/src/client/clmm/instructions/tradePtExactOut.ts +75 -0
- package/src/client/clmm/instructions/withdrawLiquidity.ts +67 -0
- package/src/client/clmm/instructions/wrapperBuyYt.ts +85 -0
- package/src/client/clmm/instructions/wrapperProvideLiquidity.ts +100 -0
- package/src/client/clmm/instructions/wrapperProvideLiquidityBase.ts +98 -0
- package/src/client/clmm/instructions/wrapperProvideLiquidityClassic.ts +86 -0
- package/src/client/clmm/instructions/wrapperSellYt.ts +83 -0
- package/src/client/clmm/instructions/wrapperWithdrawLiquidity.ts +75 -0
- package/src/client/clmm/instructions/wrapperWithdrawLiquidityClassic.ts +69 -0
- package/src/client/clmm/types/addFarmEvent.ts +51 -0
- package/src/client/clmm/types/amount.ts +51 -0
- package/src/client/clmm/types/buyPtEvent.ts +36 -0
- package/src/client/clmm/types/buyYtEvent.ts +74 -0
- package/src/client/clmm/types/claimFarmEmissionsEvent.ts +94 -0
- package/src/client/clmm/types/claimLimits.ts +15 -0
- package/src/client/clmm/types/closeMarketEvent.ts +36 -0
- package/src/client/clmm/types/configurationOptions.ts +29 -0
- package/src/client/clmm/types/cpiAccounts.ts +21 -0
- package/src/client/clmm/types/cpiCoreAccounts.ts +15 -0
- package/src/client/clmm/types/cpiInterfaceContext.ts +13 -0
- package/src/client/clmm/types/crossingSplit.ts +40 -0
- package/src/client/clmm/types/depositLiquidityEvent.ts +93 -0
- package/src/client/clmm/types/depositLiquidityReturnData.ts +81 -0
- package/src/client/clmm/types/emissionInfo.ts +44 -0
- package/src/client/clmm/types/farmEmission.ts +31 -0
- package/src/client/clmm/types/index.ts +48 -0
- package/src/client/clmm/types/liquidityNetBalanceLimits.ts +22 -0
- package/src/client/clmm/types/lpFarm.ts +12 -0
- package/src/client/clmm/types/marketAccrueEmissionEvent.ts +69 -0
- package/src/client/clmm/types/marketAdminAction.ts +239 -0
- package/src/client/clmm/types/marketCollectEmissionEvent.ts +83 -0
- package/src/client/clmm/types/marketEmission.ts +28 -0
- package/src/client/clmm/types/marketEmissions.ts +10 -0
- package/src/client/clmm/types/marketFinancials.ts +17 -0
- package/src/client/clmm/types/marketThreeInitEvent.ts +92 -0
- package/src/client/clmm/types/mergeEvent.ts +118 -0
- package/src/client/clmm/types/modifiedTick.ts +13 -0
- package/src/client/clmm/types/modifiedTicks.ts +18 -0
- package/src/client/clmm/types/modifyFarmEvent.ts +56 -0
- package/src/client/clmm/types/number.ts +7 -0
- package/src/client/clmm/types/personalYieldTracker.ts +12 -0
- package/src/client/clmm/types/personalYieldTrackers.ts +13 -0
- package/src/client/clmm/types/principalShare.ts +22 -0
- package/src/client/clmm/types/principalShareTrackers.ts +10 -0
- package/src/client/clmm/types/sellPtEvent.ts +36 -0
- package/src/client/clmm/types/sellYtEvent.ts +69 -0
- package/src/client/clmm/types/stripEvent.ts +124 -0
- package/src/client/clmm/types/swapDirection.ts +8 -0
- package/src/client/clmm/types/tradePtEvent.ts +76 -0
- package/src/client/clmm/types/withdrawLiquidityEvent.ts +99 -0
- package/src/client/clmm/types/withdrawLiquidityReturnData.ts +27 -0
- package/src/client/clmm/types/wrapperBuyYtEvent.ts +36 -0
- package/src/client/clmm/types/wrapperProvideLiquidityBaseEvent.ts +60 -0
- package/src/client/clmm/types/wrapperProvideLiquidityClassicEvent.ts +58 -0
- package/src/client/clmm/types/wrapperProvideLiquidityEvent.ts +60 -0
- package/src/client/clmm/types/wrapperSellYtEvent.ts +36 -0
- package/src/client/clmm/types/wrapperWithdrawLiquidityClassicEvent.ts +62 -0
- package/src/client/clmm/types/wrapperWithdrawLiquidityEvent.ts +62 -0
- package/src/client/core/accounts/admin.ts +112 -0
- package/src/client/core/accounts/lpPosition.ts +122 -0
- package/src/client/core/accounts/marketTwo.ts +234 -0
- package/src/client/core/accounts/vault.ts +234 -0
- package/src/client/core/accounts/yieldTokenPosition.ts +126 -0
- package/src/client/core/eventRegistry.ts +134 -0
- package/src/client/core/index.ts +113 -0
- package/src/client/core/instructions/addEmission.ts +62 -0
- package/src/client/core/instructions/addFarm.ts +53 -0
- package/src/client/core/instructions/addLpTokensMetadata.ts +62 -0
- package/src/client/core/instructions/addMarketEmission.ts +52 -0
- package/src/client/core/instructions/buyYt.ts +79 -0
- package/src/client/core/instructions/claimFarmEmissions.ts +54 -0
- package/src/client/core/instructions/collectEmission.ts +66 -0
- package/src/client/core/instructions/collectInterest.ts +64 -0
- package/src/client/core/instructions/collectTreasuryEmission.ts +64 -0
- package/src/client/core/instructions/collectTreasuryInterest.ts +62 -0
- package/src/client/core/instructions/depositYt.ts +59 -0
- package/src/client/core/instructions/initLpPosition.ts +35 -0
- package/src/client/core/instructions/initMarketTwo.ts +103 -0
- package/src/client/core/instructions/initializeVault.ts +107 -0
- package/src/client/core/instructions/initializeYieldPosition.ts +33 -0
- package/src/client/core/instructions/marketCollectEmission.ts +55 -0
- package/src/client/core/instructions/marketDepositLp.ts +59 -0
- package/src/client/core/instructions/marketTwoDepositLiquidity.ts +65 -0
- package/src/client/core/instructions/marketTwoWithdrawLiquidity.ts +65 -0
- package/src/client/core/instructions/marketWithdrawLp.ts +59 -0
- package/src/client/core/instructions/merge.ts +61 -0
- package/src/client/core/instructions/modifyFarm.ts +51 -0
- package/src/client/core/instructions/modifyMarketSetting.ts +47 -0
- package/src/client/core/instructions/modifyVaultSetting.ts +44 -0
- package/src/client/core/instructions/reallocMarket.ts +45 -0
- package/src/client/core/instructions/sellYt.ts +79 -0
- package/src/client/core/instructions/stageYtYield.ts +39 -0
- package/src/client/core/instructions/strip.ts +61 -0
- package/src/client/core/instructions/tradePt.ts +59 -0
- package/src/client/core/instructions/withdrawYt.ts +61 -0
- package/src/client/core/instructions/wrapperBuyPt.ts +63 -0
- package/src/client/core/instructions/wrapperBuyYt.ts +93 -0
- package/src/client/core/instructions/wrapperCollectInterest.ts +63 -0
- package/src/client/core/instructions/wrapperMerge.ts +77 -0
- package/src/client/core/instructions/wrapperProvideLiquidity.ts +103 -0
- package/src/client/core/instructions/wrapperProvideLiquidityBase.ts +81 -0
- package/src/client/core/instructions/wrapperProvideLiquidityClassic.ts +77 -0
- package/src/client/core/instructions/wrapperSellPt.ts +63 -0
- package/src/client/core/instructions/wrapperSellYt.ts +87 -0
- package/src/client/core/instructions/wrapperStrip.ts +81 -0
- package/src/client/core/instructions/wrapperWithdrawLiquidity.ts +77 -0
- package/src/client/core/instructions/wrapperWithdrawLiquidityClassic.ts +73 -0
- package/src/client/core/types/adminAction.ts +255 -0
- package/src/client/core/types/amount.ts +51 -0
- package/src/client/core/types/buyPtEvent.ts +39 -0
- package/src/client/core/types/buyYtEvent.ts +95 -0
- package/src/client/core/types/claimFarmEmissionsEvent.ts +75 -0
- package/src/client/core/types/claimFarmEmissionsEventV2.ts +83 -0
- package/src/client/core/types/claimLimits.ts +15 -0
- package/src/client/core/types/collectEmissionEvent.ts +51 -0
- package/src/client/core/types/collectEmissionEventV2.ts +60 -0
- package/src/client/core/types/collectInterestEvent.ts +48 -0
- package/src/client/core/types/collectInterestEventV2.ts +57 -0
- package/src/client/core/types/collectTreasuryEmissionKind.ts +8 -0
- package/src/client/core/types/collectTreasuryInterestKind.ts +8 -0
- package/src/client/core/types/cpiAccounts.ts +21 -0
- package/src/client/core/types/cpiInterfaceContext.ts +13 -0
- package/src/client/core/types/depositLiquidityEvent.ts +101 -0
- package/src/client/core/types/depositLpEvent.ts +75 -0
- package/src/client/core/types/depositLpEventV2.ts +83 -0
- package/src/client/core/types/depositYtEvent.ts +82 -0
- package/src/client/core/types/depositYtEventV2.ts +91 -0
- package/src/client/core/types/emissionInfo.ts +44 -0
- package/src/client/core/types/farmEmission.ts +31 -0
- package/src/client/core/types/index.ts +60 -0
- package/src/client/core/types/initLpPositionEvent.ts +57 -0
- package/src/client/core/types/initializeYieldPositionEvent.ts +43 -0
- package/src/client/core/types/liquidityNetBalanceLimits.ts +22 -0
- package/src/client/core/types/lpFarm.ts +12 -0
- package/src/client/core/types/marketAdminAction.ts +212 -0
- package/src/client/core/types/marketCollectEmissionEvent.ts +67 -0
- package/src/client/core/types/marketCollectEmissionEventV2.ts +75 -0
- package/src/client/core/types/marketEmission.ts +28 -0
- package/src/client/core/types/marketEmissions.ts +10 -0
- package/src/client/core/types/marketFinancials.ts +19 -0
- package/src/client/core/types/mergeEvent.ts +118 -0
- package/src/client/core/types/number.ts +7 -0
- package/src/client/core/types/personalYieldTracker.ts +12 -0
- package/src/client/core/types/personalYieldTrackers.ts +13 -0
- package/src/client/core/types/principleDetails.ts +25 -0
- package/src/client/core/types/principles.ts +23 -0
- package/src/client/core/types/sellPtEvent.ts +39 -0
- package/src/client/core/types/sellYtEvent.ts +90 -0
- package/src/client/core/types/stageYieldEvent.ts +63 -0
- package/src/client/core/types/stageYieldEventV2.ts +69 -0
- package/src/client/core/types/stripEvent.ts +124 -0
- package/src/client/core/types/tradePtEvent.ts +80 -0
- package/src/client/core/types/withdrawLiquidityEvent.ts +97 -0
- package/src/client/core/types/withdrawLpEvent.ts +75 -0
- package/src/client/core/types/withdrawLpEventV2.ts +83 -0
- package/src/client/core/types/withdrawYtEvent.ts +82 -0
- package/src/client/core/types/withdrawYtEventV2.ts +91 -0
- package/src/client/core/types/wrapperBuyYtEvent.ts +39 -0
- package/src/client/core/types/wrapperCollectInterestEvent.ts +37 -0
- package/src/client/core/types/wrapperMergeEvent.ts +38 -0
- package/src/client/core/types/wrapperProvideLiquidityBaseEvent.ts +43 -0
- package/src/client/core/types/wrapperProvideLiquidityClassicEvent.ts +41 -0
- package/src/client/core/types/wrapperProvideLiquidityEvent.ts +41 -0
- package/src/client/core/types/wrapperSellYtEvent.ts +39 -0
- package/src/client/core/types/wrapperStripEvent.ts +38 -0
- package/src/client/core/types/wrapperWithdrawLiquidityClassicEvent.ts +41 -0
- package/src/client/core/types/wrapperWithdrawLiquidityEvent.ts +39 -0
- package/src/client/core/types/yieldTokenTracker.ts +12 -0
- package/src/client/orderbook/accounts/cpiAccountsOrderbook.ts +101 -0
- package/src/client/orderbook/accounts/vault.ts +234 -0
- package/src/client/orderbook/eventRegistry.ts +71 -0
- package/src/client/orderbook/index.ts +55 -0
- package/src/client/orderbook/instructions/collectAdminEmission.ts +48 -0
- package/src/client/orderbook/instructions/collectAdminFee.ts +59 -0
- package/src/client/orderbook/instructions/collectInterest.ts +66 -0
- package/src/client/orderbook/instructions/initializeOrderbook.ts +104 -0
- package/src/client/orderbook/instructions/marketOffer.ts +89 -0
- package/src/client/orderbook/instructions/postOffer.ts +96 -0
- package/src/client/orderbook/instructions/reallocOrderbookAccount.ts +45 -0
- package/src/client/orderbook/instructions/removeExpiredOffers.ts +37 -0
- package/src/client/orderbook/instructions/removeOffer.ts +73 -0
- package/src/client/orderbook/instructions/setConfigurationOptions.ts +43 -0
- package/src/client/orderbook/instructions/withdrawFunds.ts +78 -0
- package/src/client/orderbook/instructions/wrapperCollectAdminFee.ts +73 -0
- package/src/client/orderbook/instructions/wrapperCollectInterest.ts +65 -0
- package/src/client/orderbook/instructions/wrapperMarketOffer.ts +94 -0
- package/src/client/orderbook/instructions/wrapperPostOffer.ts +99 -0
- package/src/client/orderbook/instructions/wrapperRemoveOffer.ts +75 -0
- package/src/client/orderbook/instructions/wrapperWithdrawFunds.ts +80 -0
- package/src/client/orderbook/types/amount.ts +51 -0
- package/src/client/orderbook/types/claimLimits.ts +15 -0
- package/src/client/orderbook/types/collectAdminEmissionEvent.ts +39 -0
- package/src/client/orderbook/types/collectAdminFeeEvent.ts +17 -0
- package/src/client/orderbook/types/collectEmissionEventV2.ts +60 -0
- package/src/client/orderbook/types/collectInterestEventV2.ts +57 -0
- package/src/client/orderbook/types/collectUserInterestEvent.ts +36 -0
- package/src/client/orderbook/types/cpiAccounts.ts +21 -0
- package/src/client/orderbook/types/cpiInterfaceContext.ts +13 -0
- package/src/client/orderbook/types/emissionInfo.ts +44 -0
- package/src/client/orderbook/types/exponentCoreCpiAccounts.ts +21 -0
- package/src/client/orderbook/types/filledOffersEvent.ts +19 -0
- package/src/client/orderbook/types/index.ts +30 -0
- package/src/client/orderbook/types/marketOfferEvent.ts +72 -0
- package/src/client/orderbook/types/mergeEvent.ts +118 -0
- package/src/client/orderbook/types/number.ts +7 -0
- package/src/client/orderbook/types/offerOptions.ts +56 -0
- package/src/client/orderbook/types/offerType.ts +8 -0
- package/src/client/orderbook/types/orderbookInitEvent.ts +54 -0
- package/src/client/orderbook/types/postOfferEvent.ts +78 -0
- package/src/client/orderbook/types/removeOfferEvent.ts +67 -0
- package/src/client/orderbook/types/setConfigurationOptionsEnum.ts +116 -0
- package/src/client/orderbook/types/stripEvent.ts +124 -0
- package/src/client/orderbook/types/withdrawFundsEvent.ts +65 -0
- package/src/client/orderbook/types/wrapperCollectAdminFeeEvent.ts +13 -0
- package/src/client/orderbook/types/wrapperCollectInterestEvent.ts +25 -0
- package/src/client/orderbook/types/wrapperMarketOfferEvent.ts +27 -0
- package/src/client/orderbook/types/wrapperPostOfferEvent.ts +72 -0
- package/src/client/orderbook/types/wrapperRemoveOfferEvent.ts +25 -0
- package/src/client/orderbook/types/wrapperWithdrawFundsEvent.ts +38 -0
- package/src/client/orderbook/types/yieldTokenTracker.ts +12 -0
- package/src/client/vaults/accounts/actionProposal.ts +144 -0
- package/src/client/vaults/accounts/exponentStrategyVault.ts +211 -0
- package/src/client/vaults/accounts/programConfig.ts +123 -0
- package/src/client/vaults/accounts/voteAccount.ts +132 -0
- package/src/client/vaults/accounts/withdrawalAccount.ts +132 -0
- package/src/client/vaults/eventRegistry.ts +45 -0
- package/src/client/vaults/index.ts +111 -0
- package/src/client/vaults/instructions/activateProposal.ts +46 -0
- package/src/client/vaults/instructions/addPolicy.ts +57 -0
- package/src/client/vaults/instructions/appendProposalActions.ts +47 -0
- package/src/client/vaults/instructions/cancelProposal.ts +28 -0
- package/src/client/vaults/instructions/cancelWithdrawal.ts +34 -0
- package/src/client/vaults/instructions/collectManagementFee.ts +32 -0
- package/src/client/vaults/instructions/depositLiquidity.ts +62 -0
- package/src/client/vaults/instructions/executeProposal.ts +36 -0
- package/src/client/vaults/instructions/executeWithdrawal.ts +58 -0
- package/src/client/vaults/instructions/executeWithdrawalFromReserves.ts +66 -0
- package/src/client/vaults/instructions/fillWithdrawal.ts +59 -0
- package/src/client/vaults/instructions/finalizeProposal.ts +28 -0
- package/src/client/vaults/instructions/initProposal.ts +46 -0
- package/src/client/vaults/instructions/initializePrices.ts +28 -0
- package/src/client/vaults/instructions/initializeVault.ts +148 -0
- package/src/client/vaults/instructions/makeSentienelManager.ts +28 -0
- package/src/client/vaults/instructions/managePrices.ts +46 -0
- package/src/client/vaults/instructions/manageVaultSettings.ts +48 -0
- package/src/client/vaults/instructions/managerUpdatePosition.ts +45 -0
- package/src/client/vaults/instructions/queueWithdrawal.ts +50 -0
- package/src/client/vaults/instructions/removePolicy.ts +44 -0
- package/src/client/vaults/instructions/sentinelSetVaultFlags.ts +44 -0
- package/src/client/vaults/instructions/stakeVote.ts +57 -0
- package/src/client/vaults/instructions/unstakeVote.ts +42 -0
- package/src/client/vaults/instructions/updatePolicy.ts +59 -0
- package/src/client/vaults/instructions/updatePolicyManager.ts +44 -0
- package/src/client/vaults/instructions/updatePrice.ts +42 -0
- package/src/client/vaults/instructions/validateInteractionHook.ts +60 -0
- package/src/client/vaults/instructions/wrapperAddPolicy.ts +57 -0
- package/src/client/vaults/instructions/wrapperExecuteWithdrawal.ts +76 -0
- package/src/client/vaults/instructions/wrapperManageVaultSettings.ts +48 -0
- package/src/client/vaults/instructions/wrapperManagerUpdatePosition.ts +45 -0
- package/src/client/vaults/instructions/wrapperRemovePolicy.ts +44 -0
- package/src/client/vaults/instructions/wrapperUpdatePolicy.ts +59 -0
- package/src/client/vaults/types/accountConstraint.ts +35 -0
- package/src/client/vaults/types/accountConstraintType.ts +93 -0
- package/src/client/vaults/types/allowedSettingsChange.ts +136 -0
- package/src/client/vaults/types/cancelProposalEvent.ts +47 -0
- package/src/client/vaults/types/clmmPositionEntry.ts +37 -0
- package/src/client/vaults/types/dataConstraint.ts +16 -0
- package/src/client/vaults/types/dataOperator.ts +13 -0
- package/src/client/vaults/types/dataValue.ts +119 -0
- package/src/client/vaults/types/depositLiquidityEvent.ts +89 -0
- package/src/client/vaults/types/executeProposalEvent.ts +47 -0
- package/src/client/vaults/types/executeWithdrawalEvent.ts +12 -0
- package/src/client/vaults/types/fillParam.ts +12 -0
- package/src/client/vaults/types/finalizeProposalEvent.ts +51 -0
- package/src/client/vaults/types/hook.ts +40 -0
- package/src/client/vaults/types/hookCompiledInstruction.ts +20 -0
- package/src/client/vaults/types/index.ts +66 -0
- package/src/client/vaults/types/instructionConstraint.ts +33 -0
- package/src/client/vaults/types/internalFundTransferPolicyCreationPayload.ts +35 -0
- package/src/client/vaults/types/kaminoObligationEntry.ts +48 -0
- package/src/client/vaults/types/limitedQuantityConstraints.ts +10 -0
- package/src/client/vaults/types/limitedSpendingLimit.ts +35 -0
- package/src/client/vaults/types/limitedTimeConstraints.ts +15 -0
- package/src/client/vaults/types/loopscaleLoanEntry.ts +23 -0
- package/src/client/vaults/types/loopscaleStrategyEntry.ts +23 -0
- package/src/client/vaults/types/number.ts +8 -0
- package/src/client/vaults/types/obligationType.ts +63 -0
- package/src/client/vaults/types/orderbookEntry.ts +50 -0
- package/src/client/vaults/types/periodV2.ts +76 -0
- package/src/client/vaults/types/permissions.ts +8 -0
- package/src/client/vaults/types/policyAction.ts +74 -0
- package/src/client/vaults/types/policyConfig.ts +32 -0
- package/src/client/vaults/types/policyCreationPayload.ts +147 -0
- package/src/client/vaults/types/policyExpirationArgs.ts +67 -0
- package/src/client/vaults/types/positionUpdate.ts +251 -0
- package/src/client/vaults/types/priceId.ts +57 -0
- package/src/client/vaults/types/priceType.ts +23 -0
- package/src/client/vaults/types/programInteractionPolicyCreationPayload.ts +32 -0
- package/src/client/vaults/types/proposalAction.ts +100 -0
- package/src/client/vaults/types/proposalActionKind.ts +11 -0
- package/src/client/vaults/types/proposalStatus.ts +13 -0
- package/src/client/vaults/types/proposalVoteConfig.ts +36 -0
- package/src/client/vaults/types/proposeActionEvent.ts +62 -0
- package/src/client/vaults/types/quantityConstraints.ts +14 -0
- package/src/client/vaults/types/reservePriceMapping.ts +26 -0
- package/src/client/vaults/types/settingsChangePolicyCreationPayload.ts +14 -0
- package/src/client/vaults/types/spendingLimitPolicyCreationPayload.ts +54 -0
- package/src/client/vaults/types/stakeVoteEvent.ts +54 -0
- package/src/client/vaults/types/strategyPosition.ts +161 -0
- package/src/client/vaults/types/timeConstraints.ts +22 -0
- package/src/client/vaults/types/tokenAccountBalance.ts +35 -0
- package/src/client/vaults/types/tokenAccountEntry.ts +30 -0
- package/src/client/vaults/types/tokenEntry.ts +48 -0
- package/src/client/vaults/types/unstakeVoteEvent.ts +53 -0
- package/src/client/vaults/types/updatePriceAction.ts +268 -0
- package/src/client/vaults/types/updatePriceInput.ts +12 -0
- package/src/client/vaults/types/usageState.ts +12 -0
- package/src/client/vaults/types/vaultConfig.ts +38 -0
- package/src/client/vaults/types/vaultFinancials.ts +40 -0
- package/src/client/vaults/types/vaultFlagAction.ts +75 -0
- package/src/client/vaults/types/vaultFlagsUpdatedEvent.ts +37 -0
- package/src/client/vaults/types/vaultRoleKind.ts +11 -0
- package/src/client/vaults/types/vaultRoles.ts +59 -0
- package/src/client/vaults/types/vaultSettingsAction.ts +533 -0
- package/src/client/vaults/types/voteChoice.ts +9 -0
- package/src/client/vaults/types/withdrawalPeriodSettings.ts +83 -0
- package/src/client/vaults/types/withdrawalTokenFill.ts +35 -0
- package/src/client/vaults/types/yieldPositionEntry.ts +35 -0
- package/src/clmm/codamaEvents.ts +34 -0
- package/src/clmm/index.ts +1 -1
- package/src/codamaEvents.ts +27 -0
- package/src/environment.ts +15 -13
- package/src/exponentVaults/aumCalculator.ts +1013 -0
- package/src/exponentVaults/events.ts +15 -0
- package/src/exponentVaults/index.ts +298 -0
- package/src/exponentVaults/kamino-markets.ts +363 -0
- package/src/exponentVaults/loopscale-client.ts +1373 -0
- package/src/exponentVaults/policyBuilders.ts +1559 -0
- package/src/exponentVaults/policyMatcher.ts +895 -0
- package/src/exponentVaults/scope-refresh.ts +169 -0
- package/src/exponentVaults/squadsVaultTxnResolver/constants.ts +59 -0
- package/src/exponentVaults/squadsVaultTxnResolver/helpers.ts +355 -0
- package/src/exponentVaults/squadsVaultTxnResolver/index.ts +16 -0
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/exponent.ts +472 -0
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/helpers.ts +33 -0
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/index.ts +38 -0
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/kamino.ts +83 -0
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/loopscale.ts +94 -0
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/titan.ts +41 -0
- package/src/exponentVaults/squadsVaultTxnResolver/squadsVaultTxnResolver.ts +91 -0
- package/src/exponentVaults/squadsVaultTxnResolver/types.ts +171 -0
- package/src/exponentVaults/squadsVaultTxnResolver/utils.ts +3 -0
- package/src/exponentVaults/syncTransaction.ts +495 -0
- package/src/exponentVaults/titan-quote.ts +260 -0
- package/src/exponentVaults/vault-interaction.ts +3479 -0
- package/src/exponentVaults/vault.ts +2256 -0
- package/src/exponentVaults/vaultTransactionBuilder.ts +785 -0
- package/src/flavors.ts +100 -99
- package/src/index.ts +17 -8
- package/src/lpPosition.ts +13 -18
- package/src/market.ts +461 -544
- package/src/marketThree.test.ts +16 -14
- package/src/marketThree.ts +906 -483
- package/src/orderbook/codamaEvents.ts +28 -0
- package/src/orderbook/index.ts +5 -4
- package/src/orderbook/math.ts +25 -9
- package/src/orderbook/orderbook.ts +531 -330
- package/src/orderbook/types.ts +6 -11
- package/src/orderbook/utils.ts +4 -12
- package/src/router.ts +469 -19
- package/src/syPosition.ts +15 -16
- package/src/tokenUtil.ts +4 -4
- package/src/utils/index.ts +5 -31
- package/src/utils/ix.ts +2 -2
- package/src/vault.ts +282 -327
- package/src/ytPosition.ts +75 -118
- package/tsconfig.json +6 -1
- package/build/EventDecoderV2.d.ts +0 -31
- package/build/EventDecoderV2.js +0 -76
- package/build/EventDecoderV2.js.map +0 -1
- package/build/clmm/events.d.ts +0 -10
- package/build/clmm/events.js +0 -10
- package/build/clmm/events.js.map +0 -1
- package/build/events.d.ts +0 -563
- package/build/events.js +0 -301
- package/build/events.js.map +0 -1
- package/build/eventsV2.d.ts +0 -7
- package/build/eventsV2.js +0 -10
- package/build/eventsV2.js.map +0 -1
- package/build/orderbook/events.d.ts +0 -7
- package/build/orderbook/events.js +0 -10
- package/build/orderbook/events.js.map +0 -1
- package/src/EventDecoderV2.ts +0 -96
- package/src/clmm/events.ts +0 -17
- package/src/events.ts +0 -921
- package/src/eventsV2.ts +0 -13
- package/src/orderbook/events.ts +0 -13
package/src/marketThree.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { AnchorProvider, BN, Program, web3 } from "@coral-xyz/anchor"
|
|
2
1
|
import {
|
|
3
2
|
TOKEN_PROGRAM_ID,
|
|
4
3
|
createAssociatedTokenAccountIdempotentInstruction,
|
|
5
4
|
getAccount,
|
|
6
5
|
getAssociatedTokenAddressSync,
|
|
7
6
|
} from "@solana/spl-token"
|
|
7
|
+
import bs58 from "bs58"
|
|
8
8
|
import Decimal from "decimal.js"
|
|
9
9
|
|
|
10
|
-
import { ExponentClmm, IDL } from "@exponent-labs/exponent-clmm-idl"
|
|
11
10
|
import { ExponentCLMMPDA } from "@exponent-labs/exponent-clmm-pda"
|
|
12
11
|
import {
|
|
13
12
|
ExponentFetcher,
|
|
@@ -18,12 +17,10 @@ import {
|
|
|
18
17
|
MarketThreeFinancials,
|
|
19
18
|
Ticks,
|
|
20
19
|
} from "@exponent-labs/exponent-fetcher"
|
|
21
|
-
import { IDL as EXPONENT_CORE_IDL, ExponentCore } from "@exponent-labs/exponent-idl"
|
|
22
20
|
import { ExponentPDA } from "@exponent-labs/exponent-pda"
|
|
23
21
|
import {
|
|
24
22
|
AnchorizedPNum,
|
|
25
23
|
CpiAccountsRaw,
|
|
26
|
-
CpiAccountsRawJson,
|
|
27
24
|
ExponentCoreCpiAccountsRaw,
|
|
28
25
|
Flavor,
|
|
29
26
|
SyPosition,
|
|
@@ -51,10 +48,13 @@ import {
|
|
|
51
48
|
makeFlavorMarginfiSync,
|
|
52
49
|
makeFlavorPerenaSync,
|
|
53
50
|
} from "./flavors"
|
|
54
|
-
import { MyWallet } from "./market"
|
|
55
51
|
import { makeSyPosition } from "./syPosition"
|
|
56
|
-
import { emitEventAuthority,
|
|
52
|
+
import { emitEventAuthority, uniqueRemainingAccounts } from "./utils"
|
|
57
53
|
import { Vault } from "./vault"
|
|
54
|
+
import { Connection, Keypair, PublicKey, SYSVAR_INSTRUCTIONS_PUBKEY, SYSVAR_RENT_PUBKEY, SystemProgram, TransactionInstruction } from "@solana/web3.js"
|
|
55
|
+
import * as exponentClmm from './client/clmm'
|
|
56
|
+
import { SwapDirection } from './client/clmm'
|
|
57
|
+
import * as exponentCore from './client/core'
|
|
58
58
|
|
|
59
59
|
export { LiquidityAdd }
|
|
60
60
|
|
|
@@ -62,13 +62,13 @@ const SECONDS_PER_YEAR = 365 * 24 * 60 * 60
|
|
|
62
62
|
|
|
63
63
|
interface Emission {
|
|
64
64
|
/** Token account that holds emission tokens */
|
|
65
|
-
escrowAccountAddress:
|
|
65
|
+
escrowAccountAddress: PublicKey
|
|
66
66
|
|
|
67
67
|
/** Mint for the emission token */
|
|
68
|
-
mint:
|
|
68
|
+
mint: PublicKey
|
|
69
69
|
|
|
70
70
|
/** Token program ID for the emission token */
|
|
71
|
-
tokenProgramAddress:
|
|
71
|
+
tokenProgramAddress: PublicKey
|
|
72
72
|
|
|
73
73
|
/** How many emissions have been claimed by SY holders */
|
|
74
74
|
totalClaimed: bigint
|
|
@@ -80,24 +80,9 @@ interface Emission {
|
|
|
80
80
|
index: AnchorizedPNum
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export type MarketAdminAction =
|
|
84
|
-
| { setStatus: [number] }
|
|
85
|
-
| { setMaxLpSupply: [BN] }
|
|
86
|
-
| { changeTreasuryTradeSyBpsFee: [number] }
|
|
87
|
-
| { changeLnFeeRateRoot: [number] }
|
|
88
|
-
| {
|
|
89
|
-
changeLiquidityNetBalanceLimits: {
|
|
90
|
-
maxNetBalanceChangeNegativePercentage: number
|
|
91
|
-
maxNetBalanceChangePositivePercentage: number
|
|
92
|
-
windowDurationSeconds: number
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
| { changeEpsilonClamp: [number] }
|
|
96
|
-
| { changeMinLpTickAmount: [BN] }
|
|
97
|
-
| { changeTickSpace: [number] }
|
|
83
|
+
export type MarketAdminAction = exponentClmm.MarketAdminAction
|
|
98
84
|
|
|
99
|
-
|
|
100
|
-
export type SwapDirection = { ptToSy: {} } | { syToPt: {} }
|
|
85
|
+
export { SwapDirection } from './client/clmm'
|
|
101
86
|
|
|
102
87
|
interface MarketThreeLoadOptions {
|
|
103
88
|
syConfig?: {
|
|
@@ -106,20 +91,19 @@ interface MarketThreeLoadOptions {
|
|
|
106
91
|
}
|
|
107
92
|
|
|
108
93
|
type MarketThreeArgs = {
|
|
109
|
-
admin:
|
|
110
|
-
addressLookupTable:
|
|
111
|
-
mintPt:
|
|
112
|
-
mintYt:
|
|
113
|
-
mintSy:
|
|
94
|
+
admin: PublicKey
|
|
95
|
+
addressLookupTable: PublicKey
|
|
96
|
+
mintPt: PublicKey
|
|
97
|
+
mintYt: PublicKey
|
|
98
|
+
mintSy: PublicKey
|
|
114
99
|
vault: Vault
|
|
115
|
-
tokenPtEscrow:
|
|
116
|
-
tokenSyEscrow:
|
|
117
|
-
tokenYtEscrow:
|
|
118
|
-
tokenFeeTreasurySy:
|
|
119
|
-
tokenFeeTreasuryPt:
|
|
120
|
-
syProgram:
|
|
121
|
-
|
|
122
|
-
selfAddress: web3.PublicKey
|
|
100
|
+
tokenPtEscrow: PublicKey
|
|
101
|
+
tokenSyEscrow: PublicKey
|
|
102
|
+
tokenYtEscrow: PublicKey
|
|
103
|
+
tokenFeeTreasurySy: PublicKey
|
|
104
|
+
tokenFeeTreasuryPt: PublicKey
|
|
105
|
+
syProgram: PublicKey
|
|
106
|
+
selfAddress: PublicKey
|
|
123
107
|
statusFlags: number
|
|
124
108
|
configurationOptions: MarketConfigurationOptions
|
|
125
109
|
financials: MarketThreeFinancials
|
|
@@ -130,44 +114,77 @@ type MarketThreeArgs = {
|
|
|
130
114
|
flavor: Flavor
|
|
131
115
|
emissions: {
|
|
132
116
|
trackers: {
|
|
133
|
-
tokenEscrow:
|
|
117
|
+
tokenEscrow: PublicKey
|
|
134
118
|
lpShareIndex: number
|
|
135
119
|
lastSeenStaged: number
|
|
136
120
|
}[]
|
|
137
121
|
}
|
|
138
122
|
liquidityNetBalanceLimits: LiquidityNetBalanceLimits
|
|
139
|
-
ticksAccount:
|
|
123
|
+
ticksAccount: PublicKey
|
|
140
124
|
ticks: Ticks
|
|
141
125
|
syPosition: SyPosition
|
|
142
|
-
treasuryFeeOwner:
|
|
126
|
+
treasuryFeeOwner: PublicKey
|
|
143
127
|
}
|
|
144
128
|
|
|
129
|
+
/**
|
|
130
|
+
* CLMM (Concentrated Liquidity Market Maker) market client for the Exponent protocol.
|
|
131
|
+
*
|
|
132
|
+
* Provides instruction builders for trading PT/YT tokens, managing concentrated liquidity positions,
|
|
133
|
+
* and administering market settings. Each `ix*` method returns one or more Solana `TransactionInstruction`s
|
|
134
|
+
* ready to be included in a transaction.
|
|
135
|
+
*
|
|
136
|
+
* "Wrapper" methods (e.g. `ixWrapperBuyPt`) combine a base-asset mint/redeem step with the
|
|
137
|
+
* underlying trade so the caller can operate directly with the base asset rather than SY.
|
|
138
|
+
*/
|
|
145
139
|
export class MarketThree {
|
|
146
|
-
clmmProgram: Program<ExponentClmm>
|
|
147
|
-
coreProgram: Program<ExponentCore>
|
|
148
140
|
xponPda: ExponentPDA
|
|
149
141
|
pda: ExponentCLMMPDA
|
|
150
142
|
|
|
151
143
|
constructor(
|
|
152
144
|
public state: MarketThreeArgs,
|
|
153
|
-
public selfAddress:
|
|
145
|
+
public selfAddress: PublicKey,
|
|
154
146
|
public env: Environment,
|
|
155
|
-
public connection:
|
|
147
|
+
public connection: Connection,
|
|
156
148
|
) {
|
|
157
149
|
this.xponPda = new ExponentPDA(env.coreProgramId)
|
|
158
150
|
this.pda = new ExponentCLMMPDA()
|
|
159
|
-
const mockWallet = new MyWallet(web3.Keypair.generate())
|
|
160
|
-
this.clmmProgram = new Program<ExponentClmm>(IDL as ExponentClmm, new AnchorProvider(connection, mockWallet))
|
|
161
|
-
this.coreProgram = new Program(
|
|
162
|
-
EXPONENT_CORE_IDL as ExponentCore,
|
|
163
|
-
new AnchorProvider(connection, new MyWallet(web3.Keypair.generate())),
|
|
164
|
-
)
|
|
165
151
|
}
|
|
166
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Build the modify_market_setting instruction without loading the full market.
|
|
154
|
+
* Use this when the market's ALT is invalid/unset (e.g. repair flow) to avoid fetching the ALT.
|
|
155
|
+
*/
|
|
156
|
+
static buildModifyMarketSettingIx(
|
|
157
|
+
connection: Connection,
|
|
158
|
+
marketAddress: PublicKey,
|
|
159
|
+
{ signer, adminAction }: { signer: PublicKey; adminAction: MarketAdminAction },
|
|
160
|
+
): TransactionInstruction {
|
|
161
|
+
return exponentClmm
|
|
162
|
+
.createModifyMarketSettingInstruction(
|
|
163
|
+
{
|
|
164
|
+
market: marketAddress,
|
|
165
|
+
signer,
|
|
166
|
+
systemProgram: SystemProgram.programId,
|
|
167
|
+
},
|
|
168
|
+
{'action': adminAction}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Load a MarketThree instance from on-chain state.
|
|
173
|
+
*
|
|
174
|
+
* Fetches the market account, its address lookup table, vault, and ticks data in parallel.
|
|
175
|
+
* Pre-loaded vault/ticks can be passed to avoid redundant fetches.
|
|
176
|
+
*
|
|
177
|
+
* @param env - Environment configuration (program IDs, cluster)
|
|
178
|
+
* @param connection - Solana RPC connection
|
|
179
|
+
* @param address - On-chain address of the market account
|
|
180
|
+
* @param vault - Optional pre-loaded vault (fetched automatically if omitted)
|
|
181
|
+
* @param ticks - Optional pre-loaded ticks data (fetched automatically if omitted)
|
|
182
|
+
* @param options - Optional load options (e.g. SY config overrides)
|
|
183
|
+
*/
|
|
167
184
|
static async load(
|
|
168
185
|
env: Environment,
|
|
169
|
-
connection:
|
|
170
|
-
address:
|
|
186
|
+
connection: Connection,
|
|
187
|
+
address: PublicKey,
|
|
171
188
|
vault?: Vault,
|
|
172
189
|
ticks?: Ticks,
|
|
173
190
|
options: MarketThreeLoadOptions = {},
|
|
@@ -218,7 +235,7 @@ export class MarketThree {
|
|
|
218
235
|
return new MarketThree(state, address, env, connection)
|
|
219
236
|
}
|
|
220
237
|
|
|
221
|
-
async reload(connection:
|
|
238
|
+
async reload(connection: Connection = this.connection) {
|
|
222
239
|
const market = await MarketThree.load(this.env, connection, this.selfAddress)
|
|
223
240
|
this.state = market.state
|
|
224
241
|
return market
|
|
@@ -289,7 +306,7 @@ export class MarketThree {
|
|
|
289
306
|
}
|
|
290
307
|
|
|
291
308
|
get coreEventAuthority() {
|
|
292
|
-
return emitEventAuthority(
|
|
309
|
+
return emitEventAuthority(exponentCore.EXPONENTCORE_PROGRAM_ID)
|
|
293
310
|
}
|
|
294
311
|
|
|
295
312
|
get emissions(): Emission[] {
|
|
@@ -347,32 +364,32 @@ export class MarketThree {
|
|
|
347
364
|
}
|
|
348
365
|
|
|
349
366
|
/** Get the escrow token account addresses for the emissions, in order */
|
|
350
|
-
get emissionTokenAccounts():
|
|
367
|
+
get emissionTokenAccounts(): PublicKey[] {
|
|
351
368
|
return this.emissions.map((e) => e.escrowAccountAddress)
|
|
352
369
|
}
|
|
353
370
|
|
|
354
371
|
/** Pass-through SY account owned by the market */
|
|
355
|
-
get tokenSyEscrow():
|
|
372
|
+
get tokenSyEscrow(): PublicKey {
|
|
356
373
|
return this.state.tokenSyEscrow
|
|
357
374
|
}
|
|
358
375
|
|
|
359
376
|
/** Pass-through YT account owned by the market */
|
|
360
|
-
get tokenYtEscrow():
|
|
377
|
+
get tokenYtEscrow(): PublicKey {
|
|
361
378
|
return this.state.tokenYtEscrow
|
|
362
379
|
}
|
|
363
380
|
|
|
364
381
|
/** SY account that holds treasury SY fees from PT trading */
|
|
365
|
-
get tokenFeeTreasurySy():
|
|
382
|
+
get tokenFeeTreasurySy(): PublicKey {
|
|
366
383
|
return this.state.tokenFeeTreasurySy
|
|
367
384
|
}
|
|
368
385
|
|
|
369
386
|
/** PT account that holds treasury PT fees from PT trading */
|
|
370
|
-
get tokenFeeTreasuryPt():
|
|
387
|
+
get tokenFeeTreasuryPt(): PublicKey {
|
|
371
388
|
return this.state.tokenFeeTreasuryPt
|
|
372
389
|
}
|
|
373
390
|
|
|
374
391
|
/** Market liquidity for PT */
|
|
375
|
-
get tokenPtEscrow():
|
|
392
|
+
get tokenPtEscrow(): PublicKey {
|
|
376
393
|
return this.state.tokenPtEscrow
|
|
377
394
|
}
|
|
378
395
|
|
|
@@ -381,8 +398,8 @@ export class MarketThree {
|
|
|
381
398
|
}
|
|
382
399
|
|
|
383
400
|
/** Special account for event emit self-cpi */
|
|
384
|
-
get eventAuthority():
|
|
385
|
-
return emitEventAuthority(
|
|
401
|
+
get eventAuthority(): PublicKey {
|
|
402
|
+
return emitEventAuthority(exponentClmm.EXPONENTCLMM_PROGRAM_ID)
|
|
386
403
|
}
|
|
387
404
|
|
|
388
405
|
get secondsRemaining(): number {
|
|
@@ -411,9 +428,9 @@ export class MarketThree {
|
|
|
411
428
|
|
|
412
429
|
/** Get the owner of the treasury fee accounts: tokenFeeTreasuryPt & tokenFeeTreasurySy */
|
|
413
430
|
static async fetchTreasuryFeeOwner(
|
|
414
|
-
tokenFeeTreasury:
|
|
415
|
-
connection:
|
|
416
|
-
): Promise<
|
|
431
|
+
tokenFeeTreasury: PublicKey,
|
|
432
|
+
connection: Connection,
|
|
433
|
+
): Promise<PublicKey> {
|
|
417
434
|
const { owner } = await getAccount(connection, tokenFeeTreasury)
|
|
418
435
|
return owner
|
|
419
436
|
}
|
|
@@ -426,7 +443,7 @@ export class MarketThree {
|
|
|
426
443
|
*
|
|
427
444
|
* The token accounts themselves are optional, and will be derived from the depositor's wallet if not provided
|
|
428
445
|
*/
|
|
429
|
-
|
|
446
|
+
ixDepositLiquidity({
|
|
430
447
|
ptInIntent,
|
|
431
448
|
syInIntent,
|
|
432
449
|
depositor,
|
|
@@ -444,50 +461,49 @@ export class MarketThree {
|
|
|
444
461
|
lowerTickKey: number
|
|
445
462
|
/** Upper tick key */
|
|
446
463
|
upperTickKey: number
|
|
447
|
-
depositor:
|
|
448
|
-
ptSrc?:
|
|
449
|
-
sySrc?:
|
|
450
|
-
lpPosition?:
|
|
464
|
+
depositor: PublicKey
|
|
465
|
+
ptSrc?: PublicKey
|
|
466
|
+
sySrc?: PublicKey
|
|
467
|
+
lpPosition?: Keypair
|
|
451
468
|
}) {
|
|
452
|
-
const tokenProgram = TOKEN_PROGRAM_ID
|
|
453
|
-
|
|
454
469
|
const sySrc = sySrcParam || getAssociatedTokenAddressSync(this.mintSy, depositor, true, TOKEN_PROGRAM_ID)
|
|
455
470
|
const ptSrc = ptSrcParam || getAssociatedTokenAddressSync(this.mintPt, depositor, true, TOKEN_PROGRAM_ID)
|
|
456
471
|
|
|
457
|
-
const lpPosition = lpPositionParam ||
|
|
472
|
+
const lpPosition = lpPositionParam || Keypair.generate()
|
|
458
473
|
const remainingAccounts = uniqueRemainingAccounts([
|
|
459
474
|
...this.cpiSyAccounts.depositSy,
|
|
460
475
|
...this.cpiSyAccounts.getPositionState,
|
|
461
476
|
])
|
|
462
477
|
|
|
463
|
-
const ix =
|
|
464
|
-
|
|
465
|
-
convertApyToApyBp(lowerTickKey),
|
|
466
|
-
convertApyToApyBp(upperTickKey),
|
|
467
|
-
new BN(ptInIntent.toString()),
|
|
468
|
-
new BN(syInIntent.toString()),
|
|
469
|
-
)
|
|
470
|
-
.accountsStrict({
|
|
478
|
+
const ix = exponentClmm.createDepositLiquidityInstruction(
|
|
479
|
+
{
|
|
471
480
|
depositor,
|
|
472
481
|
market: this.selfAddress,
|
|
482
|
+
ticks: this.ticksKey,
|
|
483
|
+
lpPosition: lpPosition.publicKey,
|
|
473
484
|
tokenPtSrc: ptSrc,
|
|
474
485
|
tokenSySrc: sySrc,
|
|
475
486
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
476
487
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
477
488
|
addressLookupTable: this.addressLookupTable,
|
|
489
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
478
490
|
syProgram: this.syProgram,
|
|
479
|
-
|
|
491
|
+
instructionsSysvar: SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
492
|
+
systemProgram: SystemProgram.programId,
|
|
480
493
|
eventAuthority: this.eventAuthority,
|
|
481
|
-
program:
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
494
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
lowerTickKey: convertApyToApyBp(lowerTickKey),
|
|
498
|
+
upperTickKey: convertApyToApyBp(upperTickKey),
|
|
499
|
+
maxPtIn: ptInIntent,
|
|
500
|
+
maxSyIn: syInIntent,
|
|
501
|
+
},
|
|
502
|
+
)
|
|
503
|
+
ix.keys.push(...remainingAccounts)
|
|
488
504
|
|
|
489
505
|
return {
|
|
490
|
-
ix
|
|
506
|
+
ix,
|
|
491
507
|
signers: lpPosition,
|
|
492
508
|
}
|
|
493
509
|
}
|
|
@@ -501,7 +517,7 @@ export class MarketThree {
|
|
|
501
517
|
*
|
|
502
518
|
* The token accounts themselves are optional, and will be derived from the withdrawer's wallet if not provided
|
|
503
519
|
*/
|
|
504
|
-
|
|
520
|
+
ixWithdrawLiquidity({
|
|
505
521
|
lpIn,
|
|
506
522
|
withdrawer,
|
|
507
523
|
lpPosition,
|
|
@@ -511,12 +527,12 @@ export class MarketThree {
|
|
|
511
527
|
syDst: syDstParam,
|
|
512
528
|
}: {
|
|
513
529
|
lpIn: bigint
|
|
514
|
-
withdrawer:
|
|
515
|
-
lpPosition:
|
|
530
|
+
withdrawer: PublicKey
|
|
531
|
+
lpPosition: PublicKey
|
|
516
532
|
minPtOut: bigint
|
|
517
533
|
minSyOut: bigint
|
|
518
|
-
ptDst?:
|
|
519
|
-
syDst?:
|
|
534
|
+
ptDst?: PublicKey
|
|
535
|
+
syDst?: PublicKey
|
|
520
536
|
lnImpliedApyLimit?: number
|
|
521
537
|
}) {
|
|
522
538
|
const ptDst = ptDstParam || getAssociatedTokenAddressSync(this.mintPt, withdrawer, true, TOKEN_PROGRAM_ID)
|
|
@@ -528,31 +544,46 @@ export class MarketThree {
|
|
|
528
544
|
...this.cpiSyAccounts.getPositionState,
|
|
529
545
|
])
|
|
530
546
|
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
.accountsStrict({
|
|
547
|
+
const ix = exponentClmm.createWithdrawLiquidityInstruction(
|
|
548
|
+
{
|
|
534
549
|
owner: withdrawer,
|
|
535
550
|
market: this.selfAddress,
|
|
551
|
+
lpPosition,
|
|
552
|
+
ticks: this.ticksKey,
|
|
536
553
|
tokenPtDst: ptDst,
|
|
537
554
|
tokenSyDst: syDst,
|
|
538
555
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
539
556
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
540
557
|
addressLookupTable: this.addressLookupTable,
|
|
541
|
-
syProgram: this.syProgram,
|
|
542
558
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
559
|
+
syProgram: this.syProgram,
|
|
560
|
+
systemProgram: SystemProgram.programId,
|
|
543
561
|
eventAuthority: this.eventAuthority,
|
|
544
|
-
program:
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
562
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
liquidityToRemove: lpIn,
|
|
566
|
+
minPtOut,
|
|
567
|
+
minSyOut,
|
|
568
|
+
},
|
|
569
|
+
)
|
|
570
|
+
ix.keys.push(...remainingAccounts)
|
|
551
571
|
|
|
552
|
-
return { ixs: [
|
|
572
|
+
return { ixs: [ix], setupIxs: [ptDstAtaIx, syDstAtaIx] }
|
|
553
573
|
}
|
|
554
574
|
|
|
555
|
-
|
|
575
|
+
/**
|
|
576
|
+
* Swap PT <-> SY on the CLMM.
|
|
577
|
+
*
|
|
578
|
+
* Low-level instruction — prefer {@link ixBuyPt} / {@link ixSellPt} for directional trades.
|
|
579
|
+
*
|
|
580
|
+
* @param trader - Wallet signing the transaction
|
|
581
|
+
* @param traderAmount - Amount of the input token
|
|
582
|
+
* @param outConstraint - Minimum output amount (slippage protection)
|
|
583
|
+
* @param swapDirection - `SwapDirection.SyToPt` or `SwapDirection.PtToSy`
|
|
584
|
+
* @param lnImpliedApyLimit - Optional price limit (ln implied APY)
|
|
585
|
+
*/
|
|
586
|
+
ixTradePt({
|
|
556
587
|
trader,
|
|
557
588
|
traderAmount,
|
|
558
589
|
outConstraint,
|
|
@@ -561,12 +592,12 @@ export class MarketThree {
|
|
|
561
592
|
tokenSy: tokenSyParam,
|
|
562
593
|
lnImpliedApyLimit,
|
|
563
594
|
}: {
|
|
564
|
-
trader:
|
|
595
|
+
trader: PublicKey
|
|
565
596
|
traderAmount: bigint
|
|
566
597
|
outConstraint: bigint
|
|
567
598
|
swapDirection: SwapDirection
|
|
568
|
-
tokenPt?:
|
|
569
|
-
tokenSy?:
|
|
599
|
+
tokenPt?: PublicKey
|
|
600
|
+
tokenSy?: PublicKey
|
|
570
601
|
lnImpliedApyLimit?: number
|
|
571
602
|
}) {
|
|
572
603
|
const tokenPt = tokenPtParam || getAssociatedTokenAddressSync(this.mintPt, trader, true, TOKEN_PROGRAM_ID)
|
|
@@ -582,34 +613,48 @@ export class MarketThree {
|
|
|
582
613
|
...this.cpiSyAccounts.withdrawSy,
|
|
583
614
|
])
|
|
584
615
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
const ix = await this.clmmProgram.methods
|
|
589
|
-
.tradePt(new BN(traderAmount.toString()), swapDirection, outConstraintOptional, lnImpliedApyLimitOptional)
|
|
590
|
-
.accountsStrict({
|
|
616
|
+
const ix = exponentClmm.createTradePtInstruction(
|
|
617
|
+
{
|
|
591
618
|
trader,
|
|
592
619
|
market: this.selfAddress,
|
|
593
|
-
|
|
620
|
+
ticks: this.ticksKey,
|
|
594
621
|
tokenSyTrader: tokenSy,
|
|
622
|
+
tokenPtTrader: tokenPt,
|
|
595
623
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
596
624
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
597
625
|
addressLookupTable: this.addressLookupTable,
|
|
598
626
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
599
627
|
syProgram: this.syProgram,
|
|
600
628
|
tokenFeeTreasurySy: this.tokenFeeTreasurySy,
|
|
601
|
-
eventAuthority: this.eventAuthority,
|
|
602
|
-
program: this.clmmProgram.programId,
|
|
603
629
|
tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
630
|
+
eventAuthority: this.eventAuthority,
|
|
631
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
amountIn: traderAmount,
|
|
635
|
+
swapDirection,
|
|
636
|
+
amountOutConstraint: outConstraint || null,
|
|
637
|
+
priceSpotLimit: lnImpliedApyLimit ?? null,
|
|
638
|
+
},
|
|
639
|
+
)
|
|
640
|
+
ix.keys.push(...remainingAccounts)
|
|
608
641
|
|
|
609
642
|
return { ixs: [ix], setupIxs: [tokenPtAtaIx, tokenSyAtaIx] }
|
|
610
643
|
}
|
|
611
644
|
|
|
612
|
-
|
|
645
|
+
/**
|
|
646
|
+
* Swap PT <-> SY specifying the exact output amount.
|
|
647
|
+
*
|
|
648
|
+
* Inverse of {@link ixTradePt} — the caller specifies how much they want to *receive*
|
|
649
|
+
* rather than how much they want to *spend*.
|
|
650
|
+
*
|
|
651
|
+
* @param trader - Wallet signing the transaction
|
|
652
|
+
* @param amountOut - Exact amount of the output token to receive
|
|
653
|
+
* @param swapDirection - `SwapDirection.SyToPt` or `SwapDirection.PtToSy`
|
|
654
|
+
* @param amountInConstraint - Maximum input amount (slippage protection)
|
|
655
|
+
* @param lnImpliedApyLimit - Optional price limit (ln implied APY)
|
|
656
|
+
*/
|
|
657
|
+
ixTradePtExactOut({
|
|
613
658
|
trader,
|
|
614
659
|
amountOut,
|
|
615
660
|
swapDirection,
|
|
@@ -618,12 +663,12 @@ export class MarketThree {
|
|
|
618
663
|
tokenSy: tokenSyParam,
|
|
619
664
|
lnImpliedApyLimit,
|
|
620
665
|
}: {
|
|
621
|
-
trader:
|
|
666
|
+
trader: PublicKey
|
|
622
667
|
amountOut: bigint
|
|
623
668
|
swapDirection: SwapDirection
|
|
624
669
|
amountInConstraint?: bigint
|
|
625
|
-
tokenPt?:
|
|
626
|
-
tokenSy?:
|
|
670
|
+
tokenPt?: PublicKey
|
|
671
|
+
tokenSy?: PublicKey
|
|
627
672
|
lnImpliedApyLimit?: number
|
|
628
673
|
}) {
|
|
629
674
|
const tokenPt = tokenPtParam || getAssociatedTokenAddressSync(this.mintPt, trader, true, TOKEN_PROGRAM_ID)
|
|
@@ -639,34 +684,31 @@ export class MarketThree {
|
|
|
639
684
|
...this.cpiSyAccounts.withdrawSy,
|
|
640
685
|
])
|
|
641
686
|
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
const ix = await this.clmmProgram.methods
|
|
646
|
-
.tradePtExactOut(
|
|
647
|
-
new BN(amountOut.toString()),
|
|
648
|
-
swapDirection,
|
|
649
|
-
amountInConstraintOptional,
|
|
650
|
-
lnImpliedApyLimitOptional,
|
|
651
|
-
)
|
|
652
|
-
.accountsStrict({
|
|
687
|
+
const ix = exponentClmm.createTradePtExactOutInstruction(
|
|
688
|
+
{
|
|
653
689
|
trader,
|
|
654
690
|
market: this.selfAddress,
|
|
655
|
-
|
|
691
|
+
ticks: this.ticksKey,
|
|
656
692
|
tokenSyTrader: tokenSy,
|
|
693
|
+
tokenPtTrader: tokenPt,
|
|
657
694
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
658
695
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
659
696
|
addressLookupTable: this.addressLookupTable,
|
|
660
697
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
661
698
|
syProgram: this.syProgram,
|
|
662
699
|
tokenFeeTreasurySy: this.tokenFeeTreasurySy,
|
|
663
|
-
eventAuthority: this.eventAuthority,
|
|
664
|
-
program: this.clmmProgram.programId,
|
|
665
700
|
tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
701
|
+
eventAuthority: this.eventAuthority,
|
|
702
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
amountOut,
|
|
706
|
+
swapDirection,
|
|
707
|
+
amountInConstraint: amountInConstraint ?? null,
|
|
708
|
+
priceSpotLimit: lnImpliedApyLimit ?? null,
|
|
709
|
+
},
|
|
710
|
+
)
|
|
711
|
+
ix.keys.push(...remainingAccounts)
|
|
670
712
|
|
|
671
713
|
return { ixs: [ix], setupIxs: [tokenPtAtaIx, tokenSyAtaIx] }
|
|
672
714
|
}
|
|
@@ -679,7 +721,7 @@ export class MarketThree {
|
|
|
679
721
|
*
|
|
680
722
|
* The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
|
|
681
723
|
*/
|
|
682
|
-
|
|
724
|
+
ixBuyPt({
|
|
683
725
|
trader,
|
|
684
726
|
amountSy,
|
|
685
727
|
outConstraint,
|
|
@@ -687,18 +729,18 @@ export class MarketThree {
|
|
|
687
729
|
tokenSy,
|
|
688
730
|
lnImpliedApyLimit,
|
|
689
731
|
}: {
|
|
690
|
-
trader:
|
|
732
|
+
trader: PublicKey
|
|
691
733
|
amountSy: bigint
|
|
692
734
|
outConstraint: bigint
|
|
693
|
-
tokenPt?:
|
|
694
|
-
tokenSy?:
|
|
735
|
+
tokenPt?: PublicKey
|
|
736
|
+
tokenSy?: PublicKey
|
|
695
737
|
lnImpliedApyLimit?: number
|
|
696
738
|
}) {
|
|
697
739
|
return this.ixTradePt({
|
|
698
740
|
trader,
|
|
699
741
|
traderAmount: amountSy,
|
|
700
742
|
outConstraint: outConstraint,
|
|
701
|
-
swapDirection:
|
|
743
|
+
swapDirection: SwapDirection.SyToPt,
|
|
702
744
|
tokenPt,
|
|
703
745
|
tokenSy,
|
|
704
746
|
lnImpliedApyLimit,
|
|
@@ -713,7 +755,7 @@ export class MarketThree {
|
|
|
713
755
|
*
|
|
714
756
|
* The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
|
|
715
757
|
*/
|
|
716
|
-
|
|
758
|
+
ixSellPt({
|
|
717
759
|
trader,
|
|
718
760
|
amountPt,
|
|
719
761
|
outConstraint,
|
|
@@ -721,18 +763,18 @@ export class MarketThree {
|
|
|
721
763
|
tokenSy,
|
|
722
764
|
lnImpliedApyLimit,
|
|
723
765
|
}: {
|
|
724
|
-
trader:
|
|
766
|
+
trader: PublicKey
|
|
725
767
|
amountPt: bigint
|
|
726
768
|
outConstraint: bigint
|
|
727
|
-
tokenPt?:
|
|
728
|
-
tokenSy?:
|
|
769
|
+
tokenPt?: PublicKey
|
|
770
|
+
tokenSy?: PublicKey
|
|
729
771
|
lnImpliedApyLimit?: number
|
|
730
772
|
}) {
|
|
731
773
|
return this.ixTradePt({
|
|
732
774
|
trader,
|
|
733
775
|
traderAmount: amountPt,
|
|
734
776
|
outConstraint: outConstraint,
|
|
735
|
-
swapDirection:
|
|
777
|
+
swapDirection: SwapDirection.PtToSy,
|
|
736
778
|
tokenPt,
|
|
737
779
|
tokenSy,
|
|
738
780
|
lnImpliedApyLimit,
|
|
@@ -745,7 +787,7 @@ export class MarketThree {
|
|
|
745
787
|
* The trader specifies the exact amount of PT they want to receive
|
|
746
788
|
* The maxSyIn is the maximum amount of SY the trader is willing to spend
|
|
747
789
|
*/
|
|
748
|
-
|
|
790
|
+
ixBuyPtExactOut({
|
|
749
791
|
trader,
|
|
750
792
|
amountPt,
|
|
751
793
|
maxSyIn,
|
|
@@ -753,18 +795,18 @@ export class MarketThree {
|
|
|
753
795
|
tokenSy,
|
|
754
796
|
lnImpliedApyLimit,
|
|
755
797
|
}: {
|
|
756
|
-
trader:
|
|
798
|
+
trader: PublicKey
|
|
757
799
|
amountPt: bigint
|
|
758
800
|
maxSyIn?: bigint
|
|
759
|
-
tokenPt?:
|
|
760
|
-
tokenSy?:
|
|
801
|
+
tokenPt?: PublicKey
|
|
802
|
+
tokenSy?: PublicKey
|
|
761
803
|
lnImpliedApyLimit?: number
|
|
762
804
|
}) {
|
|
763
805
|
return this.ixTradePtExactOut({
|
|
764
806
|
trader,
|
|
765
807
|
amountOut: amountPt,
|
|
766
808
|
amountInConstraint: maxSyIn,
|
|
767
|
-
swapDirection:
|
|
809
|
+
swapDirection: SwapDirection.SyToPt,
|
|
768
810
|
tokenPt,
|
|
769
811
|
tokenSy,
|
|
770
812
|
lnImpliedApyLimit,
|
|
@@ -777,7 +819,7 @@ export class MarketThree {
|
|
|
777
819
|
* The trader specifies the exact amount of SY they want to receive
|
|
778
820
|
* The maxPtIn is the maximum amount of PT the trader is willing to spend
|
|
779
821
|
*/
|
|
780
|
-
|
|
822
|
+
ixSellPtExactOut({
|
|
781
823
|
trader,
|
|
782
824
|
amountSy,
|
|
783
825
|
maxPtIn,
|
|
@@ -785,18 +827,18 @@ export class MarketThree {
|
|
|
785
827
|
tokenSy,
|
|
786
828
|
lnImpliedApyLimit,
|
|
787
829
|
}: {
|
|
788
|
-
trader:
|
|
830
|
+
trader: PublicKey
|
|
789
831
|
amountSy: bigint
|
|
790
832
|
maxPtIn?: bigint
|
|
791
|
-
tokenPt?:
|
|
792
|
-
tokenSy?:
|
|
833
|
+
tokenPt?: PublicKey
|
|
834
|
+
tokenSy?: PublicKey
|
|
793
835
|
lnImpliedApyLimit?: number
|
|
794
836
|
}) {
|
|
795
837
|
return this.ixTradePtExactOut({
|
|
796
838
|
trader,
|
|
797
839
|
amountOut: amountSy,
|
|
798
840
|
amountInConstraint: maxPtIn,
|
|
799
|
-
swapDirection:
|
|
841
|
+
swapDirection: SwapDirection.PtToSy,
|
|
800
842
|
tokenPt,
|
|
801
843
|
tokenSy,
|
|
802
844
|
lnImpliedApyLimit,
|
|
@@ -813,7 +855,7 @@ export class MarketThree {
|
|
|
813
855
|
*
|
|
814
856
|
* The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
|
|
815
857
|
*/
|
|
816
|
-
|
|
858
|
+
ixBuyYt({
|
|
817
859
|
trader,
|
|
818
860
|
ytOut,
|
|
819
861
|
maxSyIn,
|
|
@@ -822,12 +864,12 @@ export class MarketThree {
|
|
|
822
864
|
syTrader: syTraderParam,
|
|
823
865
|
lnImpliedApyLimit,
|
|
824
866
|
}: {
|
|
825
|
-
trader:
|
|
867
|
+
trader: PublicKey
|
|
826
868
|
ytOut: bigint
|
|
827
869
|
maxSyIn: bigint
|
|
828
|
-
ytTrader?:
|
|
829
|
-
ptTrader?:
|
|
830
|
-
syTrader?:
|
|
870
|
+
ytTrader?: PublicKey
|
|
871
|
+
ptTrader?: PublicKey
|
|
872
|
+
syTrader?: PublicKey
|
|
831
873
|
lnImpliedApyLimit?: number
|
|
832
874
|
}) {
|
|
833
875
|
const syTrader = syTraderParam || getAssociatedTokenAddressSync(this.mintSy, trader, true, TOKEN_PROGRAM_ID)
|
|
@@ -847,30 +889,33 @@ export class MarketThree {
|
|
|
847
889
|
...stripAccounts,
|
|
848
890
|
])
|
|
849
891
|
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
.buyYt(new BN(maxSyIn.toString()), new BN(ytOut.toString()), lnImpliedApyLimitOptional)
|
|
853
|
-
.accountsStrict({
|
|
892
|
+
const ix = exponentClmm.createBuyYtInstruction(
|
|
893
|
+
{
|
|
854
894
|
trader,
|
|
855
895
|
market: this.selfAddress,
|
|
896
|
+
ticks: this.ticksKey,
|
|
897
|
+
tokenSyTrader: syTrader,
|
|
856
898
|
tokenYtTrader: ytTrader,
|
|
857
899
|
tokenPtTrader: ptTrader,
|
|
858
|
-
tokenSyTrader: syTrader,
|
|
859
900
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
860
901
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
861
|
-
|
|
902
|
+
tokenYtEscrow: this.tokenYtEscrow,
|
|
903
|
+
tokenFeeTreasurySy: this.tokenFeeTreasurySy,
|
|
904
|
+
tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
|
|
862
905
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
906
|
+
addressLookupTable: this.addressLookupTable,
|
|
863
907
|
syProgram: this.syProgram,
|
|
864
|
-
|
|
908
|
+
exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
865
909
|
eventAuthority: this.eventAuthority,
|
|
866
|
-
program:
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
910
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
syIn: maxSyIn,
|
|
914
|
+
minYtOut: ytOut,
|
|
915
|
+
priceSpotLimit: lnImpliedApyLimit ?? null,
|
|
916
|
+
},
|
|
917
|
+
)
|
|
918
|
+
ix.keys.push(...remainingAccounts)
|
|
874
919
|
|
|
875
920
|
return { ixs: [ix], setupIxs: [syTraderAtaIx, ptTraderAtaIx, ytTraderAtaIx] }
|
|
876
921
|
}
|
|
@@ -885,7 +930,7 @@ export class MarketThree {
|
|
|
885
930
|
*
|
|
886
931
|
* The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
|
|
887
932
|
*/
|
|
888
|
-
|
|
933
|
+
ixSellYt({
|
|
889
934
|
trader,
|
|
890
935
|
ytIn,
|
|
891
936
|
minSyOut,
|
|
@@ -894,12 +939,12 @@ export class MarketThree {
|
|
|
894
939
|
syDst: syDstParam,
|
|
895
940
|
lnImpliedApyLimit,
|
|
896
941
|
}: {
|
|
897
|
-
trader:
|
|
942
|
+
trader: PublicKey
|
|
898
943
|
ytIn: bigint
|
|
899
944
|
minSyOut: bigint
|
|
900
|
-
ytSrc?:
|
|
901
|
-
ptSrc?:
|
|
902
|
-
syDst?:
|
|
945
|
+
ytSrc?: PublicKey
|
|
946
|
+
ptSrc?: PublicKey
|
|
947
|
+
syDst?: PublicKey
|
|
903
948
|
lnImpliedApyLimit?: number
|
|
904
949
|
}) {
|
|
905
950
|
const syDst = syDstParam || getAssociatedTokenAddressSync(this.mintSy, trader, true, TOKEN_PROGRAM_ID)
|
|
@@ -918,43 +963,47 @@ export class MarketThree {
|
|
|
918
963
|
...mergeAccounts,
|
|
919
964
|
])
|
|
920
965
|
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
.sellYt(new BN(ytIn.toString()), new BN(minSyOut.toString()), lnImpliedApyLimitOptional)
|
|
924
|
-
.accountsStrict({
|
|
966
|
+
const ix = exponentClmm.createSellYtInstruction(
|
|
967
|
+
{
|
|
925
968
|
trader,
|
|
926
969
|
market: this.selfAddress,
|
|
970
|
+
ticks: this.ticksKey,
|
|
927
971
|
tokenYtTrader: ytSrc,
|
|
928
972
|
tokenPtTrader: ptSrc,
|
|
929
973
|
tokenSyTrader: syDst,
|
|
930
974
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
931
975
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
976
|
+
tokenYtEscrow: this.tokenYtEscrow,
|
|
932
977
|
addressLookupTable: this.addressLookupTable,
|
|
978
|
+
tokenFeeTreasurySy: this.tokenFeeTreasurySy,
|
|
979
|
+
tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
|
|
933
980
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
934
981
|
syProgram: this.syProgram,
|
|
935
|
-
|
|
982
|
+
exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
936
983
|
eventAuthority: this.eventAuthority,
|
|
937
|
-
program:
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
984
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
ytIn,
|
|
988
|
+
minSyOut,
|
|
989
|
+
priceSpotLimit: lnImpliedApyLimit ?? null,
|
|
990
|
+
},
|
|
991
|
+
)
|
|
992
|
+
ix.keys.push(...remainingAccounts)
|
|
945
993
|
|
|
946
994
|
return { ixs: [ix], setupIxs: [syDstAtaIxs, ptSrcAtaIxs, ytSrcAtaIxs] }
|
|
947
995
|
}
|
|
948
996
|
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
997
|
+
/** Apply an admin action to the market (e.g. change status, fees, tick spacing). */
|
|
998
|
+
ixModifyMarketSetting({ signer, adminAction }: { signer: PublicKey; adminAction: MarketAdminAction }) {
|
|
999
|
+
return exponentClmm.createModifyMarketSettingInstruction(
|
|
1000
|
+
{
|
|
953
1001
|
market: this.selfAddress,
|
|
954
1002
|
signer,
|
|
955
|
-
systemProgram:
|
|
956
|
-
}
|
|
957
|
-
|
|
1003
|
+
systemProgram: SystemProgram.programId,
|
|
1004
|
+
},
|
|
1005
|
+
{ action: adminAction },
|
|
1006
|
+
)
|
|
958
1007
|
}
|
|
959
1008
|
|
|
960
1009
|
/**
|
|
@@ -968,7 +1017,7 @@ export class MarketThree {
|
|
|
968
1017
|
* @param farmTokenSrc - Optional source token account for the farm rewards (derived from signer if not provided)
|
|
969
1018
|
* @param feePayer - Optional fee payer for account reallocation (defaults to signer)
|
|
970
1019
|
*/
|
|
971
|
-
|
|
1020
|
+
ixAddFarm({
|
|
972
1021
|
signer,
|
|
973
1022
|
farmMint,
|
|
974
1023
|
farmTokenProgram,
|
|
@@ -977,13 +1026,13 @@ export class MarketThree {
|
|
|
977
1026
|
farmTokenSrc: farmTokenSrcParam,
|
|
978
1027
|
feePayer: feePayerParam,
|
|
979
1028
|
}: {
|
|
980
|
-
signer:
|
|
981
|
-
farmMint:
|
|
982
|
-
farmTokenProgram:
|
|
1029
|
+
signer: PublicKey
|
|
1030
|
+
farmMint: PublicKey
|
|
1031
|
+
farmTokenProgram: PublicKey
|
|
983
1032
|
emissionsRate: bigint
|
|
984
1033
|
untilTimestamp: number
|
|
985
|
-
farmTokenSrc?:
|
|
986
|
-
feePayer?:
|
|
1034
|
+
farmTokenSrc?: PublicKey
|
|
1035
|
+
feePayer?: PublicKey
|
|
987
1036
|
}) {
|
|
988
1037
|
const feePayer = feePayerParam || signer
|
|
989
1038
|
const farmTokenEscrow = getAssociatedTokenAddressSync(farmMint, this.selfAddress, true, farmTokenProgram)
|
|
@@ -997,9 +1046,8 @@ export class MarketThree {
|
|
|
997
1046
|
farmTokenProgram,
|
|
998
1047
|
)
|
|
999
1048
|
|
|
1000
|
-
const ix =
|
|
1001
|
-
|
|
1002
|
-
.accountsStrict({
|
|
1049
|
+
const ix = exponentClmm.createAddFarmInstruction(
|
|
1050
|
+
{
|
|
1003
1051
|
market: this.selfAddress,
|
|
1004
1052
|
ticks: this.ticksKey,
|
|
1005
1053
|
signer,
|
|
@@ -1008,11 +1056,15 @@ export class MarketThree {
|
|
|
1008
1056
|
tokenSource: farmTokenSrc,
|
|
1009
1057
|
tokenFarm: farmTokenEscrow,
|
|
1010
1058
|
tokenProgram: farmTokenProgram,
|
|
1011
|
-
systemProgram:
|
|
1059
|
+
systemProgram: SystemProgram.programId,
|
|
1012
1060
|
eventAuthority: this.eventAuthority,
|
|
1013
|
-
program:
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1061
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
tokenRate: emissionsRate,
|
|
1065
|
+
untilTimestamp,
|
|
1066
|
+
},
|
|
1067
|
+
)
|
|
1016
1068
|
|
|
1017
1069
|
return {
|
|
1018
1070
|
ixs: [ix],
|
|
@@ -1034,7 +1086,7 @@ export class MarketThree {
|
|
|
1034
1086
|
* @param untilTimestamp - New unix timestamp when the farm emissions should end
|
|
1035
1087
|
* @param farmTokenSrc - Optional source/destination token account (derived from signer if not provided)
|
|
1036
1088
|
*/
|
|
1037
|
-
|
|
1089
|
+
ixModifyFarm({
|
|
1038
1090
|
signer,
|
|
1039
1091
|
farmMint,
|
|
1040
1092
|
farmTokenProgram,
|
|
@@ -1042,19 +1094,18 @@ export class MarketThree {
|
|
|
1042
1094
|
untilTimestamp,
|
|
1043
1095
|
farmTokenSrc: farmTokenSrcParam,
|
|
1044
1096
|
}: {
|
|
1045
|
-
signer:
|
|
1046
|
-
farmMint:
|
|
1047
|
-
farmTokenProgram:
|
|
1097
|
+
signer: PublicKey
|
|
1098
|
+
farmMint: PublicKey
|
|
1099
|
+
farmTokenProgram: PublicKey
|
|
1048
1100
|
newRate: bigint
|
|
1049
1101
|
untilTimestamp: number
|
|
1050
|
-
farmTokenSrc?:
|
|
1102
|
+
farmTokenSrc?: PublicKey
|
|
1051
1103
|
}) {
|
|
1052
1104
|
const farmTokenEscrow = getAssociatedTokenAddressSync(farmMint, this.selfAddress, true, farmTokenProgram)
|
|
1053
1105
|
const farmTokenSrc = farmTokenSrcParam || getAssociatedTokenAddressSync(farmMint, signer, true, farmTokenProgram)
|
|
1054
1106
|
|
|
1055
|
-
const ix =
|
|
1056
|
-
|
|
1057
|
-
.accountsStrict({
|
|
1107
|
+
const ix = exponentClmm.createModifyFarmInstruction(
|
|
1108
|
+
{
|
|
1058
1109
|
market: this.selfAddress,
|
|
1059
1110
|
ticks: this.ticksKey,
|
|
1060
1111
|
signer,
|
|
@@ -1063,15 +1114,30 @@ export class MarketThree {
|
|
|
1063
1114
|
tokenFarm: farmTokenEscrow,
|
|
1064
1115
|
tokenProgram: farmTokenProgram,
|
|
1065
1116
|
eventAuthority: this.eventAuthority,
|
|
1066
|
-
program:
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1117
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
newExpirationTimestamp: untilTimestamp,
|
|
1121
|
+
newRate,
|
|
1122
|
+
},
|
|
1123
|
+
)
|
|
1069
1124
|
|
|
1070
1125
|
return {
|
|
1071
1126
|
ixs: [ix],
|
|
1072
1127
|
}
|
|
1073
1128
|
}
|
|
1074
1129
|
|
|
1130
|
+
/**
|
|
1131
|
+
* Buy PT directly from the base asset (e.g. SOL, USDC).
|
|
1132
|
+
*
|
|
1133
|
+
* Wraps a mint-SY step (via the flavor) with a buy-PT swap in a single instruction.
|
|
1134
|
+
* The program mints SY from the base asset, then swaps SY -> PT on the CLMM.
|
|
1135
|
+
*
|
|
1136
|
+
* @param owner - Wallet signing the transaction
|
|
1137
|
+
* @param baseIn - Amount of base asset to spend
|
|
1138
|
+
* @param minPtOut - Minimum PT to receive (slippage protection)
|
|
1139
|
+
* @param lnImpliedApyLimit - Optional price limit (ln implied APY)
|
|
1140
|
+
*/
|
|
1075
1141
|
async ixWrapperBuyPt({
|
|
1076
1142
|
owner,
|
|
1077
1143
|
minPtOut,
|
|
@@ -1081,12 +1147,12 @@ export class MarketThree {
|
|
|
1081
1147
|
tokenBaseTrader: tokenBaseTraderParam,
|
|
1082
1148
|
lnImpliedApyLimit,
|
|
1083
1149
|
}: {
|
|
1084
|
-
owner:
|
|
1150
|
+
owner: PublicKey
|
|
1085
1151
|
minPtOut: bigint
|
|
1086
1152
|
baseIn: bigint
|
|
1087
|
-
tokenSyTrader?:
|
|
1088
|
-
tokenPtTrader?:
|
|
1089
|
-
tokenBaseTrader?:
|
|
1153
|
+
tokenSyTrader?: PublicKey
|
|
1154
|
+
tokenPtTrader?: PublicKey
|
|
1155
|
+
tokenBaseTrader?: PublicKey
|
|
1090
1156
|
lnImpliedApyLimit?: number
|
|
1091
1157
|
}) {
|
|
1092
1158
|
const tokenSyTrader =
|
|
@@ -1131,33 +1197,31 @@ export class MarketThree {
|
|
|
1131
1197
|
...this.cpiSyAccounts.getPositionState,
|
|
1132
1198
|
])
|
|
1133
1199
|
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
const ix = await this.clmmProgram.methods
|
|
1137
|
-
.buyPt(
|
|
1138
|
-
new BN(minPtOut.toString()),
|
|
1139
|
-
new BN(baseIn.toString()),
|
|
1140
|
-
lnImpliedApyLimitOptional,
|
|
1141
|
-
mintSyRemAccounts.length,
|
|
1142
|
-
)
|
|
1143
|
-
.accountsStrict({
|
|
1144
|
-
addressLookupTable: this.addressLookupTable,
|
|
1200
|
+
const ix = exponentClmm.createBuyPtInstruction(
|
|
1201
|
+
{
|
|
1145
1202
|
buyer: owner,
|
|
1146
1203
|
market: this.selfAddress,
|
|
1147
1204
|
tokenSyTrader,
|
|
1148
1205
|
tokenPtTrader,
|
|
1149
1206
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1150
1207
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1208
|
+
addressLookupTable: this.addressLookupTable,
|
|
1151
1209
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1152
1210
|
syProgram: this.syProgram,
|
|
1211
|
+
ticks: this.ticksKey,
|
|
1153
1212
|
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1154
|
-
eventAuthority: this.eventAuthority,
|
|
1155
|
-
program: this.clmmProgram.programId,
|
|
1156
1213
|
tokenFeeTreasuryPt: this.state.tokenFeeTreasuryPt,
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1214
|
+
eventAuthority: this.eventAuthority,
|
|
1215
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
minPtAmount: minPtOut,
|
|
1219
|
+
baseAmount: baseIn,
|
|
1220
|
+
priceSpotLimit: lnImpliedApyLimit ?? null,
|
|
1221
|
+
mintSyRemAccountsUntil: mintSyRemAccounts.length,
|
|
1222
|
+
},
|
|
1223
|
+
)
|
|
1224
|
+
ix.keys.push(...mintSyRemAccounts, ...remainingAccounts)
|
|
1161
1225
|
|
|
1162
1226
|
return {
|
|
1163
1227
|
ixs: [...(await this.flavor.preIxs({ signer: owner })), ix, ...(await this.flavor.postIxs({ signer: owner }))],
|
|
@@ -1165,6 +1229,17 @@ export class MarketThree {
|
|
|
1165
1229
|
}
|
|
1166
1230
|
}
|
|
1167
1231
|
|
|
1232
|
+
/**
|
|
1233
|
+
* Sell PT and receive the base asset (e.g. SOL, USDC).
|
|
1234
|
+
*
|
|
1235
|
+
* Wraps a PT -> SY swap with a redeem-SY step (via the flavor) in a single instruction.
|
|
1236
|
+
* The program swaps PT -> SY on the CLMM, then redeems SY for the base asset.
|
|
1237
|
+
*
|
|
1238
|
+
* @param owner - Wallet signing the transaction
|
|
1239
|
+
* @param amount - Amount of PT to sell
|
|
1240
|
+
* @param minBaseOut - Minimum base asset to receive (slippage protection)
|
|
1241
|
+
* @param lnImpliedApyLimit - Optional price limit (ln implied APY)
|
|
1242
|
+
*/
|
|
1168
1243
|
async ixWrapperSellPt({
|
|
1169
1244
|
owner,
|
|
1170
1245
|
amount,
|
|
@@ -1174,12 +1249,12 @@ export class MarketThree {
|
|
|
1174
1249
|
tokenBaseTrader: tokenBaseTraderParam,
|
|
1175
1250
|
lnImpliedApyLimit,
|
|
1176
1251
|
}: {
|
|
1177
|
-
owner:
|
|
1252
|
+
owner: PublicKey
|
|
1178
1253
|
amount: bigint
|
|
1179
1254
|
minBaseOut: bigint
|
|
1180
|
-
tokenSyTrader?:
|
|
1181
|
-
tokenPtTrader?:
|
|
1182
|
-
tokenBaseTrader?:
|
|
1255
|
+
tokenSyTrader?: PublicKey
|
|
1256
|
+
tokenPtTrader?: PublicKey
|
|
1257
|
+
tokenBaseTrader?: PublicKey
|
|
1183
1258
|
lnImpliedApyLimit?: number
|
|
1184
1259
|
}) {
|
|
1185
1260
|
const tokenSyTrader =
|
|
@@ -1224,33 +1299,31 @@ export class MarketThree {
|
|
|
1224
1299
|
...this.cpiSyAccounts.withdrawSy,
|
|
1225
1300
|
])
|
|
1226
1301
|
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
const ix = await this.clmmProgram.methods
|
|
1230
|
-
.sellPt(
|
|
1231
|
-
new BN(amount.toString()),
|
|
1232
|
-
new BN(minBaseOut.toString()),
|
|
1233
|
-
lnImpliedApyLimitOptional,
|
|
1234
|
-
redeemSyRemAccounts.length,
|
|
1235
|
-
)
|
|
1236
|
-
.accountsStrict({
|
|
1302
|
+
const ix = exponentClmm.createSellPtInstruction(
|
|
1303
|
+
{
|
|
1237
1304
|
seller: owner,
|
|
1238
1305
|
market: this.selfAddress,
|
|
1306
|
+
tokenSyTrader,
|
|
1239
1307
|
tokenPtTrader,
|
|
1308
|
+
tokenSyEscrow: this.tokenSyEscrow,
|
|
1309
|
+
tokenPtEscrow: this.tokenPtEscrow,
|
|
1240
1310
|
addressLookupTable: this.addressLookupTable,
|
|
1241
1311
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1242
1312
|
syProgram: this.syProgram,
|
|
1243
|
-
tokenSyTrader,
|
|
1244
|
-
tokenPtEscrow: this.tokenPtEscrow,
|
|
1245
|
-
tokenSyEscrow: this.tokenSyEscrow,
|
|
1246
1313
|
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1247
|
-
eventAuthority: this.eventAuthority,
|
|
1248
|
-
program: this.clmmProgram.programId,
|
|
1249
|
-
ticks: this.ticksKey,
|
|
1250
1314
|
tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1315
|
+
ticks: this.ticksKey,
|
|
1316
|
+
eventAuthority: this.eventAuthority,
|
|
1317
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
amountPt: amount,
|
|
1321
|
+
minBaseAmount: minBaseOut,
|
|
1322
|
+
priceSpotLimit: lnImpliedApyLimit ?? null,
|
|
1323
|
+
redeemSyRemAccountsUntil: redeemSyRemAccounts.length,
|
|
1324
|
+
},
|
|
1325
|
+
)
|
|
1326
|
+
ix.keys.push(...redeemSyRemAccounts, ...remainingAccounts)
|
|
1254
1327
|
|
|
1255
1328
|
return {
|
|
1256
1329
|
ixs: [...(await this.flavor.preIxs({ signer: owner })), ix, ...(await this.flavor.postIxs({ signer: owner }))],
|
|
@@ -1258,6 +1331,16 @@ export class MarketThree {
|
|
|
1258
1331
|
}
|
|
1259
1332
|
}
|
|
1260
1333
|
|
|
1334
|
+
/**
|
|
1335
|
+
* Buy YT directly from the base asset.
|
|
1336
|
+
*
|
|
1337
|
+
* Wraps a mint-SY step with a buy-YT swap. The program mints SY from the base asset,
|
|
1338
|
+
* then strips SY into PT+YT and executes the trade.
|
|
1339
|
+
*
|
|
1340
|
+
* @param owner - Wallet signing the transaction
|
|
1341
|
+
* @param ytOut - Amount of YT to buy
|
|
1342
|
+
* @param maxBaseIn - Maximum base asset to spend (slippage protection)
|
|
1343
|
+
*/
|
|
1261
1344
|
async ixWrapperBuyYt({
|
|
1262
1345
|
owner,
|
|
1263
1346
|
ytOut,
|
|
@@ -1267,13 +1350,13 @@ export class MarketThree {
|
|
|
1267
1350
|
tokenYtTrader: tokenYtTraderParam,
|
|
1268
1351
|
tokenBaseTrader: tokenBaseTraderParam,
|
|
1269
1352
|
}: {
|
|
1270
|
-
owner:
|
|
1353
|
+
owner: PublicKey
|
|
1271
1354
|
ytOut: bigint
|
|
1272
1355
|
maxBaseIn: bigint
|
|
1273
|
-
tokenSyTrader?:
|
|
1274
|
-
tokenPtTrader?:
|
|
1275
|
-
tokenYtTrader?:
|
|
1276
|
-
tokenBaseTrader?:
|
|
1356
|
+
tokenSyTrader?: PublicKey
|
|
1357
|
+
tokenPtTrader?: PublicKey
|
|
1358
|
+
tokenYtTrader?: PublicKey
|
|
1359
|
+
tokenBaseTrader?: PublicKey
|
|
1277
1360
|
}) {
|
|
1278
1361
|
const tokenSyTrader =
|
|
1279
1362
|
tokenSyTraderParam || getAssociatedTokenAddressSync(this.mintSy, owner, true, TOKEN_PROGRAM_ID)
|
|
@@ -1311,7 +1394,7 @@ export class MarketThree {
|
|
|
1311
1394
|
depositorSyTokenAccount: tokenSyTrader,
|
|
1312
1395
|
})
|
|
1313
1396
|
|
|
1314
|
-
const depositYtAccounts =
|
|
1397
|
+
const depositYtAccounts = this.depositYtAccounts({
|
|
1315
1398
|
owner,
|
|
1316
1399
|
ytSrc: tokenYtTrader,
|
|
1317
1400
|
})
|
|
@@ -1329,14 +1412,8 @@ export class MarketThree {
|
|
|
1329
1412
|
const depositYtAccounts_until = mintSyRemAccounts.length + depositYtAccounts.keys.length
|
|
1330
1413
|
const allRemainingAccounts = mintSyRemAccounts.concat(depositYtAccounts.keys).concat(remainingAccounts)
|
|
1331
1414
|
|
|
1332
|
-
const ix1 =
|
|
1333
|
-
|
|
1334
|
-
new BN(ytOut.toString()),
|
|
1335
|
-
new BN(maxBaseIn.toString()),
|
|
1336
|
-
mintSyRemAccounts.length,
|
|
1337
|
-
depositYtAccounts_until,
|
|
1338
|
-
)
|
|
1339
|
-
.accountsStrict({
|
|
1415
|
+
const ix1 = exponentClmm.createWrapperBuyYtInstruction(
|
|
1416
|
+
{
|
|
1340
1417
|
buyer: owner,
|
|
1341
1418
|
market: this.selfAddress,
|
|
1342
1419
|
tokenSyTrader,
|
|
@@ -1344,20 +1421,26 @@ export class MarketThree {
|
|
|
1344
1421
|
tokenPtTrader,
|
|
1345
1422
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1346
1423
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1424
|
+
tokenYtEscrow: this.tokenYtEscrow,
|
|
1347
1425
|
marketAddressLookupTable: this.addressLookupTable,
|
|
1348
1426
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1349
1427
|
syProgram: this.syProgram,
|
|
1350
|
-
systemProgram:
|
|
1428
|
+
systemProgram: SystemProgram.programId,
|
|
1351
1429
|
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1352
|
-
eventAuthority: this.eventAuthority,
|
|
1353
|
-
program: this.clmmProgram.programId,
|
|
1354
|
-
tokenYtEscrow: this.tokenYtEscrow,
|
|
1355
1430
|
tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
|
|
1356
1431
|
ticks: this.ticksKey,
|
|
1357
|
-
exponentCoreProgram:
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1432
|
+
exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1433
|
+
eventAuthority: this.eventAuthority,
|
|
1434
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
ytOut,
|
|
1438
|
+
maxBaseAmount: maxBaseIn,
|
|
1439
|
+
mintSyAccountsLength: mintSyRemAccounts.length,
|
|
1440
|
+
depositYtAccountsUntil: depositYtAccounts_until,
|
|
1441
|
+
},
|
|
1442
|
+
)
|
|
1443
|
+
ix1.keys.push(...allRemainingAccounts)
|
|
1361
1444
|
|
|
1362
1445
|
return {
|
|
1363
1446
|
ixs: [...(await this.flavor.preIxs({ signer: owner })), ix1],
|
|
@@ -1365,6 +1448,16 @@ export class MarketThree {
|
|
|
1365
1448
|
}
|
|
1366
1449
|
}
|
|
1367
1450
|
|
|
1451
|
+
/**
|
|
1452
|
+
* Sell YT and receive the base asset.
|
|
1453
|
+
*
|
|
1454
|
+
* Wraps a YT -> SY swap with a redeem-SY step. The program merges YT+PT back into SY,
|
|
1455
|
+
* executes the trade, then redeems SY for the base asset.
|
|
1456
|
+
*
|
|
1457
|
+
* @param owner - Wallet signing the transaction
|
|
1458
|
+
* @param amount - Amount of YT to sell
|
|
1459
|
+
* @param minBaseOut - Minimum base asset to receive (slippage protection)
|
|
1460
|
+
*/
|
|
1368
1461
|
async ixWrapperSellYt({
|
|
1369
1462
|
owner,
|
|
1370
1463
|
amount,
|
|
@@ -1374,13 +1467,13 @@ export class MarketThree {
|
|
|
1374
1467
|
tokenYtTrader: tokenYtTraderParam,
|
|
1375
1468
|
tokenPtTrader: tokenPtTraderParam,
|
|
1376
1469
|
}: {
|
|
1377
|
-
owner:
|
|
1470
|
+
owner: PublicKey
|
|
1378
1471
|
amount: bigint
|
|
1379
1472
|
minBaseOut: bigint
|
|
1380
|
-
tokenBaseTrader?:
|
|
1381
|
-
tokenSyTrader?:
|
|
1382
|
-
tokenYtTrader?:
|
|
1383
|
-
tokenPtTrader?:
|
|
1473
|
+
tokenBaseTrader?: PublicKey
|
|
1474
|
+
tokenSyTrader?: PublicKey
|
|
1475
|
+
tokenYtTrader?: PublicKey
|
|
1476
|
+
tokenPtTrader?: PublicKey
|
|
1384
1477
|
}) {
|
|
1385
1478
|
const tokenBaseTrader =
|
|
1386
1479
|
tokenBaseTraderParam ||
|
|
@@ -1426,6 +1519,11 @@ export class MarketThree {
|
|
|
1426
1519
|
|
|
1427
1520
|
const redeemSyRemAccounts = redeemSyIx.keys
|
|
1428
1521
|
|
|
1522
|
+
const withdrawYtAccounts = this.withdrawYtAccounts({
|
|
1523
|
+
owner,
|
|
1524
|
+
ytDst: tokenYtTrader,
|
|
1525
|
+
})
|
|
1526
|
+
|
|
1429
1527
|
const remainingAccounts = uniqueRemainingAccounts([
|
|
1430
1528
|
...this.cpiSyAccounts.getSyState,
|
|
1431
1529
|
...this.cpiSyAccounts.getPositionState,
|
|
@@ -1434,29 +1532,36 @@ export class MarketThree {
|
|
|
1434
1532
|
...this.cpiSyAccounts.depositSy,
|
|
1435
1533
|
])
|
|
1436
1534
|
|
|
1437
|
-
const
|
|
1438
|
-
|
|
1439
|
-
|
|
1535
|
+
const withdrawYtAccountsUntil = redeemSyRemAccounts.length + withdrawYtAccounts.keys.length
|
|
1536
|
+
|
|
1537
|
+
const ix1 = exponentClmm.createWrapperSellYtInstruction(
|
|
1538
|
+
{
|
|
1440
1539
|
seller: owner,
|
|
1441
1540
|
market: this.selfAddress,
|
|
1541
|
+
tokenSyTrader,
|
|
1442
1542
|
tokenYtTrader,
|
|
1443
|
-
marketAddressLookupTable: this.addressLookupTable,
|
|
1444
1543
|
tokenPtTrader,
|
|
1544
|
+
tokenSyEscrow: this.tokenSyEscrow,
|
|
1545
|
+
tokenYtEscrow: this.tokenYtEscrow,
|
|
1445
1546
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1547
|
+
marketAddressLookupTable: this.addressLookupTable,
|
|
1446
1548
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1447
1549
|
syProgram: this.syProgram,
|
|
1448
|
-
tokenSyTrader,
|
|
1449
|
-
tokenSyEscrow: this.tokenSyEscrow,
|
|
1450
1550
|
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1451
|
-
eventAuthority: this.eventAuthority,
|
|
1452
|
-
program: this.clmmProgram.programId,
|
|
1453
|
-
tokenYtEscrow: this.tokenYtEscrow,
|
|
1454
1551
|
tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
|
|
1455
1552
|
ticks: this.ticksKey,
|
|
1456
|
-
exponentCoreProgram:
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1553
|
+
exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1554
|
+
eventAuthority: this.eventAuthority,
|
|
1555
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
ytAmount: amount,
|
|
1559
|
+
minBaseAmount: minBaseOut,
|
|
1560
|
+
redeemSyAccountsUntil: redeemSyRemAccounts.length,
|
|
1561
|
+
withdrawYtAccountsUntil,
|
|
1562
|
+
},
|
|
1563
|
+
)
|
|
1564
|
+
ix1.keys.push(...redeemSyRemAccounts, ...withdrawYtAccounts.keys, ...remainingAccounts)
|
|
1460
1565
|
|
|
1461
1566
|
return {
|
|
1462
1567
|
ixs: [ix1, ...(await this.flavor.preIxs({ signer: owner }))],
|
|
@@ -1464,7 +1569,20 @@ export class MarketThree {
|
|
|
1464
1569
|
}
|
|
1465
1570
|
}
|
|
1466
1571
|
|
|
1467
|
-
/**
|
|
1572
|
+
/**
|
|
1573
|
+
* Provide concentrated liquidity from the base asset, receiving LP and YT tokens.
|
|
1574
|
+
*
|
|
1575
|
+
* Wraps a mint-SY step with a deposit-liquidity operation. The program mints SY from the
|
|
1576
|
+
* base asset, strips some into PT, deposits PT+SY as liquidity in the specified tick range,
|
|
1577
|
+
* and returns the leftover YT to the depositor.
|
|
1578
|
+
*
|
|
1579
|
+
* @param depositor - Wallet signing the transaction
|
|
1580
|
+
* @param amountBase - Amount of base asset to deposit
|
|
1581
|
+
* @param minLpOut - Minimum LP tokens to receive (slippage protection)
|
|
1582
|
+
* @param lowerTickApy - Lower APY bound for the liquidity range
|
|
1583
|
+
* @param upperTickApy - Upper APY bound for the liquidity range
|
|
1584
|
+
* @param lpPosition - Optional existing LP position keypair/address (new one generated if omitted)
|
|
1585
|
+
*/
|
|
1468
1586
|
async ixWrapperProvideLiquidity({
|
|
1469
1587
|
depositor,
|
|
1470
1588
|
amountBase,
|
|
@@ -1477,16 +1595,16 @@ export class MarketThree {
|
|
|
1477
1595
|
tokenBaseDepositor: tokenBaseDepositorParam,
|
|
1478
1596
|
lpPosition: lpPositionParam,
|
|
1479
1597
|
}: {
|
|
1480
|
-
depositor:
|
|
1598
|
+
depositor: PublicKey
|
|
1481
1599
|
amountBase: bigint
|
|
1482
1600
|
minLpOut: bigint
|
|
1483
1601
|
lowerTickApy: number
|
|
1484
1602
|
upperTickApy: number
|
|
1485
|
-
tokenSyDepositor?:
|
|
1486
|
-
tokenYtDepositor?:
|
|
1487
|
-
tokenPtDepositor?:
|
|
1488
|
-
tokenBaseDepositor?:
|
|
1489
|
-
lpPosition?:
|
|
1603
|
+
tokenSyDepositor?: PublicKey
|
|
1604
|
+
tokenYtDepositor?: PublicKey
|
|
1605
|
+
tokenPtDepositor?: PublicKey
|
|
1606
|
+
tokenBaseDepositor?: PublicKey
|
|
1607
|
+
lpPosition?: Keypair | PublicKey
|
|
1490
1608
|
}) {
|
|
1491
1609
|
const tokenSyDepositor =
|
|
1492
1610
|
tokenSyDepositorParam || getAssociatedTokenAddressSync(this.mintSy, depositor, true, TOKEN_PROGRAM_ID)
|
|
@@ -1498,7 +1616,7 @@ export class MarketThree {
|
|
|
1498
1616
|
tokenBaseDepositorParam ||
|
|
1499
1617
|
getAssociatedTokenAddressSync(this.flavor.mintBase, depositor, true, this.flavor.baseTokenProgram)
|
|
1500
1618
|
|
|
1501
|
-
const lpPosition = lpPositionParam ||
|
|
1619
|
+
const lpPosition = lpPositionParam || Keypair.generate()
|
|
1502
1620
|
|
|
1503
1621
|
const tokenSyDepositorAtaIx = createAssociatedTokenAccountIdempotentInstruction(
|
|
1504
1622
|
depositor,
|
|
@@ -1519,9 +1637,6 @@ export class MarketThree {
|
|
|
1519
1637
|
this.mintPt,
|
|
1520
1638
|
)
|
|
1521
1639
|
|
|
1522
|
-
const amountBaseBn = new BN(amountBase.toString())
|
|
1523
|
-
const minLpOutBn = new BN(minLpOut.toString())
|
|
1524
|
-
|
|
1525
1640
|
const mintSyIx = await this.flavor.ixMintSy({
|
|
1526
1641
|
// argument does not matter - since we are just getting the keys
|
|
1527
1642
|
amountBase: "0",
|
|
@@ -1539,47 +1654,51 @@ export class MarketThree {
|
|
|
1539
1654
|
...this.cpiSyAccounts.depositSy,
|
|
1540
1655
|
])
|
|
1541
1656
|
|
|
1542
|
-
const depositYtAccounts =
|
|
1657
|
+
const depositYtAccounts = this.depositYtAccounts({
|
|
1543
1658
|
owner: depositor,
|
|
1544
1659
|
ytSrc: tokenYtDepositor,
|
|
1545
1660
|
})
|
|
1546
1661
|
const depositAccountsUntil = mintSyRemAccounts.length + depositYtAccounts.keys.length
|
|
1547
1662
|
const allRemainingAccounts = [...mintSyRemAccounts, ...depositYtAccounts.keys, ...unorderedRemainingAccounts]
|
|
1548
1663
|
|
|
1549
|
-
const ix =
|
|
1550
|
-
|
|
1551
|
-
convertApyToApyBp(lowerTickApy),
|
|
1552
|
-
convertApyToApyBp(upperTickApy),
|
|
1553
|
-
amountBaseBn,
|
|
1554
|
-
minLpOutBn,
|
|
1555
|
-
mintSyRemAccounts.length,
|
|
1556
|
-
depositAccountsUntil,
|
|
1557
|
-
)
|
|
1558
|
-
.accountsStrict({
|
|
1664
|
+
const ix = exponentClmm.createWrapperProvideLiquidityInstruction(
|
|
1665
|
+
{
|
|
1559
1666
|
depositor,
|
|
1560
1667
|
market: this.selfAddress,
|
|
1668
|
+
ticks: this.ticksKey,
|
|
1561
1669
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1670
|
+
tokenYtEscrow: this.tokenYtEscrow,
|
|
1562
1671
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1563
1672
|
tokenSyDepositor,
|
|
1564
1673
|
tokenYtDepositor,
|
|
1565
1674
|
tokenPtDepositor,
|
|
1566
1675
|
mintYt: this.vault.mintYt,
|
|
1567
1676
|
mintPt: this.vault.mintPt,
|
|
1568
|
-
systemProgram: web3.SystemProgram.programId,
|
|
1569
1677
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1570
|
-
syProgram: this.syProgram,
|
|
1571
1678
|
marketAddressLookupTable: this.addressLookupTable,
|
|
1679
|
+
syProgram: this.syProgram,
|
|
1680
|
+
exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1681
|
+
lpPosition: lpPosition instanceof Keypair ? lpPosition.publicKey : lpPosition,
|
|
1682
|
+
instructionsSysvar: SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
1683
|
+
systemProgram: SystemProgram.programId,
|
|
1684
|
+
rent: SYSVAR_RENT_PUBKEY,
|
|
1572
1685
|
eventAuthority: this.eventAuthority,
|
|
1573
|
-
program:
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1686
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
lowerTick: convertApyToApyBp(lowerTickApy),
|
|
1690
|
+
upperTick: convertApyToApyBp(upperTickApy),
|
|
1691
|
+
amountBase,
|
|
1692
|
+
minLpOut,
|
|
1693
|
+
mintSyRemAccountsUntil: mintSyRemAccounts.length,
|
|
1694
|
+
depositYtAccountsUntil: depositAccountsUntil,
|
|
1695
|
+
},
|
|
1696
|
+
)
|
|
1697
|
+
ix.keys.push(...allRemainingAccounts)
|
|
1581
1698
|
|
|
1582
|
-
|
|
1699
|
+
if (lpPosition instanceof Keypair) {
|
|
1700
|
+
ix.keys.find((k) => k.pubkey.equals(lpPosition.publicKey))!.isSigner = true
|
|
1701
|
+
}
|
|
1583
1702
|
|
|
1584
1703
|
return {
|
|
1585
1704
|
ixs: [
|
|
@@ -1587,11 +1706,25 @@ export class MarketThree {
|
|
|
1587
1706
|
ix,
|
|
1588
1707
|
...(await this.flavor.postIxs({ signer: depositor })),
|
|
1589
1708
|
],
|
|
1590
|
-
signers: [lpPosition],
|
|
1709
|
+
signers: lpPosition instanceof Keypair ? [lpPosition] : [],
|
|
1591
1710
|
setupIxs: [tokenSyDepositorAtaIx, tokenYtDepositorAtaIx, tokenPtDepositorAtaIx],
|
|
1592
1711
|
}
|
|
1593
1712
|
}
|
|
1594
1713
|
|
|
1714
|
+
/**
|
|
1715
|
+
* Provide concentrated liquidity from a base asset plus existing PT tokens ("classic" mode).
|
|
1716
|
+
*
|
|
1717
|
+
* Unlike {@link ixWrapperProvideLiquidity}, this allows the depositor to supply PT they already
|
|
1718
|
+
* hold instead of having the program strip SY into PT+YT. Useful when the depositor has leftover
|
|
1719
|
+
* PT from a previous trade or wants finer control over token composition.
|
|
1720
|
+
*
|
|
1721
|
+
* @param depositor - Wallet signing the transaction
|
|
1722
|
+
* @param amountBase - Amount of base asset to deposit (converted to SY internally)
|
|
1723
|
+
* @param amountPt - Amount of PT to deposit alongside the base asset
|
|
1724
|
+
* @param minLpOut - Minimum LP tokens to receive (slippage protection)
|
|
1725
|
+
* @param lowerTickApy - Lower APY bound for the liquidity range
|
|
1726
|
+
* @param upperTickApy - Upper APY bound for the liquidity range
|
|
1727
|
+
*/
|
|
1595
1728
|
async ixProvideLiquidityClassic({
|
|
1596
1729
|
depositor,
|
|
1597
1730
|
amountBase,
|
|
@@ -1603,17 +1736,19 @@ export class MarketThree {
|
|
|
1603
1736
|
tokenYtDepositor: tokenYtDepositorParam,
|
|
1604
1737
|
tokenPtDepositor: tokenPtDepositorParam,
|
|
1605
1738
|
tokenBaseDepositor: tokenBaseDepositorParam,
|
|
1739
|
+
lpPositionParam,
|
|
1606
1740
|
}: {
|
|
1607
|
-
depositor:
|
|
1741
|
+
depositor: PublicKey
|
|
1608
1742
|
amountBase: bigint
|
|
1609
1743
|
amountPt: bigint
|
|
1610
1744
|
minLpOut: bigint
|
|
1611
1745
|
lowerTickApy: number
|
|
1612
1746
|
upperTickApy: number
|
|
1613
|
-
tokenSyDepositor?:
|
|
1614
|
-
tokenYtDepositor?:
|
|
1615
|
-
tokenPtDepositor?:
|
|
1616
|
-
tokenBaseDepositor?:
|
|
1747
|
+
tokenSyDepositor?: PublicKey
|
|
1748
|
+
tokenYtDepositor?: PublicKey
|
|
1749
|
+
tokenPtDepositor?: PublicKey
|
|
1750
|
+
tokenBaseDepositor?: PublicKey
|
|
1751
|
+
lpPositionParam?: Keypair | PublicKey
|
|
1617
1752
|
}) {
|
|
1618
1753
|
const tokenSyDepositor =
|
|
1619
1754
|
tokenSyDepositorParam || getAssociatedTokenAddressSync(this.mintSy, depositor, true, TOKEN_PROGRAM_ID)
|
|
@@ -1625,7 +1760,7 @@ export class MarketThree {
|
|
|
1625
1760
|
tokenBaseDepositorParam ||
|
|
1626
1761
|
getAssociatedTokenAddressSync(this.flavor.mintBase, depositor, true, this.flavor.baseTokenProgram)
|
|
1627
1762
|
|
|
1628
|
-
const lpPosition =
|
|
1763
|
+
const lpPosition = lpPositionParam || Keypair.generate()
|
|
1629
1764
|
|
|
1630
1765
|
const tokenSyAtaIx = createAssociatedTokenAccountIdempotentInstruction(
|
|
1631
1766
|
depositor,
|
|
@@ -1669,33 +1804,167 @@ export class MarketThree {
|
|
|
1669
1804
|
|
|
1670
1805
|
const mintSyRemAccounts = mintSyIx.keys
|
|
1671
1806
|
|
|
1672
|
-
const ix =
|
|
1673
|
-
|
|
1674
|
-
convertApyToApyBp(lowerTickApy),
|
|
1675
|
-
convertApyToApyBp(upperTickApy),
|
|
1676
|
-
new BN(amountBase.toString()),
|
|
1677
|
-
new BN(amountPt.toString()),
|
|
1678
|
-
new BN(minLpOut.toString()),
|
|
1679
|
-
mintSyRemAccounts.length,
|
|
1680
|
-
)
|
|
1681
|
-
.accountsStrict({
|
|
1807
|
+
const ix = exponentClmm.createWrapperProvideLiquidityClassicInstruction(
|
|
1808
|
+
{
|
|
1682
1809
|
depositor,
|
|
1683
|
-
lpPosition: lpPosition.publicKey,
|
|
1684
1810
|
market: this.selfAddress,
|
|
1811
|
+
ticks: this.ticksKey,
|
|
1685
1812
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1686
1813
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1687
|
-
|
|
1814
|
+
tokenSyDepositor,
|
|
1815
|
+
tokenPtDepositor,
|
|
1688
1816
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1689
1817
|
marketAddressLookupTable: this.addressLookupTable,
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1818
|
+
syProgram: this.syProgram,
|
|
1819
|
+
lpPosition: lpPosition instanceof Keypair ? lpPosition.publicKey : lpPosition,
|
|
1820
|
+
instructionsSysvar: SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
1821
|
+
systemProgram: SystemProgram.programId,
|
|
1822
|
+
rent: SYSVAR_RENT_PUBKEY,
|
|
1693
1823
|
eventAuthority: this.eventAuthority,
|
|
1694
|
-
program:
|
|
1824
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
1825
|
+
},
|
|
1826
|
+
{
|
|
1827
|
+
lowerTick: convertApyToApyBp(lowerTickApy),
|
|
1828
|
+
upperTick: convertApyToApyBp(upperTickApy),
|
|
1829
|
+
amountBase,
|
|
1830
|
+
amountPt,
|
|
1831
|
+
minLpOut,
|
|
1832
|
+
mintSyAccountsUntil: mintSyRemAccounts.length,
|
|
1833
|
+
},
|
|
1834
|
+
)
|
|
1835
|
+
ix.keys.push(...mintSyRemAccounts, ...remainingAccounts)
|
|
1836
|
+
|
|
1837
|
+
if (lpPosition instanceof Keypair) {
|
|
1838
|
+
ix.keys.find((k) => k.pubkey.equals(lpPosition.publicKey))!.isSigner = true
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
return {
|
|
1842
|
+
ixs: [
|
|
1843
|
+
...(await this.flavor.preIxs({ signer: depositor })),
|
|
1844
|
+
ix,
|
|
1845
|
+
...(await this.flavor.postIxs({ signer: depositor })),
|
|
1846
|
+
],
|
|
1847
|
+
signers: lpPosition instanceof Keypair ? [lpPosition] : [],
|
|
1848
|
+
setupIxs: [tokenSyAtaIx, tokenYtAtaIx, tokenPtAtaIx, tokenBaseAtaIx],
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
async ixProvideLiquidityBase({
|
|
1853
|
+
depositor,
|
|
1854
|
+
externalPtToBuy,
|
|
1855
|
+
externalSyConstraint,
|
|
1856
|
+
minLpOut,
|
|
1857
|
+
lowerTickApy,
|
|
1858
|
+
upperTickApy,
|
|
1859
|
+
tokenSyDepositor: tokenSyDepositorParam,
|
|
1860
|
+
tokenYtDepositor: tokenYtDepositorParam,
|
|
1861
|
+
tokenPtDepositor: tokenPtDepositorParam,
|
|
1862
|
+
tokenBaseDepositor: tokenBaseDepositorParam,
|
|
1863
|
+
lpPositionParam,
|
|
1864
|
+
}: {
|
|
1865
|
+
depositor: PublicKey
|
|
1866
|
+
externalPtToBuy: bigint
|
|
1867
|
+
externalSyConstraint: bigint
|
|
1868
|
+
minLpOut: bigint
|
|
1869
|
+
lowerTickApy: number
|
|
1870
|
+
upperTickApy: number
|
|
1871
|
+
tokenSyDepositor?: PublicKey
|
|
1872
|
+
tokenYtDepositor?: PublicKey
|
|
1873
|
+
tokenPtDepositor?: PublicKey
|
|
1874
|
+
tokenBaseDepositor?: PublicKey
|
|
1875
|
+
lpPositionParam?: Keypair | PublicKey
|
|
1876
|
+
}) {
|
|
1877
|
+
const tokenSyDepositor =
|
|
1878
|
+
tokenSyDepositorParam || getAssociatedTokenAddressSync(this.mintSy, depositor, true, TOKEN_PROGRAM_ID)
|
|
1879
|
+
const tokenYtDepositor =
|
|
1880
|
+
tokenYtDepositorParam || getAssociatedTokenAddressSync(this.mintYt, depositor, true, TOKEN_PROGRAM_ID)
|
|
1881
|
+
const tokenPtDepositor =
|
|
1882
|
+
tokenPtDepositorParam || getAssociatedTokenAddressSync(this.mintPt, depositor, true, TOKEN_PROGRAM_ID)
|
|
1883
|
+
const tokenBaseDepositor =
|
|
1884
|
+
tokenBaseDepositorParam ||
|
|
1885
|
+
getAssociatedTokenAddressSync(this.flavor.mintBase, depositor, true, this.flavor.baseTokenProgram)
|
|
1886
|
+
|
|
1887
|
+
const lpPosition = lpPositionParam || Keypair.generate()
|
|
1888
|
+
|
|
1889
|
+
const tokenSyAtaIx = createAssociatedTokenAccountIdempotentInstruction(
|
|
1890
|
+
depositor,
|
|
1891
|
+
tokenSyDepositor,
|
|
1892
|
+
depositor,
|
|
1893
|
+
this.mintSy,
|
|
1894
|
+
)
|
|
1895
|
+
const tokenYtAtaIx = createAssociatedTokenAccountIdempotentInstruction(
|
|
1896
|
+
depositor,
|
|
1897
|
+
tokenYtDepositor,
|
|
1898
|
+
depositor,
|
|
1899
|
+
this.mintYt,
|
|
1900
|
+
)
|
|
1901
|
+
const tokenPtAtaIx = createAssociatedTokenAccountIdempotentInstruction(
|
|
1902
|
+
depositor,
|
|
1903
|
+
tokenPtDepositor,
|
|
1904
|
+
depositor,
|
|
1905
|
+
this.mintPt,
|
|
1906
|
+
)
|
|
1907
|
+
const tokenBaseAtaIx = createAssociatedTokenAccountIdempotentInstruction(
|
|
1908
|
+
depositor,
|
|
1909
|
+
tokenBaseDepositor,
|
|
1910
|
+
depositor,
|
|
1911
|
+
this.flavor.mintBase,
|
|
1912
|
+
this.flavor.baseTokenProgram,
|
|
1913
|
+
)
|
|
1914
|
+
|
|
1915
|
+
const remainingAccounts = uniqueRemainingAccounts([
|
|
1916
|
+
...this.cpiSyAccounts.depositSy,
|
|
1917
|
+
...this.cpiSyAccounts.withdrawSy,
|
|
1918
|
+
...this.cpiCoreAccounts.stripSy,
|
|
1919
|
+
...this.cpiSyAccounts.getPositionState,
|
|
1920
|
+
])
|
|
1921
|
+
|
|
1922
|
+
const mintSyIx = await this.flavor.ixMintSy({
|
|
1923
|
+
amountBase: "0",
|
|
1924
|
+
depositor,
|
|
1925
|
+
depositorBaseTokenAccount: tokenBaseDepositor,
|
|
1926
|
+
depositorSyTokenAccount: tokenSyDepositor,
|
|
1927
|
+
})
|
|
1928
|
+
|
|
1929
|
+
const mintSyRemAccounts = mintSyIx.keys
|
|
1930
|
+
|
|
1931
|
+
const ix = exponentClmm.createWrapperProvideLiquidityBaseInstruction(
|
|
1932
|
+
{
|
|
1933
|
+
depositor,
|
|
1934
|
+
market: this.selfAddress,
|
|
1695
1935
|
ticks: this.ticksKey,
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1936
|
+
tokenPtEscrow: this.tokenPtEscrow,
|
|
1937
|
+
tokenSyEscrow: this.tokenSyEscrow,
|
|
1938
|
+
tokenSyDepositor,
|
|
1939
|
+
tokenPtDepositor,
|
|
1940
|
+
tokenFeeTreasurySy: this.tokenFeeTreasurySy,
|
|
1941
|
+
tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
|
|
1942
|
+
mintPt: this.mintPt,
|
|
1943
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1944
|
+
marketAddressLookupTable: this.addressLookupTable,
|
|
1945
|
+
syProgram: this.syProgram,
|
|
1946
|
+
exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1947
|
+
lpPosition: lpPosition instanceof Keypair ? lpPosition.publicKey : lpPosition,
|
|
1948
|
+
instructionsSysvar: SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
1949
|
+
systemProgram: SystemProgram.programId,
|
|
1950
|
+
rent: SYSVAR_RENT_PUBKEY,
|
|
1951
|
+
eventAuthority: this.eventAuthority,
|
|
1952
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
1953
|
+
},
|
|
1954
|
+
{
|
|
1955
|
+
lowerTickKey: convertApyToApyBp(lowerTickApy),
|
|
1956
|
+
upperTickKey: convertApyToApyBp(upperTickApy),
|
|
1957
|
+
minLpOut,
|
|
1958
|
+
mintSyAccountsUntil: mintSyRemAccounts.length,
|
|
1959
|
+
externalPtToBuy,
|
|
1960
|
+
externalSyConstraint,
|
|
1961
|
+
},
|
|
1962
|
+
)
|
|
1963
|
+
ix.keys.push(...mintSyRemAccounts, ...remainingAccounts)
|
|
1964
|
+
|
|
1965
|
+
if (lpPosition instanceof Keypair) {
|
|
1966
|
+
ix.keys.find((k) => k.pubkey.equals(lpPosition.publicKey))!.isSigner = true
|
|
1967
|
+
}
|
|
1699
1968
|
|
|
1700
1969
|
return {
|
|
1701
1970
|
ixs: [
|
|
@@ -1703,7 +1972,7 @@ export class MarketThree {
|
|
|
1703
1972
|
ix,
|
|
1704
1973
|
...(await this.flavor.postIxs({ signer: depositor })),
|
|
1705
1974
|
],
|
|
1706
|
-
signers: [lpPosition],
|
|
1975
|
+
signers: lpPosition instanceof Keypair ? [lpPosition] : [],
|
|
1707
1976
|
setupIxs: [tokenSyAtaIx, tokenYtAtaIx, tokenPtAtaIx, tokenBaseAtaIx],
|
|
1708
1977
|
}
|
|
1709
1978
|
}
|
|
@@ -1718,14 +1987,14 @@ export class MarketThree {
|
|
|
1718
1987
|
tokenPtWithdrawer: tokenPtWithdrawerParam,
|
|
1719
1988
|
tokenBaseWithdrawer: tokenBaseWithdrawerParam,
|
|
1720
1989
|
}: {
|
|
1721
|
-
owner:
|
|
1990
|
+
owner: PublicKey
|
|
1722
1991
|
amountLp: bigint
|
|
1723
1992
|
minBaseOut: bigint
|
|
1724
|
-
lpPosition:
|
|
1725
|
-
tokenSyWithdrawer?:
|
|
1726
|
-
tokenYtWithdrawer?:
|
|
1727
|
-
tokenPtWithdrawer?:
|
|
1728
|
-
tokenBaseWithdrawer?:
|
|
1993
|
+
lpPosition: PublicKey
|
|
1994
|
+
tokenSyWithdrawer?: PublicKey
|
|
1995
|
+
tokenYtWithdrawer?: PublicKey
|
|
1996
|
+
tokenPtWithdrawer?: PublicKey
|
|
1997
|
+
tokenBaseWithdrawer?: PublicKey
|
|
1729
1998
|
}) {
|
|
1730
1999
|
const tokenSyWithdrawer =
|
|
1731
2000
|
tokenSyWithdrawerParam || getAssociatedTokenAddressSync(this.mintSy, owner, true, TOKEN_PROGRAM_ID)
|
|
@@ -1764,32 +2033,32 @@ export class MarketThree {
|
|
|
1764
2033
|
|
|
1765
2034
|
const minSyOut = Number(minBaseOut) / this.currentSyExchangeRate
|
|
1766
2035
|
|
|
1767
|
-
const ix =
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
new BN(minSyOut.toFixed(0).toString()),
|
|
1771
|
-
redeemSyRemAccounts.length,
|
|
1772
|
-
)
|
|
1773
|
-
.accountsStrict({
|
|
2036
|
+
const ix = exponentClmm.createWrapperWithdrawLiquidityInstruction(
|
|
2037
|
+
{
|
|
2038
|
+
withdrawer: owner,
|
|
1774
2039
|
market: this.selfAddress,
|
|
2040
|
+
ticks: this.ticksKey,
|
|
1775
2041
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1776
2042
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1777
|
-
|
|
2043
|
+
tokenSyWithdrawer,
|
|
2044
|
+
tokenPtWithdrawer,
|
|
2045
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1778
2046
|
marketAddressLookupTable: this.addressLookupTable,
|
|
1779
|
-
eventAuthority: this.eventAuthority,
|
|
1780
2047
|
syProgram: this.syProgram,
|
|
1781
|
-
systemProgram: web3.SystemProgram.programId,
|
|
1782
2048
|
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1783
|
-
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1784
|
-
tokenPtWithdrawer,
|
|
1785
|
-
tokenSyWithdrawer,
|
|
1786
|
-
withdrawer: owner,
|
|
1787
|
-
ticks: this.ticksKey,
|
|
1788
2049
|
tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
2050
|
+
lpPosition,
|
|
2051
|
+
systemProgram: SystemProgram.programId,
|
|
2052
|
+
eventAuthority: this.eventAuthority,
|
|
2053
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
2054
|
+
},
|
|
2055
|
+
{
|
|
2056
|
+
amountLp,
|
|
2057
|
+
syConstraint: BigInt(minSyOut.toFixed(0)),
|
|
2058
|
+
redeemSyAccountsLength: redeemSyRemAccounts.length,
|
|
2059
|
+
},
|
|
2060
|
+
)
|
|
2061
|
+
ix.keys.push(...redeemSyRemAccounts, ...remainingAccounts)
|
|
1793
2062
|
|
|
1794
2063
|
return {
|
|
1795
2064
|
ixs: [...(await this.flavor.preIxs({ signer: owner })), ix, ...(await this.flavor.postIxs({ signer: owner }))],
|
|
@@ -1806,13 +2075,13 @@ export class MarketThree {
|
|
|
1806
2075
|
tokenPtWithdrawer: tokenPtWithdrawerParam,
|
|
1807
2076
|
tokenBaseWithdrawer: tokenBaseWithdrawerParam,
|
|
1808
2077
|
}: {
|
|
1809
|
-
owner:
|
|
2078
|
+
owner: PublicKey
|
|
1810
2079
|
amountLp: bigint
|
|
1811
|
-
lpPosition:
|
|
1812
|
-
tokenSyWithdrawer?:
|
|
1813
|
-
tokenYtWithdrawer?:
|
|
1814
|
-
tokenPtWithdrawer?:
|
|
1815
|
-
tokenBaseWithdrawer?:
|
|
2080
|
+
lpPosition: PublicKey
|
|
2081
|
+
tokenSyWithdrawer?: PublicKey
|
|
2082
|
+
tokenYtWithdrawer?: PublicKey
|
|
2083
|
+
tokenPtWithdrawer?: PublicKey
|
|
2084
|
+
tokenBaseWithdrawer?: PublicKey
|
|
1816
2085
|
}) {
|
|
1817
2086
|
const tokenSyWithdrawer =
|
|
1818
2087
|
tokenSyWithdrawerParam || getAssociatedTokenAddressSync(this.mintSy, owner, true, TOKEN_PROGRAM_ID)
|
|
@@ -1849,26 +2118,29 @@ export class MarketThree {
|
|
|
1849
2118
|
|
|
1850
2119
|
const redeemSyRemAccounts = redeemSyIx.keys
|
|
1851
2120
|
|
|
1852
|
-
const ixn =
|
|
1853
|
-
|
|
1854
|
-
|
|
2121
|
+
const ixn = exponentClmm.createWrapperWithdrawLiquidityClassicInstruction(
|
|
2122
|
+
{
|
|
2123
|
+
withdrawer: owner,
|
|
1855
2124
|
market: this.selfAddress,
|
|
2125
|
+
ticks: this.ticksKey,
|
|
1856
2126
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1857
2127
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1858
|
-
|
|
2128
|
+
tokenSyWithdrawer,
|
|
2129
|
+
tokenPtWithdrawer,
|
|
2130
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1859
2131
|
marketAddressLookupTable: this.addressLookupTable,
|
|
1860
|
-
eventAuthority: this.eventAuthority,
|
|
1861
2132
|
syProgram: this.syProgram,
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
2133
|
+
lpPosition,
|
|
2134
|
+
systemProgram: SystemProgram.programId,
|
|
2135
|
+
eventAuthority: this.eventAuthority,
|
|
2136
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
2137
|
+
},
|
|
2138
|
+
{
|
|
2139
|
+
amountLp,
|
|
2140
|
+
redeemSyAccountsLength: redeemSyRemAccounts.length,
|
|
2141
|
+
},
|
|
2142
|
+
)
|
|
2143
|
+
ixn.keys.push(...redeemSyRemAccounts, ...remainingAccounts)
|
|
1872
2144
|
|
|
1873
2145
|
return {
|
|
1874
2146
|
ixs: [...(await this.flavor.preIxs({ signer: owner })), ixn, ...(await this.flavor.postIxs({ signer: owner }))],
|
|
@@ -1876,54 +2148,128 @@ export class MarketThree {
|
|
|
1876
2148
|
}
|
|
1877
2149
|
}
|
|
1878
2150
|
|
|
1879
|
-
async
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
2151
|
+
async ixAddLiquidity({
|
|
2152
|
+
owner,
|
|
2153
|
+
ptInIntent,
|
|
2154
|
+
syInIntent,
|
|
2155
|
+
tokenSyDepositor: tokenSyDepositorParam,
|
|
2156
|
+
tokenYtDepositor: tokenYtDepositorParam,
|
|
2157
|
+
tokenPtDepositor: tokenPtDepositorParam,
|
|
2158
|
+
tokenBaseDepositor: tokenBaseDepositorParam,
|
|
2159
|
+
lpPosition,
|
|
2160
|
+
}: {
|
|
2161
|
+
owner: PublicKey
|
|
2162
|
+
/** Intended (maximum) amount of PT in */
|
|
2163
|
+
ptInIntent: bigint
|
|
2164
|
+
/** Intended (maximum) amount of SY in */
|
|
2165
|
+
syInIntent: bigint
|
|
2166
|
+
tokenSyDepositor?: PublicKey
|
|
2167
|
+
tokenYtDepositor?: PublicKey
|
|
2168
|
+
tokenPtDepositor?: PublicKey
|
|
2169
|
+
tokenBaseDepositor?: PublicKey
|
|
2170
|
+
lpPosition: PublicKey
|
|
2171
|
+
}) {
|
|
2172
|
+
const tokenSyDepositor =
|
|
2173
|
+
tokenSyDepositorParam || getAssociatedTokenAddressSync(this.mintSy, owner, true, TOKEN_PROGRAM_ID)
|
|
2174
|
+
const tokenYtDepositor =
|
|
2175
|
+
tokenYtDepositorParam || getAssociatedTokenAddressSync(this.mintYt, owner, true, TOKEN_PROGRAM_ID)
|
|
2176
|
+
const tokenPtDepositor =
|
|
2177
|
+
tokenPtDepositorParam || getAssociatedTokenAddressSync(this.mintPt, owner, true, TOKEN_PROGRAM_ID)
|
|
2178
|
+
const tokenBaseDepositor =
|
|
2179
|
+
tokenBaseDepositorParam ||
|
|
2180
|
+
getAssociatedTokenAddressSync(this.flavor.mintBase, owner, true, this.flavor.baseTokenProgram)
|
|
2181
|
+
|
|
2182
|
+
const tokenSyAtaIx = createAssociatedTokenAccountIdempotentInstruction(owner, tokenSyDepositor, owner, this.mintSy)
|
|
2183
|
+
const tokenYtAtaIx = createAssociatedTokenAccountIdempotentInstruction(owner, tokenYtDepositor, owner, this.mintYt)
|
|
2184
|
+
const tokenPtAtaIx = createAssociatedTokenAccountIdempotentInstruction(owner, tokenPtDepositor, owner, this.mintPt)
|
|
2185
|
+
const tokenBaseAtaIx = createAssociatedTokenAccountIdempotentInstruction(
|
|
2186
|
+
owner,
|
|
2187
|
+
tokenBaseDepositor,
|
|
2188
|
+
owner,
|
|
2189
|
+
this.flavor.mintBase,
|
|
2190
|
+
this.flavor.baseTokenProgram,
|
|
2191
|
+
)
|
|
2192
|
+
|
|
2193
|
+
const remainingAccounts = uniqueRemainingAccounts([
|
|
2194
|
+
...this.cpiSyAccounts.depositSy,
|
|
2195
|
+
...this.cpiSyAccounts.withdrawSy,
|
|
2196
|
+
...this.cpiCoreAccounts.stripSy,
|
|
2197
|
+
...this.cpiSyAccounts.getPositionState,
|
|
2198
|
+
])
|
|
2199
|
+
|
|
2200
|
+
const ix = exponentClmm.createAddLiquidityInstruction(
|
|
2201
|
+
{
|
|
2202
|
+
owner,
|
|
2203
|
+
market: this.selfAddress,
|
|
2204
|
+
ticks: this.ticksKey,
|
|
2205
|
+
lpPosition: lpPosition instanceof Keypair ? lpPosition.publicKey : lpPosition,
|
|
2206
|
+
tokenPtSrc: tokenPtDepositor,
|
|
2207
|
+
tokenSySrc: tokenSyDepositor,
|
|
2208
|
+
tokenPtEscrow: this.tokenPtEscrow,
|
|
2209
|
+
tokenSyEscrow: this.tokenSyEscrow,
|
|
2210
|
+
addressLookupTable: this.addressLookupTable,
|
|
2211
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
2212
|
+
syProgram: this.syProgram,
|
|
2213
|
+
instructionsSysvar: SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
2214
|
+
systemProgram: SystemProgram.programId,
|
|
2215
|
+
rent: SYSVAR_RENT_PUBKEY,
|
|
2216
|
+
eventAuthority: this.eventAuthority,
|
|
2217
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
2218
|
+
},
|
|
2219
|
+
{
|
|
2220
|
+
maxSyInToAdd: syInIntent,
|
|
2221
|
+
maxPtInToAdd: ptInIntent,
|
|
2222
|
+
lowerTickKeyOptional: null,
|
|
2223
|
+
upperTickKeyOptional: null,
|
|
2224
|
+
},
|
|
2225
|
+
)
|
|
2226
|
+
ix.keys.push(...remainingAccounts)
|
|
2227
|
+
|
|
2228
|
+
return {
|
|
2229
|
+
ixs: [...(await this.flavor.preIxs({ signer: owner })), ix, ...(await this.flavor.postIxs({ signer: owner }))],
|
|
2230
|
+
signers: lpPosition instanceof Keypair ? [lpPosition] : [],
|
|
2231
|
+
setupIxs: [tokenSyAtaIx, tokenYtAtaIx, tokenPtAtaIx, tokenBaseAtaIx],
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
async getUserLpPositions(owner: PublicKey, market: PublicKey) {
|
|
2236
|
+
const LP_POSITION_DISCRIMINATOR = Buffer.from([105, 241, 37, 200, 224, 2, 252, 90])
|
|
2237
|
+
|
|
2238
|
+
const accounts = await this.connection.getProgramAccounts(
|
|
2239
|
+
exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
2240
|
+
{
|
|
2241
|
+
filters: [
|
|
2242
|
+
{ memcmp: { offset: 0, bytes: bs58.encode(LP_POSITION_DISCRIMINATOR) } },
|
|
2243
|
+
{ memcmp: { offset: 8, bytes: owner.toBase58() } },
|
|
2244
|
+
{ memcmp: { offset: 40, bytes: market.toBase58() } },
|
|
2245
|
+
],
|
|
2246
|
+
},
|
|
1885
2247
|
)
|
|
2248
|
+
|
|
2249
|
+
const lpPositions = accounts.map(({ pubkey, account }) => ({
|
|
2250
|
+
publicKey: pubkey,
|
|
2251
|
+
account: exponentClmm.deserializeLpPositionAccount(account.data),
|
|
2252
|
+
}))
|
|
2253
|
+
|
|
1886
2254
|
return {
|
|
1887
2255
|
lpPositions: [lpPositions],
|
|
1888
2256
|
}
|
|
1889
2257
|
}
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
// const ixn = await this.clmmProgram.methods
|
|
1893
|
-
// .closeMarket()
|
|
1894
|
-
// .accountsStrict({
|
|
1895
|
-
// market: this.selfAddress,
|
|
1896
|
-
// systemProgram: web3.SystemProgram.programId,
|
|
1897
|
-
// payer: owner,
|
|
1898
|
-
// ticks: this.ticksKey,
|
|
1899
|
-
// program: this.clmmProgram.programId,
|
|
1900
|
-
// eventAuthority: this.eventAuthority,
|
|
1901
|
-
// rent: web3.SYSVAR_RENT_PUBKEY,
|
|
1902
|
-
// })
|
|
1903
|
-
// .instruction()
|
|
1904
|
-
|
|
1905
|
-
// return {
|
|
1906
|
-
// ixs: [ixn],
|
|
1907
|
-
// }
|
|
1908
|
-
// }
|
|
1909
|
-
|
|
1910
|
-
async ixMarketAccureEmissions({ owner, lpPosition }: { owner: web3.PublicKey; lpPosition: web3.PublicKey }) {
|
|
2258
|
+
|
|
2259
|
+
ixMarketAccureEmissions({ owner, lpPosition }: { owner: PublicKey; lpPosition: PublicKey }) {
|
|
1911
2260
|
const remainingAccounts = uniqueRemainingAccounts([...this.cpiSyAccounts.getPositionState])
|
|
1912
|
-
const ixn =
|
|
1913
|
-
|
|
1914
|
-
.
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
})
|
|
1925
|
-
.remainingAccounts(remainingAccounts)
|
|
1926
|
-
.instruction()
|
|
2261
|
+
const ixn = exponentClmm.createMarketAccrueEmissionInstruction({
|
|
2262
|
+
owner,
|
|
2263
|
+
market: this.selfAddress,
|
|
2264
|
+
ticks: this.ticksKey,
|
|
2265
|
+
lpPosition,
|
|
2266
|
+
addressLookupTable: this.addressLookupTable,
|
|
2267
|
+
syProgram: this.syProgram,
|
|
2268
|
+
systemProgram: SystemProgram.programId,
|
|
2269
|
+
eventAuthority: this.eventAuthority,
|
|
2270
|
+
program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
|
|
2271
|
+
})
|
|
2272
|
+
ixn.keys.push(...remainingAccounts)
|
|
1927
2273
|
|
|
1928
2274
|
return {
|
|
1929
2275
|
ixs: [ixn],
|
|
@@ -2163,13 +2509,13 @@ async getUserLpPositions(owner: web3.PublicKey, market: web3.PublicKey) {
|
|
|
2163
2509
|
}
|
|
2164
2510
|
}
|
|
2165
2511
|
|
|
2166
|
-
|
|
2512
|
+
depositYtAccounts({
|
|
2167
2513
|
owner,
|
|
2168
2514
|
ytSrc: ytSrcParam,
|
|
2169
2515
|
}: {
|
|
2170
|
-
owner:
|
|
2171
|
-
ytSrc?:
|
|
2172
|
-
}):
|
|
2516
|
+
owner: PublicKey
|
|
2517
|
+
ytSrc?: PublicKey
|
|
2518
|
+
}): TransactionInstruction {
|
|
2173
2519
|
const ytSrc = ytSrcParam || getAssociatedTokenAddressSync(this.mintYt, owner, true, TOKEN_PROGRAM_ID)
|
|
2174
2520
|
const userYieldPosition = this.corePda.yieldPosition({ vault: this.state.vault.selfAddress, owner })
|
|
2175
2521
|
const yieldPosition = this.corePda.vaultYieldPosition({ vault: this.state.vault.selfAddress })
|
|
@@ -2178,27 +2524,68 @@ async getUserLpPositions(owner: web3.PublicKey, market: web3.PublicKey) {
|
|
|
2178
2524
|
depositor: owner,
|
|
2179
2525
|
ytSrc,
|
|
2180
2526
|
vault: this.state.vault.selfAddress,
|
|
2181
|
-
userYieldPosition
|
|
2182
|
-
escrowYt
|
|
2527
|
+
userYieldPosition,
|
|
2528
|
+
escrowYt,
|
|
2183
2529
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
2184
2530
|
syProgram: this.state.syProgram,
|
|
2185
2531
|
addressLookupTable: this.vault.addressLookupTable,
|
|
2186
2532
|
yieldPosition,
|
|
2187
|
-
systemProgram:
|
|
2533
|
+
systemProgram: SystemProgram.programId,
|
|
2188
2534
|
eventAuthority: this.coreEventAuthority,
|
|
2189
|
-
program:
|
|
2535
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
2190
2536
|
}
|
|
2191
2537
|
const remainingAccounts = this.cpiSyAccounts.getSyState
|
|
2192
2538
|
|
|
2193
|
-
const depositIx =
|
|
2194
|
-
|
|
2195
|
-
.accountsStrict(mainAccounts)
|
|
2196
|
-
.remainingAccounts(remainingAccounts)
|
|
2197
|
-
.instruction()
|
|
2539
|
+
const depositIx = exponentCore.createDepositYtInstruction(mainAccounts, { amount: 0n })
|
|
2540
|
+
depositIx.keys.push(...remainingAccounts)
|
|
2198
2541
|
|
|
2199
2542
|
return depositIx
|
|
2200
2543
|
}
|
|
2201
2544
|
|
|
2545
|
+
withdrawYtAccounts({
|
|
2546
|
+
owner,
|
|
2547
|
+
ytDst: ytDstParam,
|
|
2548
|
+
}: {
|
|
2549
|
+
owner: PublicKey
|
|
2550
|
+
ytDst?: PublicKey
|
|
2551
|
+
}): TransactionInstruction {
|
|
2552
|
+
const ytDst = ytDstParam || getAssociatedTokenAddressSync(this.mintYt, owner, true, TOKEN_PROGRAM_ID)
|
|
2553
|
+
const userYieldPosition = this.corePda.yieldPosition({ vault: this.state.vault.selfAddress, owner })
|
|
2554
|
+
const yieldPosition = this.corePda.vaultYieldPosition({ vault: this.state.vault.selfAddress })
|
|
2555
|
+
const escrowYt = this.corePda.escrowYt({ vault: this.state.vault.selfAddress })
|
|
2556
|
+
const mainAccounts = {
|
|
2557
|
+
owner,
|
|
2558
|
+
vault: this.state.vault.selfAddress,
|
|
2559
|
+
userYieldPosition,
|
|
2560
|
+
ytDst,
|
|
2561
|
+
escrowYt,
|
|
2562
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
2563
|
+
authority: this.vault.authority,
|
|
2564
|
+
syProgram: this.state.syProgram,
|
|
2565
|
+
addressLookupTable: this.vault.addressLookupTable,
|
|
2566
|
+
yieldPosition,
|
|
2567
|
+
systemProgram: SystemProgram.programId,
|
|
2568
|
+
eventAuthority: this.coreEventAuthority,
|
|
2569
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
2570
|
+
}
|
|
2571
|
+
const remainingAccounts = this.cpiSyAccounts.getSyState
|
|
2572
|
+
|
|
2573
|
+
const withdrawIx = exponentCore.createWithdrawYtInstruction(mainAccounts, { amount: 0n })
|
|
2574
|
+
withdrawIx.keys.push(...remainingAccounts)
|
|
2575
|
+
|
|
2576
|
+
return withdrawIx
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
/**
|
|
2580
|
+
* Estimate the yield (fees + emissions) a hypothetical LP position would have earned
|
|
2581
|
+
* between two market snapshots.
|
|
2582
|
+
*
|
|
2583
|
+
* @param marketSnapshotDataCurrent - The more recent market snapshot
|
|
2584
|
+
* @param marketSnapshotDataHistory - The older market snapshot (defines the look-back window)
|
|
2585
|
+
* @param lowerPricePercentage - Lower price bound as a percentage (e.g. 5 for 5%)
|
|
2586
|
+
* @param upperPricePercentage - Upper price bound as a percentage
|
|
2587
|
+
* @param baseTokenAmount - Amount of base tokens in the hypothetical position
|
|
2588
|
+
*/
|
|
2202
2589
|
static calcEstimatedYieldForPosition(
|
|
2203
2590
|
marketSnapshotDataCurrent: MarketSnapshotData,
|
|
2204
2591
|
marketSnapshotDataHistory: MarketSnapshotData,
|
|
@@ -2313,6 +2700,42 @@ async getUserLpPositions(owner: web3.PublicKey, market: web3.PublicKey) {
|
|
|
2313
2700
|
}
|
|
2314
2701
|
}
|
|
2315
2702
|
|
|
2703
|
+
/**
|
|
2704
|
+
* Calculate TVL (Total Value Locked) in baseToken for a market
|
|
2705
|
+
*
|
|
2706
|
+
* @param currentSpotPrice - Current spot price in format of 1 + percentage / 100
|
|
2707
|
+
* @param financials - Market financials containing balances and expiration timestamp
|
|
2708
|
+
* @param syExchangeRate - SY exchange rate
|
|
2709
|
+
* @param timestampUnix - Timestamp in seconds (defaults to current time)
|
|
2710
|
+
* @returns Object with TVL breakdown: total TVL, PT liquidity, and SY liquidity in baseToken
|
|
2711
|
+
*/
|
|
2712
|
+
static calcTvlInBaseToken(params: {
|
|
2713
|
+
financials: MarketThreeFinancials
|
|
2714
|
+
currentSpotPrice: number
|
|
2715
|
+
syExchangeRate: number
|
|
2716
|
+
timestampUnix?: number
|
|
2717
|
+
}): {
|
|
2718
|
+
tvlInBaseToken: number
|
|
2719
|
+
ptLiquidityInBaseToken: number
|
|
2720
|
+
syLiquidityInBaseToken: number
|
|
2721
|
+
} {
|
|
2722
|
+
const { financials, currentSpotPrice, syExchangeRate, timestampUnix = Date.now() / 1000 } = params
|
|
2723
|
+
|
|
2724
|
+
const secondsRemaining = Math.max(0, Number(financials.expirationTs) - timestampUnix)
|
|
2725
|
+
|
|
2726
|
+
const ptPriceInBaseToken = calcPtPriceInAsset(currentSpotPrice, secondsRemaining)
|
|
2727
|
+
|
|
2728
|
+
const ptLiquidityInBaseToken = Number(financials.ptBalance) * ptPriceInBaseToken
|
|
2729
|
+
const syLiquidityInBaseToken = Number(financials.syBalance) * syExchangeRate
|
|
2730
|
+
const tvlInBaseToken = ptLiquidityInBaseToken + syLiquidityInBaseToken
|
|
2731
|
+
|
|
2732
|
+
return {
|
|
2733
|
+
tvlInBaseToken: Math.round(tvlInBaseToken),
|
|
2734
|
+
ptLiquidityInBaseToken: Math.round(ptLiquidityInBaseToken),
|
|
2735
|
+
syLiquidityInBaseToken: Math.round(syLiquidityInBaseToken),
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2316
2739
|
static calcGlobalFeeRate(
|
|
2317
2740
|
marketSnapshotDataCurrent: MarketSnapshotData,
|
|
2318
2741
|
marketSnapshotDataHistory: MarketSnapshotData,
|