@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/market.ts
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { AnchorProvider, BN, Program, Wallet, web3 } from "@coral-xyz/anchor"
|
|
2
1
|
import {
|
|
2
|
+
TOKEN_PROGRAM_ID,
|
|
3
3
|
createAssociatedTokenAccountIdempotentInstruction,
|
|
4
4
|
getAssociatedTokenAddressSync,
|
|
5
|
-
TOKEN_PROGRAM_ID,
|
|
6
5
|
} from "@solana/spl-token"
|
|
7
6
|
|
|
8
7
|
import { ExponentFetcher, LiquidityNetBalanceLimits, LpFarm } from "@exponent-labs/exponent-fetcher"
|
|
9
|
-
import { ExponentCore, IDL } from "@exponent-labs/exponent-idl"
|
|
10
8
|
import { ExponentPDA } from "@exponent-labs/exponent-pda"
|
|
11
9
|
import {
|
|
12
10
|
AnchorizedPNum,
|
|
13
11
|
CpiAccountsRaw,
|
|
14
12
|
CpiAccountsRawJson,
|
|
15
13
|
Flavor,
|
|
16
|
-
serializeCpiAccountsRaw,
|
|
17
14
|
SyPosition,
|
|
15
|
+
serializeCpiAccountsRaw,
|
|
16
|
+
} from "@exponent-labs/exponent-types"
|
|
17
|
+
import {
|
|
18
|
+
FlavorGenericStateJson,
|
|
19
|
+
SyPositionJson,
|
|
20
|
+
VaultJson,
|
|
21
|
+
deserializeCpiAccountsRaw,
|
|
18
22
|
} from "@exponent-labs/exponent-types"
|
|
19
|
-
import { LiquidityAdd,
|
|
23
|
+
import { LiquidityAdd, MarketCalculator, lpOutForTokensIn } from "@exponent-labs/market-math"
|
|
20
24
|
import { PreciseNumber } from "@exponent-labs/precise-number"
|
|
21
25
|
|
|
22
26
|
import { fetchAddressLookupTable, makeCpiAccountMetaLists } from "./addressLookupTableUtil"
|
|
@@ -30,33 +34,28 @@ import {
|
|
|
30
34
|
makeFlavorPerenaSync,
|
|
31
35
|
serializeFlavor,
|
|
32
36
|
} from "./flavors"
|
|
33
|
-
import {
|
|
34
|
-
deserializeCpiAccountsRaw,
|
|
35
|
-
FlavorGenericStateJson,
|
|
36
|
-
SyPositionJson,
|
|
37
|
-
VaultJson,
|
|
38
|
-
} from "@exponent-labs/exponent-types"
|
|
39
|
-
|
|
40
37
|
import { deserializeSyPosition, serializeSyPosition } from "./syPosition"
|
|
41
38
|
import { makeSyPosition } from "./syPosition"
|
|
42
39
|
import { getMultipleMintSupply } from "./tokenUtil"
|
|
43
40
|
import { emitEventAuthority, getExponentAdminStatePda, uniqueRemainingAccounts } from "./utils"
|
|
44
41
|
import { extendAddressLookupTable } from "./utils/altUtil"
|
|
45
42
|
import { Vault } from "./vault"
|
|
46
|
-
|
|
43
|
+
import { Connection, PublicKey, SYSVAR_RENT_PUBKEY, SystemProgram, TransactionInstruction } from "@solana/web3.js"
|
|
44
|
+
import * as exponentCore from "./client/core"
|
|
45
|
+
import BN from 'bn.js'
|
|
47
46
|
export type { LiquidityAdd }
|
|
48
47
|
|
|
49
48
|
const SECONDS_PER_YEAR = 365 * 24 * 60 * 60
|
|
50
49
|
|
|
51
50
|
interface Emission {
|
|
52
51
|
/** Token account that holds emission tokens */
|
|
53
|
-
escrowAccountAddress:
|
|
52
|
+
escrowAccountAddress: PublicKey
|
|
54
53
|
|
|
55
54
|
/** Mint for the emission token */
|
|
56
|
-
mint:
|
|
55
|
+
mint: PublicKey
|
|
57
56
|
|
|
58
57
|
/** Token program ID for the emission token */
|
|
59
|
-
tokenProgramAddress:
|
|
58
|
+
tokenProgramAddress: PublicKey
|
|
60
59
|
|
|
61
60
|
/** How many emissions have been claimed by SY holders */
|
|
62
61
|
totalClaimed: bigint
|
|
@@ -68,20 +67,7 @@ interface Emission {
|
|
|
68
67
|
index: AnchorizedPNum
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
export type MarketAdminAction =
|
|
72
|
-
| { setStatus: [number] }
|
|
73
|
-
| { setMaxLpSupply: [BN] }
|
|
74
|
-
| { changeTreasuryTradeSyBpsFee: [number] }
|
|
75
|
-
| { changeLnFeeRateRoot: [number] }
|
|
76
|
-
| { changeRateScalarRoot: [number] }
|
|
77
|
-
| {
|
|
78
|
-
changeLiquidityNetBalanceLimits: {
|
|
79
|
-
maxNetBalanceChangeNegativePercentage: number
|
|
80
|
-
maxNetBalanceChangePositivePercentage: number
|
|
81
|
-
windowDurationSeconds: number
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
| { removeMarketEmission: [number] }
|
|
70
|
+
export type MarketAdminAction = exponentCore.MarketAdminAction
|
|
85
71
|
|
|
86
72
|
type MarketArgs = {
|
|
87
73
|
ptBalance: bigint
|
|
@@ -94,19 +80,19 @@ type MarketArgs = {
|
|
|
94
80
|
lnFeeRateRoot: number
|
|
95
81
|
lastLnImpliedRate: number
|
|
96
82
|
expirationTs: number
|
|
97
|
-
addressLookupTable:
|
|
98
|
-
mintSy:
|
|
99
|
-
mintPt:
|
|
83
|
+
addressLookupTable: PublicKey
|
|
84
|
+
mintSy: PublicKey
|
|
85
|
+
mintPt: PublicKey
|
|
100
86
|
vault: Vault
|
|
101
|
-
mintLp:
|
|
102
|
-
tokenPtEscrow:
|
|
103
|
-
tokenSyEscrow:
|
|
104
|
-
tokenLpEscrow:
|
|
105
|
-
syProgram:
|
|
87
|
+
mintLp: PublicKey
|
|
88
|
+
tokenPtEscrow: PublicKey
|
|
89
|
+
tokenSyEscrow: PublicKey
|
|
90
|
+
tokenLpEscrow: PublicKey
|
|
91
|
+
syProgram: PublicKey
|
|
106
92
|
statusFlags: number
|
|
107
93
|
cpiAccounts: CpiAccountsRaw
|
|
108
94
|
feeTreasurySyBps: number
|
|
109
|
-
tokenFeeTreasurySy:
|
|
95
|
+
tokenFeeTreasurySy: PublicKey
|
|
110
96
|
isCurrentFlashSwap: boolean
|
|
111
97
|
lpFarm: LpFarm
|
|
112
98
|
flavor: Flavor
|
|
@@ -114,7 +100,7 @@ type MarketArgs = {
|
|
|
114
100
|
syPosition: SyPosition
|
|
115
101
|
emissions: {
|
|
116
102
|
trackers: {
|
|
117
|
-
tokenEscrow:
|
|
103
|
+
tokenEscrow: PublicKey
|
|
118
104
|
lpShareIndex: number
|
|
119
105
|
lastSeenStaged: number
|
|
120
106
|
}[]
|
|
@@ -122,36 +108,6 @@ type MarketArgs = {
|
|
|
122
108
|
seedId: number[]
|
|
123
109
|
}
|
|
124
110
|
|
|
125
|
-
//TODO Put it in the shared package because this code is repeated in many packages
|
|
126
|
-
export class MyWallet implements Wallet {
|
|
127
|
-
constructor(readonly payer: web3.Keypair) {
|
|
128
|
-
this.payer = payer
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
async signTransaction<T extends web3.Transaction | web3.VersionedTransaction>(tx: T): Promise<T> {
|
|
132
|
-
if (tx instanceof web3.Transaction) {
|
|
133
|
-
tx.partialSign(this.payer)
|
|
134
|
-
} else {
|
|
135
|
-
tx.sign([this.payer])
|
|
136
|
-
}
|
|
137
|
-
return tx
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
async signAllTransactions<T extends web3.Transaction | web3.VersionedTransaction>(txs: T[]): Promise<T[]> {
|
|
141
|
-
return txs.map((t) => {
|
|
142
|
-
if (t instanceof web3.Transaction) {
|
|
143
|
-
t.partialSign(this.payer)
|
|
144
|
-
} else if (t instanceof web3.VersionedTransaction) {
|
|
145
|
-
t.sign([this.payer])
|
|
146
|
-
}
|
|
147
|
-
return t
|
|
148
|
-
})
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
get publicKey(): web3.PublicKey {
|
|
152
|
-
return this.payer.publicKey
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
111
|
|
|
156
112
|
export interface MarketLoadOptions {
|
|
157
113
|
syConfig?: {
|
|
@@ -160,24 +116,21 @@ export interface MarketLoadOptions {
|
|
|
160
116
|
}
|
|
161
117
|
|
|
162
118
|
export class Market {
|
|
163
|
-
coreProgram: Program<ExponentCore>
|
|
164
119
|
xponPda: ExponentPDA
|
|
165
120
|
|
|
166
121
|
constructor(
|
|
167
122
|
public state: MarketArgs,
|
|
168
|
-
public selfAddress:
|
|
123
|
+
public selfAddress: PublicKey,
|
|
169
124
|
public env: Environment,
|
|
170
|
-
public connection:
|
|
125
|
+
public connection: Connection,
|
|
171
126
|
) {
|
|
172
127
|
this.xponPda = new ExponentPDA(env.coreProgramId)
|
|
173
|
-
const mockWallet = new MyWallet(web3.Keypair.generate())
|
|
174
|
-
this.coreProgram = new Program(IDL as ExponentCore, new AnchorProvider(connection, mockWallet))
|
|
175
128
|
}
|
|
176
129
|
|
|
177
130
|
static async load(
|
|
178
131
|
env: Environment,
|
|
179
|
-
connection:
|
|
180
|
-
address:
|
|
132
|
+
connection: Connection,
|
|
133
|
+
address: PublicKey,
|
|
181
134
|
vault?: Vault,
|
|
182
135
|
options: MarketLoadOptions = {},
|
|
183
136
|
): Promise<Market> {
|
|
@@ -221,7 +174,7 @@ export class Market {
|
|
|
221
174
|
return new Market(state, address, env, connection)
|
|
222
175
|
}
|
|
223
176
|
|
|
224
|
-
async reload(connection:
|
|
177
|
+
async reload(connection: Connection = this.connection) {
|
|
225
178
|
const market = await Market.load(this.env, connection, this.selfAddress)
|
|
226
179
|
this.state = market.state
|
|
227
180
|
return market
|
|
@@ -343,26 +296,26 @@ export class Market {
|
|
|
343
296
|
}
|
|
344
297
|
|
|
345
298
|
/** Get the escrow token account addresses for the emissions, in order */
|
|
346
|
-
get emissionTokenAccounts():
|
|
299
|
+
get emissionTokenAccounts(): PublicKey[] {
|
|
347
300
|
return this.emissions.map((e) => e.escrowAccountAddress)
|
|
348
301
|
}
|
|
349
302
|
|
|
350
303
|
/** Pass-through SY account owned by the market */
|
|
351
|
-
get tokenSyEscrow():
|
|
304
|
+
get tokenSyEscrow(): PublicKey {
|
|
352
305
|
return this.state.tokenSyEscrow
|
|
353
306
|
}
|
|
354
307
|
|
|
355
308
|
/** SY account that holds treasury SY fees from PT trading */
|
|
356
|
-
get tokenFeeTreasurySy():
|
|
309
|
+
get tokenFeeTreasurySy(): PublicKey {
|
|
357
310
|
return this.state.tokenFeeTreasurySy
|
|
358
311
|
}
|
|
359
312
|
|
|
360
313
|
/** Market liquidity for PT */
|
|
361
|
-
get tokenPtEscrow():
|
|
314
|
+
get tokenPtEscrow(): PublicKey {
|
|
362
315
|
return this.state.tokenPtEscrow
|
|
363
316
|
}
|
|
364
317
|
|
|
365
|
-
get tokenLpEscrow():
|
|
318
|
+
get tokenLpEscrow(): PublicKey {
|
|
366
319
|
return this.state.tokenLpEscrow
|
|
367
320
|
}
|
|
368
321
|
|
|
@@ -371,7 +324,7 @@ export class Market {
|
|
|
371
324
|
}
|
|
372
325
|
|
|
373
326
|
/** Special account for event emit self-cpi */
|
|
374
|
-
get eventAuthority():
|
|
327
|
+
get eventAuthority(): PublicKey {
|
|
375
328
|
return emitEventAuthority(this.env.coreProgramId)
|
|
376
329
|
}
|
|
377
330
|
|
|
@@ -489,7 +442,7 @@ export class Market {
|
|
|
489
442
|
*
|
|
490
443
|
* The token accounts themselves are optional, and will be derived from the depositor's wallet if not provided
|
|
491
444
|
*/
|
|
492
|
-
|
|
445
|
+
ixDepositLiquidity({
|
|
493
446
|
ptInIntent,
|
|
494
447
|
syInIntent,
|
|
495
448
|
minLpOut,
|
|
@@ -504,26 +457,19 @@ export class Market {
|
|
|
504
457
|
syInIntent: bigint
|
|
505
458
|
/** Minimum LP tokens out */
|
|
506
459
|
minLpOut: bigint
|
|
507
|
-
depositor:
|
|
508
|
-
ptSrc?:
|
|
509
|
-
sySrc?:
|
|
510
|
-
lpDst?:
|
|
511
|
-
}) {
|
|
512
|
-
const tokenProgram = TOKEN_PROGRAM_ID
|
|
513
|
-
|
|
460
|
+
depositor: PublicKey
|
|
461
|
+
ptSrc?: PublicKey
|
|
462
|
+
sySrc?: PublicKey
|
|
463
|
+
lpDst?: PublicKey
|
|
464
|
+
}): TransactionInstruction {
|
|
514
465
|
const sySrc = sySrcParam || getAssociatedTokenAddressSync(this.mintSy, depositor, true, TOKEN_PROGRAM_ID)
|
|
515
466
|
const ptSrc = ptSrcParam || getAssociatedTokenAddressSync(this.mintPt, depositor, true, TOKEN_PROGRAM_ID)
|
|
516
467
|
const lpDst = lpDstParam || getAssociatedTokenAddressSync(this.mintLp, depositor, true, TOKEN_PROGRAM_ID)
|
|
517
468
|
|
|
518
469
|
const syRemAccounts = this.cpiAccounts.depositSy
|
|
519
470
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
new BN(ptInIntent.toString()),
|
|
523
|
-
new BN(syInIntent.toString()),
|
|
524
|
-
new BN(minLpOut.toString()),
|
|
525
|
-
)
|
|
526
|
-
.accountsStrict({
|
|
471
|
+
const ix = exponentCore.createMarketTwoDepositLiquidityInstruction(
|
|
472
|
+
{
|
|
527
473
|
depositor,
|
|
528
474
|
market: this.selfAddress,
|
|
529
475
|
mintLp: this.mintLp,
|
|
@@ -534,27 +480,29 @@ export class Market {
|
|
|
534
480
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
535
481
|
addressLookupTable: this.addressLookupTable,
|
|
536
482
|
syProgram: this.syProgram,
|
|
537
|
-
tokenProgram,
|
|
483
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
538
484
|
eventAuthority: this.vault.eventAuthority,
|
|
539
|
-
program:
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
|
|
485
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
486
|
+
},
|
|
487
|
+
{ ptIntent: ptInIntent, syIntent: syInIntent, minLpOut },
|
|
488
|
+
)
|
|
489
|
+
ix.keys.push(...syRemAccounts)
|
|
490
|
+
return ix
|
|
543
491
|
}
|
|
544
492
|
|
|
545
|
-
|
|
546
|
-
return
|
|
547
|
-
|
|
548
|
-
.accountsStrict({
|
|
493
|
+
ixModifyMarketSetting({ signer, adminAction }: { signer: PublicKey; adminAction: exponentCore.MarketAdminAction }): TransactionInstruction {
|
|
494
|
+
return exponentCore.createModifyMarketSettingInstruction(
|
|
495
|
+
{
|
|
549
496
|
market: this.selfAddress,
|
|
550
497
|
adminState: getExponentAdminStatePda(),
|
|
551
498
|
signer,
|
|
552
|
-
systemProgram:
|
|
553
|
-
}
|
|
554
|
-
|
|
499
|
+
systemProgram: SystemProgram.programId,
|
|
500
|
+
},
|
|
501
|
+
{ action: adminAction },
|
|
502
|
+
)
|
|
555
503
|
}
|
|
556
504
|
|
|
557
|
-
|
|
505
|
+
ixModifyFarm({
|
|
558
506
|
newRate,
|
|
559
507
|
untilTimestamp,
|
|
560
508
|
signer,
|
|
@@ -564,27 +512,26 @@ export class Market {
|
|
|
564
512
|
}: {
|
|
565
513
|
newRate: bigint
|
|
566
514
|
untilTimestamp: number
|
|
567
|
-
signer:
|
|
568
|
-
farmMint:
|
|
569
|
-
farmTokenProgram:
|
|
570
|
-
farmTokenSrc?:
|
|
571
|
-
}) {
|
|
515
|
+
signer: PublicKey
|
|
516
|
+
farmMint: PublicKey
|
|
517
|
+
farmTokenProgram: PublicKey
|
|
518
|
+
farmTokenSrc?: PublicKey
|
|
519
|
+
}): TransactionInstruction {
|
|
572
520
|
const farmTokenSrc = farmTokenSrcParam || getAssociatedTokenAddressSync(farmMint, signer, true, farmTokenProgram)
|
|
573
|
-
|
|
574
521
|
const tokenFarm = getAssociatedTokenAddressSync(farmMint, this.selfAddress, true, farmTokenProgram)
|
|
575
522
|
|
|
576
|
-
return
|
|
577
|
-
|
|
578
|
-
.accountsStrict({
|
|
579
|
-
adminState: getExponentAdminStatePda(),
|
|
523
|
+
return exponentCore.createModifyFarmInstruction(
|
|
524
|
+
{
|
|
580
525
|
market: this.selfAddress,
|
|
581
|
-
mint: farmMint,
|
|
582
|
-
tokenFarm: tokenFarm,
|
|
583
526
|
signer,
|
|
584
|
-
|
|
527
|
+
mint: farmMint,
|
|
528
|
+
adminState: getExponentAdminStatePda(),
|
|
585
529
|
tokenSource: farmTokenSrc,
|
|
586
|
-
|
|
587
|
-
|
|
530
|
+
tokenFarm,
|
|
531
|
+
tokenProgram: farmTokenProgram,
|
|
532
|
+
},
|
|
533
|
+
{ untilTimestamp, newRate },
|
|
534
|
+
)
|
|
588
535
|
}
|
|
589
536
|
|
|
590
537
|
/**
|
|
@@ -596,7 +543,7 @@ export class Market {
|
|
|
596
543
|
*
|
|
597
544
|
* The token accounts themselves are optional, and will be derived from the withdrawer's wallet if not provided
|
|
598
545
|
*/
|
|
599
|
-
|
|
546
|
+
ixWithdrawLiquidity({
|
|
600
547
|
lpIn,
|
|
601
548
|
withdrawer,
|
|
602
549
|
minPtOut,
|
|
@@ -606,12 +553,12 @@ export class Market {
|
|
|
606
553
|
lpSrc: lpSrcParam,
|
|
607
554
|
}: {
|
|
608
555
|
lpIn: bigint
|
|
609
|
-
withdrawer:
|
|
556
|
+
withdrawer: PublicKey
|
|
610
557
|
minPtOut: bigint
|
|
611
558
|
minSyOut: bigint
|
|
612
|
-
ptDst?:
|
|
613
|
-
syDst?:
|
|
614
|
-
lpSrc?:
|
|
559
|
+
ptDst?: PublicKey
|
|
560
|
+
syDst?: PublicKey
|
|
561
|
+
lpSrc?: PublicKey
|
|
615
562
|
}) {
|
|
616
563
|
const ptDst = ptDstParam || getAssociatedTokenAddressSync(this.mintPt, withdrawer, true, TOKEN_PROGRAM_ID)
|
|
617
564
|
const syDst = syDstParam || getAssociatedTokenAddressSync(this.mintSy, withdrawer, true, TOKEN_PROGRAM_ID)
|
|
@@ -623,27 +570,27 @@ export class Market {
|
|
|
623
570
|
|
|
624
571
|
const syRemAccounts = this.cpiAccounts.withdrawSy
|
|
625
572
|
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
-
.accountsStrict({
|
|
573
|
+
const ix = exponentCore.createMarketTwoWithdrawLiquidityInstruction(
|
|
574
|
+
{
|
|
629
575
|
withdrawer,
|
|
630
576
|
market: this.selfAddress,
|
|
631
|
-
mintLp: this.mintLp,
|
|
632
577
|
tokenPtDst: ptDst,
|
|
633
578
|
tokenSyDst: syDst,
|
|
634
|
-
tokenLpSrc: lpSrc,
|
|
635
579
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
636
580
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
581
|
+
tokenLpSrc: lpSrc,
|
|
582
|
+
mintLp: this.mintLp,
|
|
637
583
|
addressLookupTable: this.addressLookupTable,
|
|
638
|
-
syProgram: this.syProgram,
|
|
639
584
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
585
|
+
syProgram: this.syProgram,
|
|
640
586
|
eventAuthority: this.vault.eventAuthority,
|
|
641
|
-
program:
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
|
|
587
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
588
|
+
},
|
|
589
|
+
{ lpIn, minPtOut, minSyOut },
|
|
590
|
+
)
|
|
591
|
+
ix.keys.push(...syRemAccounts)
|
|
645
592
|
|
|
646
|
-
return { ixs: [
|
|
593
|
+
return { ixs: [ix], setupIxs: [ptDstAtaIx, syDstAtaIx, lpSrcAtaIx] }
|
|
647
594
|
}
|
|
648
595
|
|
|
649
596
|
/** Buy PT with SY
|
|
@@ -661,11 +608,11 @@ export class Market {
|
|
|
661
608
|
tokenPt,
|
|
662
609
|
tokenSy,
|
|
663
610
|
}: {
|
|
664
|
-
trader:
|
|
611
|
+
trader: PublicKey
|
|
665
612
|
amountPt: bigint
|
|
666
613
|
maxSySpend: bigint
|
|
667
|
-
tokenPt?:
|
|
668
|
-
tokenSy?:
|
|
614
|
+
tokenPt?: PublicKey
|
|
615
|
+
tokenSy?: PublicKey
|
|
669
616
|
}) {
|
|
670
617
|
return this.ixTradePt({
|
|
671
618
|
trader,
|
|
@@ -692,11 +639,11 @@ export class Market {
|
|
|
692
639
|
tokenPt,
|
|
693
640
|
tokenSy,
|
|
694
641
|
}: {
|
|
695
|
-
trader:
|
|
642
|
+
trader: PublicKey
|
|
696
643
|
amountPt: bigint
|
|
697
644
|
minSyReceive: bigint
|
|
698
|
-
tokenPt?:
|
|
699
|
-
tokenSy?:
|
|
645
|
+
tokenPt?: PublicKey
|
|
646
|
+
tokenSy?: PublicKey
|
|
700
647
|
}) {
|
|
701
648
|
return this.ixTradePt({
|
|
702
649
|
trader,
|
|
@@ -708,7 +655,7 @@ export class Market {
|
|
|
708
655
|
})
|
|
709
656
|
}
|
|
710
657
|
|
|
711
|
-
|
|
658
|
+
ixTradePt({
|
|
712
659
|
trader,
|
|
713
660
|
traderPt,
|
|
714
661
|
syConstraint,
|
|
@@ -716,12 +663,12 @@ export class Market {
|
|
|
716
663
|
tokenPt: tokenPtParam,
|
|
717
664
|
tokenSy: tokenSyParam,
|
|
718
665
|
}: {
|
|
719
|
-
trader:
|
|
666
|
+
trader: PublicKey
|
|
720
667
|
traderPt: bigint
|
|
721
668
|
syConstraint: bigint
|
|
722
669
|
isBuy: boolean
|
|
723
|
-
tokenPt?:
|
|
724
|
-
tokenSy?:
|
|
670
|
+
tokenPt?: PublicKey
|
|
671
|
+
tokenSy?: PublicKey
|
|
725
672
|
}) {
|
|
726
673
|
const tokenPt = tokenPtParam || getAssociatedTokenAddressSync(this.mintPt, trader, true, TOKEN_PROGRAM_ID)
|
|
727
674
|
const tokenSy = tokenSyParam || getAssociatedTokenAddressSync(this.mintSy, trader, true, TOKEN_PROGRAM_ID)
|
|
@@ -735,16 +682,15 @@ export class Market {
|
|
|
735
682
|
...this.cpiAccounts.withdrawSy,
|
|
736
683
|
]
|
|
737
684
|
|
|
738
|
-
const
|
|
739
|
-
const
|
|
685
|
+
const netTraderPt = isBuy ? traderPt : -traderPt
|
|
686
|
+
const syConstraintSigned = isBuy ? -syConstraint : syConstraint
|
|
740
687
|
|
|
741
|
-
const ix =
|
|
742
|
-
|
|
743
|
-
.accountsStrict({
|
|
688
|
+
const ix = exponentCore.createTradePtInstruction(
|
|
689
|
+
{
|
|
744
690
|
trader,
|
|
745
691
|
market: this.selfAddress,
|
|
746
|
-
tokenPtTrader: tokenPt,
|
|
747
692
|
tokenSyTrader: tokenSy,
|
|
693
|
+
tokenPtTrader: tokenPt,
|
|
748
694
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
749
695
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
750
696
|
addressLookupTable: this.addressLookupTable,
|
|
@@ -752,10 +698,11 @@ export class Market {
|
|
|
752
698
|
syProgram: this.syProgram,
|
|
753
699
|
tokenFeeTreasurySy: this.vault.state.treasurySyTokenAccount,
|
|
754
700
|
eventAuthority: this.vault.eventAuthority,
|
|
755
|
-
program:
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
|
|
701
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
702
|
+
},
|
|
703
|
+
{ netTraderPt, syConstraint: syConstraintSigned },
|
|
704
|
+
)
|
|
705
|
+
ix.keys.push(...remainingAccounts)
|
|
759
706
|
|
|
760
707
|
return { ixs: [ix], setupIxs: [tokenPtAtaIx, tokenSyAtaIx] }
|
|
761
708
|
}
|
|
@@ -770,7 +717,7 @@ export class Market {
|
|
|
770
717
|
*
|
|
771
718
|
* The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
|
|
772
719
|
*/
|
|
773
|
-
|
|
720
|
+
ixSellYt({
|
|
774
721
|
trader,
|
|
775
722
|
ytIn,
|
|
776
723
|
minSyOut,
|
|
@@ -778,12 +725,12 @@ export class Market {
|
|
|
778
725
|
ptSrc: ptSrcParam,
|
|
779
726
|
syDst: syDstParam,
|
|
780
727
|
}: {
|
|
781
|
-
trader:
|
|
728
|
+
trader: PublicKey
|
|
782
729
|
ytIn: bigint
|
|
783
730
|
minSyOut: bigint
|
|
784
|
-
ytSrc?:
|
|
785
|
-
ptSrc?:
|
|
786
|
-
syDst?:
|
|
731
|
+
ytSrc?: PublicKey
|
|
732
|
+
ptSrc?: PublicKey
|
|
733
|
+
syDst?: PublicKey
|
|
787
734
|
}) {
|
|
788
735
|
const syDst = syDstParam || getAssociatedTokenAddressSync(this.mintSy, trader, true, TOKEN_PROGRAM_ID)
|
|
789
736
|
const ptSrc = ptSrcParam || getAssociatedTokenAddressSync(this.mintPt, trader, true, TOKEN_PROGRAM_ID)
|
|
@@ -799,11 +746,10 @@ export class Market {
|
|
|
799
746
|
...this.cpiAccounts.depositSy,
|
|
800
747
|
...mergeAccounts.remainingAccounts,
|
|
801
748
|
])
|
|
802
|
-
remainingAccounts.push({ pubkey:
|
|
749
|
+
remainingAccounts.push({ pubkey: exponentCore.EXPONENTCORE_PROGRAM_ID, isWritable: false, isSigner: false })
|
|
803
750
|
|
|
804
|
-
const ix =
|
|
805
|
-
|
|
806
|
-
.accountsStrict({
|
|
751
|
+
const ix = exponentCore.createSellYtInstruction(
|
|
752
|
+
{
|
|
807
753
|
trader,
|
|
808
754
|
market: this.selfAddress,
|
|
809
755
|
tokenYtTrader: ytSrc,
|
|
@@ -812,6 +758,7 @@ export class Market {
|
|
|
812
758
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
813
759
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
814
760
|
addressLookupTable: this.addressLookupTable,
|
|
761
|
+
tokenFeeTreasurySy: this.vault.state.treasurySyTokenAccount,
|
|
815
762
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
816
763
|
vault: mergeAccounts.mainAccounts.vault,
|
|
817
764
|
authorityVault: mergeAccounts.mainAccounts.authority,
|
|
@@ -821,12 +768,12 @@ export class Market {
|
|
|
821
768
|
addressLookupTableVault: mergeAccounts.mainAccounts.addressLookupTable,
|
|
822
769
|
yieldPositionVault: mergeAccounts.mainAccounts.yieldPosition,
|
|
823
770
|
syProgram: this.syProgram,
|
|
824
|
-
tokenFeeTreasurySy: this.vault.state.treasurySyTokenAccount,
|
|
825
771
|
eventAuthority: this.vault.eventAuthority,
|
|
826
|
-
program:
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
|
|
772
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
773
|
+
},
|
|
774
|
+
{ ytIn, minSyOut },
|
|
775
|
+
)
|
|
776
|
+
ix.keys.push(...remainingAccounts)
|
|
830
777
|
|
|
831
778
|
return { ixs: [ix], setupIxs: [syDstAtaIxs, ptSrcAtaIxs, ytSrcAtaIxs] }
|
|
832
779
|
}
|
|
@@ -841,7 +788,7 @@ export class Market {
|
|
|
841
788
|
*
|
|
842
789
|
* The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
|
|
843
790
|
*/
|
|
844
|
-
|
|
791
|
+
ixBuyYt({
|
|
845
792
|
trader,
|
|
846
793
|
ytOut,
|
|
847
794
|
maxSyIn,
|
|
@@ -849,12 +796,12 @@ export class Market {
|
|
|
849
796
|
ptTrader: ptTraderParam,
|
|
850
797
|
syTrader: syTraderParam,
|
|
851
798
|
}: {
|
|
852
|
-
trader:
|
|
799
|
+
trader: PublicKey
|
|
853
800
|
ytOut: bigint
|
|
854
801
|
maxSyIn: bigint
|
|
855
|
-
ytTrader?:
|
|
856
|
-
ptTrader?:
|
|
857
|
-
syTrader?:
|
|
802
|
+
ytTrader?: PublicKey
|
|
803
|
+
ptTrader?: PublicKey
|
|
804
|
+
syTrader?: PublicKey
|
|
858
805
|
}) {
|
|
859
806
|
const syTrader = syTraderParam || getAssociatedTokenAddressSync(this.mintSy, trader, true, TOKEN_PROGRAM_ID)
|
|
860
807
|
const ptTrader = ptTraderParam || getAssociatedTokenAddressSync(this.mintPt, trader, true, TOKEN_PROGRAM_ID)
|
|
@@ -877,126 +824,125 @@ export class Market {
|
|
|
877
824
|
...this.cpiAccounts.depositSy,
|
|
878
825
|
...stripAccounts.remainingAccounts,
|
|
879
826
|
])
|
|
880
|
-
remainingAccounts.push({ pubkey:
|
|
827
|
+
remainingAccounts.push({ pubkey: exponentCore.EXPONENTCORE_PROGRAM_ID, isWritable: false, isSigner: false })
|
|
881
828
|
|
|
882
|
-
const ix =
|
|
883
|
-
|
|
884
|
-
.accountsStrict({
|
|
829
|
+
const ix = exponentCore.createBuyYtInstruction(
|
|
830
|
+
{
|
|
885
831
|
trader,
|
|
886
832
|
market: this.selfAddress,
|
|
833
|
+
tokenSyTrader: syTrader,
|
|
887
834
|
tokenYtTrader: ytTrader,
|
|
888
835
|
tokenPtTrader: ptTrader,
|
|
889
|
-
tokenSyTrader: syTrader,
|
|
890
836
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
891
837
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
892
|
-
|
|
838
|
+
tokenFeeTreasurySy: this.vault.state.treasurySyTokenAccount,
|
|
893
839
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
840
|
+
addressLookupTable: this.addressLookupTable,
|
|
894
841
|
syProgram: this.syProgram,
|
|
895
|
-
vault: stripAccounts.mainAccounts.vault,
|
|
896
842
|
vaultAuthority: stripAccounts.mainAccounts.authority,
|
|
843
|
+
vault: stripAccounts.mainAccounts.vault,
|
|
897
844
|
tokenSyEscrowVault: stripAccounts.mainAccounts.escrowSy,
|
|
898
845
|
mintYt: this.mintYt,
|
|
899
846
|
mintPt: this.mintPt,
|
|
900
847
|
addressLookupTableVault: stripAccounts.mainAccounts.addressLookupTable,
|
|
901
848
|
yieldPosition: stripAccounts.mainAccounts.yieldPosition,
|
|
902
|
-
tokenFeeTreasurySy: this.vault.state.treasurySyTokenAccount,
|
|
903
849
|
eventAuthority: this.vault.eventAuthority,
|
|
904
|
-
program:
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
|
|
850
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
851
|
+
},
|
|
852
|
+
{ syIn: maxSyIn, ytOut },
|
|
853
|
+
)
|
|
854
|
+
ix.keys.push(...remainingAccounts)
|
|
908
855
|
|
|
909
856
|
return { ixs: [ix], setupIxs: [syTraderAtaIx, ptTraderAtaIx, ytTraderAtaIx] }
|
|
910
857
|
}
|
|
911
858
|
|
|
912
|
-
|
|
859
|
+
ixInitLpPosition({ owner, feePayer }: { owner: PublicKey; feePayer?: PublicKey }): TransactionInstruction {
|
|
913
860
|
const lpPosition = this.xponPda.marketLpPosition({ market: this.selfAddress, owner })
|
|
914
|
-
return
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
program: this.coreProgram.programId,
|
|
924
|
-
})
|
|
925
|
-
.instruction()
|
|
861
|
+
return exponentCore.createInitLpPositionInstruction({
|
|
862
|
+
feePayer: feePayer || owner,
|
|
863
|
+
owner,
|
|
864
|
+
market: this.selfAddress,
|
|
865
|
+
lpPosition,
|
|
866
|
+
systemProgram: SystemProgram.programId,
|
|
867
|
+
eventAuthority: this.vault.eventAuthority,
|
|
868
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
869
|
+
})
|
|
926
870
|
}
|
|
927
871
|
|
|
928
872
|
/** Deposit LP tokens into the farming module to earn rewards */
|
|
929
|
-
|
|
873
|
+
ixDepositLp({
|
|
930
874
|
owner,
|
|
931
875
|
amount,
|
|
932
876
|
lpSrc: lpSrcParam,
|
|
933
877
|
}: {
|
|
934
|
-
owner:
|
|
878
|
+
owner: PublicKey
|
|
935
879
|
amount: bigint
|
|
936
|
-
lpSrc?:
|
|
937
|
-
}) {
|
|
880
|
+
lpSrc?: PublicKey
|
|
881
|
+
}): TransactionInstruction {
|
|
938
882
|
const lpSrc = lpSrcParam || getAssociatedTokenAddressSync(this.mintLp, owner, true, TOKEN_PROGRAM_ID)
|
|
939
883
|
const lpPosition = this.xponPda.marketLpPosition({ market: this.selfAddress, owner })
|
|
940
884
|
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
.accountsStrict({
|
|
885
|
+
const ix = exponentCore.createMarketDepositLpInstruction(
|
|
886
|
+
{
|
|
944
887
|
owner,
|
|
888
|
+
market: this.selfAddress,
|
|
945
889
|
lpPosition,
|
|
946
890
|
tokenLpSrc: lpSrc,
|
|
947
891
|
tokenLpEscrow: this.tokenLpEscrow,
|
|
948
|
-
|
|
949
|
-
addressLookupTable: this.addressLookupTable,
|
|
892
|
+
mintLp: this.mintLp,
|
|
950
893
|
syProgram: this.syProgram,
|
|
894
|
+
addressLookupTable: this.addressLookupTable,
|
|
951
895
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
952
|
-
|
|
953
|
-
systemProgram: web3.SystemProgram.programId,
|
|
896
|
+
systemProgram: SystemProgram.programId,
|
|
954
897
|
eventAuthority: this.vault.eventAuthority,
|
|
955
|
-
program:
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
|
|
898
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
899
|
+
},
|
|
900
|
+
{ amount },
|
|
901
|
+
)
|
|
902
|
+
ix.keys.push(...this.cpiAccounts.getPositionState)
|
|
903
|
+
return ix
|
|
959
904
|
}
|
|
960
905
|
|
|
961
906
|
/** Withdraw LP tokens from the farming module */
|
|
962
|
-
|
|
907
|
+
ixWithdrawLp({
|
|
963
908
|
owner,
|
|
964
909
|
amount,
|
|
965
910
|
lpDst: lpDstParam,
|
|
966
911
|
}: {
|
|
967
|
-
owner:
|
|
912
|
+
owner: PublicKey
|
|
968
913
|
amount: bigint
|
|
969
|
-
lpDst?:
|
|
970
|
-
}) {
|
|
914
|
+
lpDst?: PublicKey
|
|
915
|
+
}): TransactionInstruction {
|
|
971
916
|
const lpDst = lpDstParam || getAssociatedTokenAddressSync(this.mintLp, owner, true, TOKEN_PROGRAM_ID)
|
|
972
917
|
|
|
973
918
|
const lpPosition = this.xponPda.marketLpPosition({ market: this.selfAddress, owner })
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
.accountsStrict({
|
|
919
|
+
const ix = exponentCore.createMarketWithdrawLpInstruction(
|
|
920
|
+
{
|
|
977
921
|
owner,
|
|
922
|
+
market: this.selfAddress,
|
|
923
|
+
mintLp: this.mintLp,
|
|
978
924
|
lpPosition,
|
|
979
925
|
tokenLpDst: lpDst,
|
|
980
926
|
tokenLpEscrow: this.tokenLpEscrow,
|
|
981
|
-
market: this.selfAddress,
|
|
982
|
-
addressLookupTable: this.addressLookupTable,
|
|
983
|
-
mintLp: this.mintLp,
|
|
984
927
|
syProgram: this.syProgram,
|
|
928
|
+
addressLookupTable: this.addressLookupTable,
|
|
985
929
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
986
|
-
systemProgram:
|
|
930
|
+
systemProgram: SystemProgram.programId,
|
|
987
931
|
eventAuthority: this.vault.eventAuthority,
|
|
988
|
-
program:
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
|
|
932
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
933
|
+
},
|
|
934
|
+
{ amount },
|
|
935
|
+
)
|
|
936
|
+
ix.keys.push(...this.cpiAccounts.getPositionState)
|
|
937
|
+
return ix
|
|
992
938
|
}
|
|
993
939
|
|
|
994
940
|
async ixWrapperCollectInterest({
|
|
995
941
|
claimer,
|
|
996
942
|
tokenSyDst: tokenSyDstParam,
|
|
997
943
|
}: {
|
|
998
|
-
claimer:
|
|
999
|
-
tokenSyDst?:
|
|
944
|
+
claimer: PublicKey
|
|
945
|
+
tokenSyDst?: PublicKey
|
|
1000
946
|
}) {
|
|
1001
947
|
const yieldPosition = this.xponPda.yieldPosition({ owner: claimer, vault: this.vault.selfAddress })
|
|
1002
948
|
const tokenSyDst = tokenSyDstParam || getAssociatedTokenAddressSync(this.mintSy, claimer, true, TOKEN_PROGRAM_ID)
|
|
@@ -1034,24 +980,24 @@ export class Market {
|
|
|
1034
980
|
redeemerSyTokenAccount: tokenSyDst,
|
|
1035
981
|
})
|
|
1036
982
|
|
|
1037
|
-
const ix =
|
|
1038
|
-
|
|
1039
|
-
.accountsStrict({
|
|
1040
|
-
addressLookupTable: this.vault.addressLookupTable,
|
|
1041
|
-
authority: this.vault.state.authority,
|
|
983
|
+
const ix = exponentCore.createWrapperCollectInterestInstruction(
|
|
984
|
+
{
|
|
1042
985
|
claimer,
|
|
986
|
+
authority: this.vault.state.authority,
|
|
987
|
+
vault: this.vault.selfAddress,
|
|
988
|
+
addressLookupTable: this.vault.addressLookupTable,
|
|
1043
989
|
escrowSy: this.vault.escrowSy,
|
|
1044
990
|
syProgram: this.syProgram,
|
|
1045
|
-
vault: this.vault.selfAddress,
|
|
1046
991
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1047
|
-
|
|
1048
|
-
yieldPosition: yieldPosition,
|
|
992
|
+
yieldPosition,
|
|
1049
993
|
tokenSyDst,
|
|
994
|
+
treasurySyTokenAccount: this.vault.state.treasurySyTokenAccount,
|
|
1050
995
|
eventAuthority: this.vault.eventAuthority,
|
|
1051
|
-
program:
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
|
|
996
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
997
|
+
},
|
|
998
|
+
{ redeemSyAccountsLength: redeemSyIx.keys.length },
|
|
999
|
+
)
|
|
1000
|
+
ix.keys.push(...redeemSyIx.keys.concat(remainingAccounts))
|
|
1055
1001
|
|
|
1056
1002
|
return {
|
|
1057
1003
|
ixs: [
|
|
@@ -1071,12 +1017,12 @@ export class Market {
|
|
|
1071
1017
|
tokenPtTrader: tokenPtTraderParam,
|
|
1072
1018
|
tokenBaseTrader: tokenBaseTraderParam,
|
|
1073
1019
|
}: {
|
|
1074
|
-
owner:
|
|
1020
|
+
owner: PublicKey
|
|
1075
1021
|
ptOut: bigint
|
|
1076
1022
|
maxBaseIn: bigint
|
|
1077
|
-
tokenSyTrader?:
|
|
1078
|
-
tokenPtTrader?:
|
|
1079
|
-
tokenBaseTrader?:
|
|
1023
|
+
tokenSyTrader?: PublicKey
|
|
1024
|
+
tokenPtTrader?: PublicKey
|
|
1025
|
+
tokenBaseTrader?: PublicKey
|
|
1080
1026
|
}) {
|
|
1081
1027
|
const tokenSyTrader =
|
|
1082
1028
|
tokenSyTraderParam || getAssociatedTokenAddressSync(this.mintSy, owner, true, TOKEN_PROGRAM_ID)
|
|
@@ -1115,10 +1061,8 @@ export class Market {
|
|
|
1115
1061
|
|
|
1116
1062
|
const mintSyRemAccounts = mintSyIx.keys
|
|
1117
1063
|
|
|
1118
|
-
// console.log("mintSyRemAccounts", mintSyRemAccounts)
|
|
1119
|
-
|
|
1120
1064
|
mintSyRemAccounts.push({
|
|
1121
|
-
pubkey:
|
|
1065
|
+
pubkey: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1122
1066
|
isWritable: false,
|
|
1123
1067
|
isSigner: false,
|
|
1124
1068
|
})
|
|
@@ -1126,27 +1070,26 @@ export class Market {
|
|
|
1126
1070
|
const remainingAccounts = uniqueRemainingAccounts([
|
|
1127
1071
|
...this.cpiAccounts.getSyState,
|
|
1128
1072
|
...this.cpiAccounts.depositSy,
|
|
1129
|
-
// ...this.cpiAccounts.withdrawSy,
|
|
1130
1073
|
])
|
|
1131
1074
|
|
|
1132
|
-
const ix =
|
|
1133
|
-
|
|
1134
|
-
.accountsStrict({
|
|
1135
|
-
addressLookupTable: this.addressLookupTable,
|
|
1075
|
+
const ix = exponentCore.createWrapperBuyPtInstruction(
|
|
1076
|
+
{
|
|
1136
1077
|
buyer: owner,
|
|
1137
1078
|
market: this.selfAddress,
|
|
1138
1079
|
tokenSyTrader,
|
|
1139
1080
|
tokenPtTrader,
|
|
1140
1081
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1141
1082
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1083
|
+
addressLookupTable: this.addressLookupTable,
|
|
1142
1084
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1143
1085
|
syProgram: this.syProgram,
|
|
1144
1086
|
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1145
1087
|
eventAuthority: this.vault.eventAuthority,
|
|
1146
|
-
program:
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
|
|
1088
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1089
|
+
},
|
|
1090
|
+
{ ptAmount: ptOut, maxBaseAmount: maxBaseIn, mintSyRemAccountsUntil: mintSyRemAccounts.length - 1 },
|
|
1091
|
+
)
|
|
1092
|
+
ix.keys.push(...mintSyRemAccounts.concat(remainingAccounts))
|
|
1150
1093
|
|
|
1151
1094
|
return {
|
|
1152
1095
|
ixs: [...(await this.flavor.preIxs({ signer: owner })), ix, ...(await this.flavor.postIxs({ signer: owner }))],
|
|
@@ -1162,12 +1105,12 @@ export class Market {
|
|
|
1162
1105
|
tokenPtTrader: tokenPtTraderParam,
|
|
1163
1106
|
tokenBaseTrader: tokenBaseTraderParam,
|
|
1164
1107
|
}: {
|
|
1165
|
-
owner:
|
|
1108
|
+
owner: PublicKey
|
|
1166
1109
|
amount: bigint
|
|
1167
1110
|
minBaseOut: bigint
|
|
1168
|
-
tokenSyTrader?:
|
|
1169
|
-
tokenPtTrader?:
|
|
1170
|
-
tokenBaseTrader?:
|
|
1111
|
+
tokenSyTrader?: PublicKey
|
|
1112
|
+
tokenPtTrader?: PublicKey
|
|
1113
|
+
tokenBaseTrader?: PublicKey
|
|
1171
1114
|
}) {
|
|
1172
1115
|
const tokenSyTrader =
|
|
1173
1116
|
tokenSyTraderParam || getAssociatedTokenAddressSync(this.mintSy, owner, true, TOKEN_PROGRAM_ID)
|
|
@@ -1208,24 +1151,24 @@ export class Market {
|
|
|
1208
1151
|
|
|
1209
1152
|
const remainingAccounts = uniqueRemainingAccounts([...this.cpiAccounts.getSyState, ...this.cpiAccounts.withdrawSy])
|
|
1210
1153
|
|
|
1211
|
-
const ix =
|
|
1212
|
-
|
|
1213
|
-
.accountsStrict({
|
|
1154
|
+
const ix = exponentCore.createWrapperSellPtInstruction(
|
|
1155
|
+
{
|
|
1214
1156
|
seller: owner,
|
|
1215
1157
|
market: this.selfAddress,
|
|
1158
|
+
tokenSyTrader,
|
|
1216
1159
|
tokenPtTrader,
|
|
1160
|
+
tokenSyEscrow: this.tokenSyEscrow,
|
|
1161
|
+
tokenPtEscrow: this.tokenPtEscrow,
|
|
1217
1162
|
addressLookupTable: this.addressLookupTable,
|
|
1218
1163
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1219
1164
|
syProgram: this.syProgram,
|
|
1220
|
-
tokenSyTrader,
|
|
1221
|
-
tokenPtEscrow: this.tokenPtEscrow,
|
|
1222
|
-
tokenSyEscrow: this.tokenSyEscrow,
|
|
1223
1165
|
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1224
1166
|
eventAuthority: this.vault.eventAuthority,
|
|
1225
|
-
program:
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
|
|
1167
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1168
|
+
},
|
|
1169
|
+
{ amountPt: amount, minBaseAmount: minBaseOut, redeemSyRemAccountsUntil: redeemSyRemAccounts.length },
|
|
1170
|
+
)
|
|
1171
|
+
ix.keys.push(...redeemSyRemAccounts.concat(remainingAccounts))
|
|
1229
1172
|
|
|
1230
1173
|
return {
|
|
1231
1174
|
ixs: [...(await this.flavor.preIxs({ signer: owner })), ix, ...(await this.flavor.postIxs({ signer: owner }))],
|
|
@@ -1242,13 +1185,13 @@ export class Market {
|
|
|
1242
1185
|
tokenYtTrader: tokenYtTraderParam,
|
|
1243
1186
|
tokenBaseTrader: tokenBaseTraderParam,
|
|
1244
1187
|
}: {
|
|
1245
|
-
owner:
|
|
1188
|
+
owner: PublicKey
|
|
1246
1189
|
ytOut: bigint
|
|
1247
1190
|
maxBaseIn: bigint
|
|
1248
|
-
tokenSyTrader?:
|
|
1249
|
-
tokenPtTrader?:
|
|
1250
|
-
tokenYtTrader?:
|
|
1251
|
-
tokenBaseTrader?:
|
|
1191
|
+
tokenSyTrader?: PublicKey
|
|
1192
|
+
tokenPtTrader?: PublicKey
|
|
1193
|
+
tokenYtTrader?: PublicKey
|
|
1194
|
+
tokenBaseTrader?: PublicKey
|
|
1252
1195
|
}) {
|
|
1253
1196
|
const tokenSyTrader =
|
|
1254
1197
|
tokenSyTraderParam || getAssociatedTokenAddressSync(this.mintSy, owner, true, TOKEN_PROGRAM_ID)
|
|
@@ -1298,9 +1241,8 @@ export class Market {
|
|
|
1298
1241
|
|
|
1299
1242
|
const allRemainingAccounts = mintSyRemAccounts.concat(remainingAccounts)
|
|
1300
1243
|
|
|
1301
|
-
const ix1 =
|
|
1302
|
-
|
|
1303
|
-
.accountsStrict({
|
|
1244
|
+
const ix1 = exponentCore.createWrapperBuyYtInstruction(
|
|
1245
|
+
{
|
|
1304
1246
|
buyer: owner,
|
|
1305
1247
|
market: this.selfAddress,
|
|
1306
1248
|
tokenSyTrader,
|
|
@@ -1309,24 +1251,25 @@ export class Market {
|
|
|
1309
1251
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1310
1252
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1311
1253
|
marketAddressLookupTable: this.addressLookupTable,
|
|
1312
|
-
vault: this.vault.selfAddress,
|
|
1313
|
-
vaultAuthority: this.vault.authority,
|
|
1314
|
-
tokenSyEscrowVault: this.vault.escrowSy,
|
|
1315
|
-
vaultAddressLookupTable: this.vault.addressLookupTable,
|
|
1316
1254
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1317
1255
|
syProgram: this.syProgram,
|
|
1256
|
+
vaultAuthority: this.vault.authority,
|
|
1257
|
+
vault: this.vault.selfAddress,
|
|
1258
|
+
tokenSyEscrowVault: this.vault.escrowSy,
|
|
1259
|
+
mintYt: this.vault.mintYt,
|
|
1318
1260
|
mintPt: this.vault.mintPt,
|
|
1261
|
+
vaultAddressLookupTable: this.vault.addressLookupTable,
|
|
1262
|
+
userYieldPosition: this.xponPda.yieldPosition({ vault: this.vault.selfAddress, owner }),
|
|
1319
1263
|
yieldPosition: this.vault.state.yieldPositonAddress,
|
|
1320
|
-
mintYt: this.vault.mintYt,
|
|
1321
1264
|
escrowYt: this.vault.escrowYt,
|
|
1322
|
-
systemProgram:
|
|
1323
|
-
userYieldPosition: this.xponPda.yieldPosition({ vault: this.vault.selfAddress, owner }),
|
|
1265
|
+
systemProgram: SystemProgram.programId,
|
|
1324
1266
|
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1325
1267
|
eventAuthority: this.vault.eventAuthority,
|
|
1326
|
-
program:
|
|
1327
|
-
}
|
|
1328
|
-
.
|
|
1329
|
-
|
|
1268
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1269
|
+
},
|
|
1270
|
+
{ ytOut, maxBaseAmount: maxBaseIn, mintSyAccountsLength: mintSyRemAccounts.length },
|
|
1271
|
+
)
|
|
1272
|
+
ix1.keys.push(...allRemainingAccounts)
|
|
1330
1273
|
|
|
1331
1274
|
return {
|
|
1332
1275
|
ixs: [...(await this.flavor.preIxs({ signer: owner })), ix1, ...(await this.flavor.postIxs({ signer: owner }))],
|
|
@@ -1343,13 +1286,13 @@ export class Market {
|
|
|
1343
1286
|
tokenYtTrader: tokenYtTraderParam,
|
|
1344
1287
|
tokenPtTrader: tokenPtTraderParam,
|
|
1345
1288
|
}: {
|
|
1346
|
-
owner:
|
|
1289
|
+
owner: PublicKey
|
|
1347
1290
|
amount: bigint
|
|
1348
1291
|
minBaseOut: bigint
|
|
1349
|
-
tokenBaseTrader?:
|
|
1350
|
-
tokenSyTrader?:
|
|
1351
|
-
tokenYtTrader?:
|
|
1352
|
-
tokenPtTrader?:
|
|
1292
|
+
tokenBaseTrader?: PublicKey
|
|
1293
|
+
tokenSyTrader?: PublicKey
|
|
1294
|
+
tokenYtTrader?: PublicKey
|
|
1295
|
+
tokenPtTrader?: PublicKey
|
|
1353
1296
|
}) {
|
|
1354
1297
|
const tokenBaseTrader =
|
|
1355
1298
|
tokenBaseTraderParam ||
|
|
@@ -1402,60 +1345,52 @@ export class Market {
|
|
|
1402
1345
|
...this.vault.cpiAccounts.depositSy,
|
|
1403
1346
|
])
|
|
1404
1347
|
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
// isSigner: false,
|
|
1411
|
-
// })
|
|
1412
|
-
|
|
1413
|
-
const ix1 = await this.coreProgram.methods
|
|
1414
|
-
.withdrawYt(new BN(amount.toString()))
|
|
1415
|
-
.accountsStrict({
|
|
1348
|
+
const ix1 = exponentCore.createWithdrawYtInstruction(
|
|
1349
|
+
{
|
|
1350
|
+
owner,
|
|
1351
|
+
vault: this.vault.selfAddress,
|
|
1352
|
+
userYieldPosition: this.xponPda.yieldPosition({ vault: this.vault.selfAddress, owner }),
|
|
1416
1353
|
ytDst: tokenYtTrader,
|
|
1417
1354
|
escrowYt: this.vault.escrowYt,
|
|
1418
1355
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1356
|
+
authority: this.vault.authority,
|
|
1419
1357
|
syProgram: this.syProgram,
|
|
1420
1358
|
addressLookupTable: this.vault.addressLookupTable,
|
|
1421
|
-
systemProgram: web3.SystemProgram.programId,
|
|
1422
|
-
eventAuthority: this.vault.eventAuthority,
|
|
1423
|
-
program: this.coreProgram.programId,
|
|
1424
1359
|
yieldPosition: this.vault.state.yieldPositonAddress,
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
|
|
1360
|
+
systemProgram: SystemProgram.programId,
|
|
1361
|
+
eventAuthority: this.vault.eventAuthority,
|
|
1362
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1363
|
+
},
|
|
1364
|
+
{ amount },
|
|
1365
|
+
)
|
|
1366
|
+
ix1.keys.push(...remainingAccounts)
|
|
1432
1367
|
|
|
1433
|
-
const ix2 =
|
|
1434
|
-
|
|
1435
|
-
.accountsStrict({
|
|
1368
|
+
const ix2 = exponentCore.createWrapperSellYtInstruction(
|
|
1369
|
+
{
|
|
1436
1370
|
seller: owner,
|
|
1437
1371
|
market: this.selfAddress,
|
|
1372
|
+
tokenSyTrader,
|
|
1438
1373
|
tokenYtTrader,
|
|
1439
|
-
marketAddressLookupTable: this.addressLookupTable,
|
|
1440
|
-
vault: this.vault.selfAddress,
|
|
1441
|
-
vaultAuthority: this.vault.authority,
|
|
1442
1374
|
tokenPtTrader,
|
|
1375
|
+
tokenSyEscrow: this.tokenSyEscrow,
|
|
1443
1376
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1377
|
+
marketAddressLookupTable: this.addressLookupTable,
|
|
1378
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1379
|
+
syProgram: this.syProgram,
|
|
1380
|
+
vaultAuthority: this.vault.authority,
|
|
1381
|
+
vault: this.vault.selfAddress,
|
|
1444
1382
|
tokenSyEscrowVault: this.vault.escrowSy,
|
|
1383
|
+
mintYt: this.vault.mintYt,
|
|
1384
|
+
mintPt: this.vault.mintPt,
|
|
1445
1385
|
vaultAddressLookupTable: this.vault.addressLookupTable,
|
|
1446
1386
|
yieldPosition: this.vault.state.yieldPositonAddress,
|
|
1447
|
-
mintPt: this.vault.mintPt,
|
|
1448
|
-
mintYt: this.vault.mintYt,
|
|
1449
|
-
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1450
|
-
syProgram: this.syProgram,
|
|
1451
|
-
tokenSyTrader,
|
|
1452
|
-
tokenSyEscrow: this.tokenSyEscrow,
|
|
1453
1387
|
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1454
1388
|
eventAuthority: this.vault.eventAuthority,
|
|
1455
|
-
program:
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
|
|
1389
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1390
|
+
},
|
|
1391
|
+
{ ytAmount: amount, minBaseAmount: minBaseOut, redeemSyAccountsUntil: redeemSyRemAccounts.length },
|
|
1392
|
+
)
|
|
1393
|
+
ix2.keys.push(...redeemSyRemAccounts.concat(remainingAccounts))
|
|
1459
1394
|
|
|
1460
1395
|
return {
|
|
1461
1396
|
ixs: [
|
|
@@ -1468,14 +1403,14 @@ export class Market {
|
|
|
1468
1403
|
}
|
|
1469
1404
|
}
|
|
1470
1405
|
|
|
1471
|
-
|
|
1406
|
+
ixCollectMarketEmission({
|
|
1472
1407
|
owner,
|
|
1473
1408
|
emissionIndex,
|
|
1474
1409
|
emissionDst,
|
|
1475
1410
|
}: {
|
|
1476
|
-
owner:
|
|
1411
|
+
owner: PublicKey
|
|
1477
1412
|
emissionIndex: number
|
|
1478
|
-
emissionDst?:
|
|
1413
|
+
emissionDst?: PublicKey
|
|
1479
1414
|
}) {
|
|
1480
1415
|
const emission = this.emissions[emissionIndex]
|
|
1481
1416
|
const tokenEmissionDst =
|
|
@@ -1487,22 +1422,22 @@ export class Market {
|
|
|
1487
1422
|
owner,
|
|
1488
1423
|
emission.mint,
|
|
1489
1424
|
)
|
|
1490
|
-
const ix =
|
|
1491
|
-
|
|
1492
|
-
.accountsStrict({
|
|
1493
|
-
addressLookupTable: this.addressLookupTable,
|
|
1494
|
-
lpPosition: this.xponPda.marketLpPosition({ market: this.selfAddress, owner }),
|
|
1495
|
-
market: this.selfAddress,
|
|
1425
|
+
const ix = exponentCore.createMarketCollectEmissionInstruction(
|
|
1426
|
+
{
|
|
1496
1427
|
owner,
|
|
1497
|
-
|
|
1498
|
-
|
|
1428
|
+
market: this.selfAddress,
|
|
1429
|
+
lpPosition: this.xponPda.marketLpPosition({ market: this.selfAddress, owner }),
|
|
1499
1430
|
tokenEmissionEscrow: this.marketEmissions.trackers[emissionIndex].tokenEscrow,
|
|
1431
|
+
tokenEmissionDst,
|
|
1500
1432
|
tokenProgram: emission.tokenProgramAddress,
|
|
1501
|
-
|
|
1433
|
+
addressLookupTable: this.addressLookupTable,
|
|
1434
|
+
syProgram: this.syProgram,
|
|
1502
1435
|
eventAuthority: this.eventAuthority,
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1436
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1437
|
+
},
|
|
1438
|
+
{ emissionIndex },
|
|
1439
|
+
)
|
|
1440
|
+
ix.keys.push(...this.cpiAccounts.claimEmission[emissionIndex])
|
|
1506
1441
|
|
|
1507
1442
|
return {
|
|
1508
1443
|
ixs: [ix],
|
|
@@ -1521,14 +1456,14 @@ export class Market {
|
|
|
1521
1456
|
tokenBaseDepositor: tokenBaseDepositorParam,
|
|
1522
1457
|
tokenLpDepositor: tokenLpDepositorParam,
|
|
1523
1458
|
}: {
|
|
1524
|
-
depositor:
|
|
1459
|
+
depositor: PublicKey
|
|
1525
1460
|
amountBase: bigint
|
|
1526
1461
|
minLpOut: bigint
|
|
1527
|
-
tokenSyDepositor?:
|
|
1528
|
-
tokenYtDepositor?:
|
|
1529
|
-
tokenPtDepositor?:
|
|
1530
|
-
tokenBaseDepositor?:
|
|
1531
|
-
tokenLpDepositor?:
|
|
1462
|
+
tokenSyDepositor?: PublicKey
|
|
1463
|
+
tokenYtDepositor?: PublicKey
|
|
1464
|
+
tokenPtDepositor?: PublicKey
|
|
1465
|
+
tokenBaseDepositor?: PublicKey
|
|
1466
|
+
tokenLpDepositor?: PublicKey
|
|
1532
1467
|
}) {
|
|
1533
1468
|
const tokenSyDepositor =
|
|
1534
1469
|
tokenSyDepositorParam || getAssociatedTokenAddressSync(this.mintSy, depositor, true, TOKEN_PROGRAM_ID)
|
|
@@ -1570,8 +1505,7 @@ export class Market {
|
|
|
1570
1505
|
this.mintLp,
|
|
1571
1506
|
)
|
|
1572
1507
|
|
|
1573
|
-
|
|
1574
|
-
const minLpOutBn = new BN(minLpOut.toString())
|
|
1508
|
+
// amountBase and minLpOut are already bigint
|
|
1575
1509
|
|
|
1576
1510
|
// TODO - fix this
|
|
1577
1511
|
const mintSyIx = await this.flavor.ixMintSy({
|
|
@@ -1604,7 +1538,7 @@ export class Market {
|
|
|
1604
1538
|
const marketCpiRemainingAccounts = beforeMarketAccounts.filter(
|
|
1605
1539
|
(account) =>
|
|
1606
1540
|
account.pubkey.toBase58() !== TOKEN_PROGRAM_ID.toBase58() &&
|
|
1607
|
-
account.pubkey.toBase58() !==
|
|
1541
|
+
account.pubkey.toBase58() !== SystemProgram.programId.toBase58() &&
|
|
1608
1542
|
account.pubkey.toBase58() !== this.selfAddress.toBase58(),
|
|
1609
1543
|
)
|
|
1610
1544
|
|
|
@@ -1621,9 +1555,8 @@ export class Market {
|
|
|
1621
1555
|
|
|
1622
1556
|
const lpPosition = this.xponPda.marketLpPosition({ market: this.selfAddress, owner: depositor })
|
|
1623
1557
|
|
|
1624
|
-
const ix =
|
|
1625
|
-
|
|
1626
|
-
.accountsStrict({
|
|
1558
|
+
const ix = exponentCore.createWrapperProvideLiquidityInstruction(
|
|
1559
|
+
{
|
|
1627
1560
|
depositor,
|
|
1628
1561
|
authority: this.vault.authority,
|
|
1629
1562
|
vault: this.vault.selfAddress,
|
|
@@ -1632,29 +1565,28 @@ export class Market {
|
|
|
1632
1565
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1633
1566
|
tokenLpDst: tokenLpDepositor,
|
|
1634
1567
|
mintLp: this.mintLp,
|
|
1635
|
-
escrowSy: this.vault.escrowSy,
|
|
1636
|
-
escrowYt: this.vault.escrowYt,
|
|
1637
1568
|
tokenSyDepositor,
|
|
1569
|
+
escrowSy: this.vault.escrowSy,
|
|
1638
1570
|
tokenYtDepositor,
|
|
1639
1571
|
tokenPtDepositor,
|
|
1640
1572
|
mintYt: this.vault.mintYt,
|
|
1641
1573
|
mintPt: this.vault.mintPt,
|
|
1642
|
-
userYieldPosition: this.xponPda.yieldPosition({ vault: this.vault.selfAddress, owner: depositor }),
|
|
1643
|
-
systemProgram: web3.SystemProgram.programId,
|
|
1644
1574
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1645
|
-
syProgram: this.syProgram,
|
|
1646
|
-
marketAddressLookupTable: this.addressLookupTable,
|
|
1647
1575
|
vaultAddressLookupTable: this.vault.addressLookupTable,
|
|
1576
|
+
marketAddressLookupTable: this.addressLookupTable,
|
|
1577
|
+
syProgram: this.syProgram,
|
|
1578
|
+
userYieldPosition: this.xponPda.yieldPosition({ vault: this.vault.selfAddress, owner: depositor }),
|
|
1579
|
+
escrowYt: this.vault.escrowYt,
|
|
1580
|
+
tokenLpEscrow: this.tokenLpEscrow,
|
|
1581
|
+
lpPosition,
|
|
1648
1582
|
vaultRobotYieldPosition: this.vault.state.yieldPositonAddress,
|
|
1583
|
+
systemProgram: SystemProgram.programId,
|
|
1649
1584
|
eventAuthority: this.vault.eventAuthority,
|
|
1650
|
-
program:
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
.instruction()
|
|
1656
|
-
|
|
1657
|
-
// console.log("ix accounts length", ix.keys.length)
|
|
1585
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1586
|
+
},
|
|
1587
|
+
{ amountBase, minLpOut, mintBaseAccountsUntil: mintSyRemAccounts.length },
|
|
1588
|
+
)
|
|
1589
|
+
ix.keys.push(...allRemainingAccounts)
|
|
1658
1590
|
|
|
1659
1591
|
return {
|
|
1660
1592
|
ixs: [
|
|
@@ -1678,16 +1610,16 @@ export class Market {
|
|
|
1678
1610
|
tokenBaseDepositor: tokenBaseDepositorParam,
|
|
1679
1611
|
tokenLpDepositor: tokenLpDepositorParam,
|
|
1680
1612
|
}: {
|
|
1681
|
-
depositor:
|
|
1613
|
+
depositor: PublicKey
|
|
1682
1614
|
amountBase: bigint
|
|
1683
1615
|
minLpOut: bigint
|
|
1684
1616
|
externalPtToBuy: bigint
|
|
1685
1617
|
externalSyConstraint: bigint
|
|
1686
|
-
tokenSyDepositor?:
|
|
1687
|
-
tokenYtDepositor?:
|
|
1688
|
-
tokenPtDepositor?:
|
|
1689
|
-
tokenBaseDepositor?:
|
|
1690
|
-
tokenLpDepositor?:
|
|
1618
|
+
tokenSyDepositor?: PublicKey
|
|
1619
|
+
tokenYtDepositor?: PublicKey
|
|
1620
|
+
tokenPtDepositor?: PublicKey
|
|
1621
|
+
tokenBaseDepositor?: PublicKey
|
|
1622
|
+
tokenLpDepositor?: PublicKey
|
|
1691
1623
|
}) {
|
|
1692
1624
|
const tokenSyDepositor =
|
|
1693
1625
|
tokenSyDepositorParam || getAssociatedTokenAddressSync(this.mintSy, depositor, true, TOKEN_PROGRAM_ID)
|
|
@@ -1749,35 +1681,29 @@ export class Market {
|
|
|
1749
1681
|
|
|
1750
1682
|
const mintSyRemAccounts = mintSyIx.keys
|
|
1751
1683
|
|
|
1752
|
-
const ix =
|
|
1753
|
-
|
|
1754
|
-
new BN(amountBase.toString()),
|
|
1755
|
-
new BN(minLpOut.toString()),
|
|
1756
|
-
mintSyRemAccounts.length,
|
|
1757
|
-
new BN(externalPtToBuy.toString()),
|
|
1758
|
-
new BN(externalSyConstraint.toString()),
|
|
1759
|
-
)
|
|
1760
|
-
.accountsStrict({
|
|
1684
|
+
const ix = exponentCore.createWrapperProvideLiquidityBaseInstruction(
|
|
1685
|
+
{
|
|
1761
1686
|
depositor,
|
|
1762
|
-
lpPosition,
|
|
1763
1687
|
market: this.selfAddress,
|
|
1764
1688
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1765
1689
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1766
1690
|
tokenLpDst: tokenLpDepositor,
|
|
1767
1691
|
mintLp: this.mintLp,
|
|
1692
|
+
tokenSyDepositor,
|
|
1693
|
+
tokenPtDepositor,
|
|
1694
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1695
|
+
marketAddressLookupTable: this.addressLookupTable,
|
|
1768
1696
|
syProgram: this.syProgram,
|
|
1769
1697
|
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1770
1698
|
tokenLpEscrow: this.tokenLpEscrow,
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
tokenPtDepositor,
|
|
1774
|
-
tokenSyDepositor,
|
|
1775
|
-
systemProgram: web3.SystemProgram.programId,
|
|
1699
|
+
lpPosition,
|
|
1700
|
+
systemProgram: SystemProgram.programId,
|
|
1776
1701
|
eventAuthority: this.vault.eventAuthority,
|
|
1777
|
-
program:
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
|
-
|
|
1702
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1703
|
+
},
|
|
1704
|
+
{ amountBase, minLpOut, mintSyAccountsUntil: mintSyRemAccounts.length, externalPtToBuy, externalSyConstraint },
|
|
1705
|
+
)
|
|
1706
|
+
ix.keys.push(...mintSyRemAccounts.concat(remainingAccounts))
|
|
1781
1707
|
|
|
1782
1708
|
return {
|
|
1783
1709
|
ixs: [
|
|
@@ -1800,15 +1726,15 @@ export class Market {
|
|
|
1800
1726
|
tokenBaseDepositor: tokenBaseDepositorParam,
|
|
1801
1727
|
tokenLpDepositor: tokenLpDepositorParam,
|
|
1802
1728
|
}: {
|
|
1803
|
-
depositor:
|
|
1729
|
+
depositor: PublicKey
|
|
1804
1730
|
amountBase: bigint
|
|
1805
1731
|
amountPt: bigint
|
|
1806
1732
|
minLpOut: bigint
|
|
1807
|
-
tokenSyDepositor?:
|
|
1808
|
-
tokenYtDepositor?:
|
|
1809
|
-
tokenPtDepositor?:
|
|
1810
|
-
tokenBaseDepositor?:
|
|
1811
|
-
tokenLpDepositor?:
|
|
1733
|
+
tokenSyDepositor?: PublicKey
|
|
1734
|
+
tokenYtDepositor?: PublicKey
|
|
1735
|
+
tokenPtDepositor?: PublicKey
|
|
1736
|
+
tokenBaseDepositor?: PublicKey
|
|
1737
|
+
tokenLpDepositor?: PublicKey
|
|
1812
1738
|
}) {
|
|
1813
1739
|
const tokenSyDepositor =
|
|
1814
1740
|
tokenSyDepositorParam || getAssociatedTokenAddressSync(this.mintSy, depositor, true, TOKEN_PROGRAM_ID)
|
|
@@ -1866,33 +1792,28 @@ export class Market {
|
|
|
1866
1792
|
|
|
1867
1793
|
const mintSyRemAccounts = mintSyIx.keys
|
|
1868
1794
|
|
|
1869
|
-
const ix =
|
|
1870
|
-
|
|
1871
|
-
new BN(amountBase.toString()),
|
|
1872
|
-
new BN(amountPt.toString()),
|
|
1873
|
-
new BN(minLpOut.toString()),
|
|
1874
|
-
mintSyRemAccounts.length,
|
|
1875
|
-
)
|
|
1876
|
-
.accountsStrict({
|
|
1795
|
+
const ix = exponentCore.createWrapperProvideLiquidityClassicInstruction(
|
|
1796
|
+
{
|
|
1877
1797
|
depositor,
|
|
1878
|
-
lpPosition,
|
|
1879
1798
|
market: this.selfAddress,
|
|
1880
1799
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1881
1800
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1882
1801
|
tokenLpDst: tokenLpDepositor,
|
|
1883
1802
|
mintLp: this.mintLp,
|
|
1884
|
-
|
|
1885
|
-
|
|
1803
|
+
tokenSyDepositor,
|
|
1804
|
+
tokenPtDepositor,
|
|
1886
1805
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1887
1806
|
marketAddressLookupTable: this.addressLookupTable,
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1807
|
+
syProgram: this.syProgram,
|
|
1808
|
+
tokenLpEscrow: this.tokenLpEscrow,
|
|
1809
|
+
lpPosition,
|
|
1810
|
+
systemProgram: SystemProgram.programId,
|
|
1891
1811
|
eventAuthority: this.vault.eventAuthority,
|
|
1892
|
-
program:
|
|
1893
|
-
}
|
|
1894
|
-
|
|
1895
|
-
|
|
1812
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1813
|
+
},
|
|
1814
|
+
{ amountBase, amountPt, minLpOut, mintSyAccountsUntil: mintSyRemAccounts.length },
|
|
1815
|
+
)
|
|
1816
|
+
ix.keys.push(...mintSyRemAccounts.concat(remainingAccounts))
|
|
1896
1817
|
|
|
1897
1818
|
return {
|
|
1898
1819
|
ixs: [
|
|
@@ -1914,14 +1835,14 @@ export class Market {
|
|
|
1914
1835
|
tokenBaseWithdrawer: tokenBaseWithdrawerParam,
|
|
1915
1836
|
tokenLpWithdrawer: tokenLpWithdrawerParam,
|
|
1916
1837
|
}: {
|
|
1917
|
-
owner:
|
|
1838
|
+
owner: PublicKey
|
|
1918
1839
|
amountLp: bigint
|
|
1919
1840
|
minBaseOut: bigint
|
|
1920
|
-
tokenSyWithdrawer?:
|
|
1921
|
-
tokenYtWithdrawer?:
|
|
1922
|
-
tokenPtWithdrawer?:
|
|
1923
|
-
tokenBaseWithdrawer?:
|
|
1924
|
-
tokenLpWithdrawer?:
|
|
1841
|
+
tokenSyWithdrawer?: PublicKey
|
|
1842
|
+
tokenYtWithdrawer?: PublicKey
|
|
1843
|
+
tokenPtWithdrawer?: PublicKey
|
|
1844
|
+
tokenBaseWithdrawer?: PublicKey
|
|
1845
|
+
tokenLpWithdrawer?: PublicKey
|
|
1925
1846
|
}) {
|
|
1926
1847
|
const tokenSyWithdrawer =
|
|
1927
1848
|
tokenSyWithdrawerParam || getAssociatedTokenAddressSync(this.mintSy, owner, true, TOKEN_PROGRAM_ID)
|
|
@@ -1965,33 +1886,29 @@ export class Market {
|
|
|
1965
1886
|
|
|
1966
1887
|
const minSyOut = Number(minBaseOut) / this.currentSyExchangeRate
|
|
1967
1888
|
|
|
1968
|
-
const ix =
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
new BN(minSyOut.toFixed(0).toString()),
|
|
1972
|
-
redeemSyRemAccounts.length,
|
|
1973
|
-
)
|
|
1974
|
-
.accountsStrict({
|
|
1889
|
+
const ix = exponentCore.createWrapperWithdrawLiquidityInstruction(
|
|
1890
|
+
{
|
|
1891
|
+
withdrawer: owner,
|
|
1975
1892
|
market: this.selfAddress,
|
|
1976
1893
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
1977
1894
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
1978
1895
|
tokenLpSrc: tokenLpWithdrawer,
|
|
1979
|
-
|
|
1896
|
+
mintLp: this.mintLp,
|
|
1897
|
+
tokenSyWithdrawer,
|
|
1898
|
+
tokenPtWithdrawer,
|
|
1899
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
1980
1900
|
marketAddressLookupTable: this.addressLookupTable,
|
|
1981
|
-
eventAuthority: this.vault.eventAuthority,
|
|
1982
|
-
program: this.coreProgram.programId,
|
|
1983
1901
|
syProgram: this.syProgram,
|
|
1984
|
-
systemProgram: web3.SystemProgram.programId,
|
|
1985
|
-
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1986
1902
|
tokenLpEscrow: this.tokenLpEscrow,
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
|
|
1903
|
+
tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
|
|
1904
|
+
lpPosition,
|
|
1905
|
+
systemProgram: SystemProgram.programId,
|
|
1906
|
+
eventAuthority: this.vault.eventAuthority,
|
|
1907
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1908
|
+
},
|
|
1909
|
+
{ amountLp, syConstraint: BigInt(minSyOut.toFixed(0)), redeemSyAccountsLength: redeemSyRemAccounts.length },
|
|
1910
|
+
)
|
|
1911
|
+
ix.keys.push(...redeemSyRemAccounts.concat(remainingAccounts))
|
|
1995
1912
|
|
|
1996
1913
|
return {
|
|
1997
1914
|
ixs: [...(await this.flavor.preIxs({ signer: owner })), ix, ...(await this.flavor.postIxs({ signer: owner }))],
|
|
@@ -2008,13 +1925,13 @@ export class Market {
|
|
|
2008
1925
|
tokenBaseWithdrawer: tokenBaseWithdrawerParam,
|
|
2009
1926
|
tokenLpWithdrawer: tokenLpWithdrawerParam,
|
|
2010
1927
|
}: {
|
|
2011
|
-
owner:
|
|
1928
|
+
owner: PublicKey
|
|
2012
1929
|
amountLp: bigint
|
|
2013
|
-
tokenSyWithdrawer?:
|
|
2014
|
-
tokenYtWithdrawer?:
|
|
2015
|
-
tokenPtWithdrawer?:
|
|
2016
|
-
tokenBaseWithdrawer?:
|
|
2017
|
-
tokenLpWithdrawer?:
|
|
1930
|
+
tokenSyWithdrawer?: PublicKey
|
|
1931
|
+
tokenYtWithdrawer?: PublicKey
|
|
1932
|
+
tokenPtWithdrawer?: PublicKey
|
|
1933
|
+
tokenBaseWithdrawer?: PublicKey
|
|
1934
|
+
tokenLpWithdrawer?: PublicKey
|
|
2018
1935
|
}) {
|
|
2019
1936
|
const tokenSyWithdrawer =
|
|
2020
1937
|
tokenSyWithdrawerParam || getAssociatedTokenAddressSync(this.mintSy, owner, true, TOKEN_PROGRAM_ID)
|
|
@@ -2056,28 +1973,28 @@ export class Market {
|
|
|
2056
1973
|
|
|
2057
1974
|
const redeemSyRemAccounts = redeemSyIx.keys
|
|
2058
1975
|
|
|
2059
|
-
const ixn =
|
|
2060
|
-
|
|
2061
|
-
|
|
1976
|
+
const ixn = exponentCore.createWrapperWithdrawLiquidityClassicInstruction(
|
|
1977
|
+
{
|
|
1978
|
+
withdrawer: owner,
|
|
2062
1979
|
market: this.selfAddress,
|
|
2063
1980
|
tokenPtEscrow: this.tokenPtEscrow,
|
|
2064
1981
|
tokenSyEscrow: this.tokenSyEscrow,
|
|
2065
1982
|
tokenLpSrc: tokenLpWithdrawer,
|
|
2066
|
-
|
|
1983
|
+
mintLp: this.mintLp,
|
|
1984
|
+
tokenSyWithdrawer,
|
|
1985
|
+
tokenPtWithdrawer,
|
|
1986
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
2067
1987
|
marketAddressLookupTable: this.addressLookupTable,
|
|
2068
|
-
eventAuthority: this.vault.eventAuthority,
|
|
2069
|
-
program: this.coreProgram.programId,
|
|
2070
1988
|
syProgram: this.syProgram,
|
|
2071
|
-
systemProgram: web3.SystemProgram.programId,
|
|
2072
1989
|
tokenLpEscrow: this.tokenLpEscrow,
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
}
|
|
2079
|
-
|
|
2080
|
-
|
|
1990
|
+
lpPosition,
|
|
1991
|
+
systemProgram: SystemProgram.programId,
|
|
1992
|
+
eventAuthority: this.vault.eventAuthority,
|
|
1993
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
1994
|
+
},
|
|
1995
|
+
{ amountLp, redeemSyAccountsLength: redeemSyRemAccounts.length },
|
|
1996
|
+
)
|
|
1997
|
+
ixn.keys.push(...redeemSyRemAccounts.concat(remainingAccounts))
|
|
2081
1998
|
|
|
2082
1999
|
return {
|
|
2083
2000
|
ixs: [...(await this.flavor.preIxs({ signer: owner })), ixn, ...(await this.flavor.postIxs({ signer: owner }))],
|
|
@@ -2085,16 +2002,16 @@ export class Market {
|
|
|
2085
2002
|
}
|
|
2086
2003
|
}
|
|
2087
2004
|
|
|
2088
|
-
|
|
2005
|
+
claimFarmEmissions({
|
|
2089
2006
|
owner,
|
|
2090
2007
|
mint,
|
|
2091
2008
|
tokenProgram,
|
|
2092
2009
|
tokenDst: tokenDstParam,
|
|
2093
2010
|
}: {
|
|
2094
|
-
owner:
|
|
2095
|
-
mint:
|
|
2096
|
-
tokenProgram:
|
|
2097
|
-
tokenDst?:
|
|
2011
|
+
owner: PublicKey
|
|
2012
|
+
mint: PublicKey
|
|
2013
|
+
tokenProgram: PublicKey
|
|
2014
|
+
tokenDst?: PublicKey
|
|
2098
2015
|
}) {
|
|
2099
2016
|
const tokenDst = tokenDstParam || getAssociatedTokenAddressSync(mint, owner, true, tokenProgram)
|
|
2100
2017
|
const lpPosition = this.xponPda.marketLpPosition({ market: this.selfAddress, owner })
|
|
@@ -2102,20 +2019,20 @@ export class Market {
|
|
|
2102
2019
|
const tokenFarm = getAssociatedTokenAddressSync(mint, this.selfAddress, true, tokenProgram)
|
|
2103
2020
|
const tokenAtaIx = createAssociatedTokenAccountIdempotentInstruction(owner, tokenDst, owner, mint)
|
|
2104
2021
|
|
|
2105
|
-
const ix =
|
|
2106
|
-
|
|
2107
|
-
|
|
2022
|
+
const ix = exponentCore.createClaimFarmEmissionsInstruction(
|
|
2023
|
+
{
|
|
2024
|
+
owner,
|
|
2108
2025
|
market: this.selfAddress,
|
|
2109
2026
|
lpPosition,
|
|
2027
|
+
tokenDst,
|
|
2110
2028
|
mint,
|
|
2111
2029
|
tokenFarm,
|
|
2112
|
-
owner,
|
|
2113
|
-
tokenDst,
|
|
2114
2030
|
tokenProgram,
|
|
2115
2031
|
eventAuthority: this.eventAuthority,
|
|
2116
|
-
program:
|
|
2117
|
-
}
|
|
2118
|
-
.
|
|
2032
|
+
program: exponentCore.EXPONENTCORE_PROGRAM_ID,
|
|
2033
|
+
},
|
|
2034
|
+
{ amount: exponentCore.amount("All") },
|
|
2035
|
+
)
|
|
2119
2036
|
|
|
2120
2037
|
return {
|
|
2121
2038
|
ixs: [ix],
|
|
@@ -2123,35 +2040,35 @@ export class Market {
|
|
|
2123
2040
|
}
|
|
2124
2041
|
}
|
|
2125
2042
|
|
|
2126
|
-
|
|
2043
|
+
ixAddStandaloneEmission({
|
|
2127
2044
|
signer,
|
|
2128
2045
|
emissionMint,
|
|
2129
2046
|
emissionTokenProgram = TOKEN_PROGRAM_ID,
|
|
2130
2047
|
altAddresses,
|
|
2131
2048
|
cpiAccounts,
|
|
2132
2049
|
}: {
|
|
2133
|
-
signer:
|
|
2134
|
-
emissionMint:
|
|
2135
|
-
emissionTokenProgram?:
|
|
2136
|
-
altAddresses:
|
|
2050
|
+
signer: PublicKey
|
|
2051
|
+
emissionMint: PublicKey
|
|
2052
|
+
emissionTokenProgram?: PublicKey
|
|
2053
|
+
altAddresses: PublicKey[]
|
|
2137
2054
|
cpiAccounts: CpiAccountsRaw
|
|
2138
2055
|
}) {
|
|
2139
2056
|
const altUtil = extendAddressLookupTable(altAddresses, cpiAccounts)
|
|
2140
2057
|
|
|
2141
2058
|
const tokenEmission = getAssociatedTokenAddressSync(emissionMint, this.selfAddress, true, emissionTokenProgram)
|
|
2142
|
-
const ix =
|
|
2143
|
-
|
|
2144
|
-
.accountsStrict({
|
|
2059
|
+
const ix = exponentCore.createAddMarketEmissionInstruction(
|
|
2060
|
+
{
|
|
2145
2061
|
market: this.selfAddress,
|
|
2146
|
-
|
|
2062
|
+
signer,
|
|
2147
2063
|
feePayer: signer,
|
|
2148
2064
|
mintNew: emissionMint,
|
|
2149
|
-
|
|
2150
|
-
systemProgram: web3.SystemProgram.programId,
|
|
2065
|
+
adminState: getExponentAdminStatePda(),
|
|
2151
2066
|
tokenEmission,
|
|
2152
2067
|
tokenProgram: emissionTokenProgram,
|
|
2153
|
-
|
|
2154
|
-
|
|
2068
|
+
systemProgram: SystemProgram.programId,
|
|
2069
|
+
},
|
|
2070
|
+
{ cpiAccounts: altUtil.cpiAccountIndexes },
|
|
2071
|
+
)
|
|
2155
2072
|
|
|
2156
2073
|
return {
|
|
2157
2074
|
extendAddressLookupTableExtensionAccounts: altUtil.addressLookupTableExtension,
|
|
@@ -2159,7 +2076,7 @@ export class Market {
|
|
|
2159
2076
|
}
|
|
2160
2077
|
}
|
|
2161
2078
|
|
|
2162
|
-
|
|
2079
|
+
addFarm({
|
|
2163
2080
|
signer,
|
|
2164
2081
|
farmMint,
|
|
2165
2082
|
farmRewardTokenProgram,
|
|
@@ -2168,40 +2085,40 @@ export class Market {
|
|
|
2168
2085
|
farmRewardSrc: farmRewardSrcParam,
|
|
2169
2086
|
feePayer: feePayerParam,
|
|
2170
2087
|
}: {
|
|
2171
|
-
signer:
|
|
2172
|
-
farmMint:
|
|
2173
|
-
farmRewardTokenProgram:
|
|
2088
|
+
signer: PublicKey
|
|
2089
|
+
farmMint: PublicKey
|
|
2090
|
+
farmRewardTokenProgram: PublicKey
|
|
2174
2091
|
emissionsRate: number
|
|
2175
2092
|
untilTimestamp: number
|
|
2176
|
-
farmRewardSrc?:
|
|
2177
|
-
feePayer?:
|
|
2093
|
+
farmRewardSrc?: PublicKey
|
|
2094
|
+
feePayer?: PublicKey
|
|
2178
2095
|
}) {
|
|
2179
2096
|
const feePayer = feePayerParam || signer
|
|
2180
2097
|
const farmRewardEscrow = getAssociatedTokenAddressSync(farmMint, this.selfAddress, true, farmRewardTokenProgram)
|
|
2181
2098
|
const farmRewardSrc =
|
|
2182
2099
|
farmRewardSrcParam || getAssociatedTokenAddressSync(farmMint, signer, true, farmRewardTokenProgram)
|
|
2183
2100
|
|
|
2184
|
-
const ix =
|
|
2185
|
-
|
|
2186
|
-
.accountsStrict({
|
|
2187
|
-
adminState: getExponentAdminStatePda(),
|
|
2101
|
+
const ix = exponentCore.createAddFarmInstruction(
|
|
2102
|
+
{
|
|
2188
2103
|
market: this.selfAddress,
|
|
2189
|
-
feePayer,
|
|
2190
2104
|
signer,
|
|
2105
|
+
feePayer,
|
|
2191
2106
|
mintNew: farmMint,
|
|
2107
|
+
adminState: getExponentAdminStatePda(),
|
|
2108
|
+
tokenSource: farmRewardSrc,
|
|
2192
2109
|
tokenFarm: farmRewardEscrow,
|
|
2193
2110
|
tokenProgram: farmRewardTokenProgram,
|
|
2194
|
-
systemProgram:
|
|
2195
|
-
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2111
|
+
systemProgram: SystemProgram.programId,
|
|
2112
|
+
},
|
|
2113
|
+
{ tokenRate: BigInt(emissionsRate), untilTimestamp },
|
|
2114
|
+
)
|
|
2198
2115
|
|
|
2199
2116
|
return {
|
|
2200
2117
|
ixs: [ix],
|
|
2201
2118
|
}
|
|
2202
2119
|
}
|
|
2203
2120
|
|
|
2204
|
-
static fromJson(json: MarketJson, env: Environment, connection:
|
|
2121
|
+
static fromJson(json: MarketJson, env: Environment, connection: Connection): Market {
|
|
2205
2122
|
const state: MarketArgs = {
|
|
2206
2123
|
seedId: [json.seedId],
|
|
2207
2124
|
ptBalance: BigInt(json.ptBalance),
|
|
@@ -2213,20 +2130,20 @@ export class Market {
|
|
|
2213
2130
|
lnFeeRateRoot: json.lnFeeRateRoot,
|
|
2214
2131
|
lastLnImpliedRate: json.lastLnImpliedRate,
|
|
2215
2132
|
expirationTs: json.expirationTs,
|
|
2216
|
-
addressLookupTable: new
|
|
2217
|
-
mintSy: new
|
|
2218
|
-
mintPt: new
|
|
2219
|
-
mintLp: new
|
|
2220
|
-
tokenPtEscrow: new
|
|
2221
|
-
tokenSyEscrow: new
|
|
2222
|
-
tokenLpEscrow: new
|
|
2223
|
-
syProgram: new
|
|
2133
|
+
addressLookupTable: new PublicKey(json.addressLookupTable),
|
|
2134
|
+
mintSy: new PublicKey(json.mintSy),
|
|
2135
|
+
mintPt: new PublicKey(json.mintPt),
|
|
2136
|
+
mintLp: new PublicKey(json.mintLp),
|
|
2137
|
+
tokenPtEscrow: new PublicKey(json.tokenPtEscrow),
|
|
2138
|
+
tokenSyEscrow: new PublicKey(json.tokenSyEscrow),
|
|
2139
|
+
tokenLpEscrow: new PublicKey(json.tokenLpEscrow),
|
|
2140
|
+
syProgram: new PublicKey(json.syProgram),
|
|
2224
2141
|
cpiAccounts: deserializeCpiAccountsRaw(json.cpiAccounts),
|
|
2225
2142
|
feeTreasurySyBps: json.feeTreasurySyBps,
|
|
2226
|
-
tokenFeeTreasurySy: new
|
|
2143
|
+
tokenFeeTreasurySy: new PublicKey(json.treasurySyTokenAccount),
|
|
2227
2144
|
lpFarm: {
|
|
2228
2145
|
farmEmissions: json.lpFarm.farmEmissions.map((e) => ({
|
|
2229
|
-
mint: new
|
|
2146
|
+
mint: new PublicKey(e.mint),
|
|
2230
2147
|
tokenRate: new BN(e.tokenRate),
|
|
2231
2148
|
expiryTimestamp: e.expiryTimestamp,
|
|
2232
2149
|
index: new PreciseNumber(e.index).anchorify(),
|
|
@@ -2242,12 +2159,12 @@ export class Market {
|
|
|
2242
2159
|
},
|
|
2243
2160
|
emissions: {
|
|
2244
2161
|
trackers: json.emissions.trackers.map((e) => ({
|
|
2245
|
-
tokenEscrow: new
|
|
2162
|
+
tokenEscrow: new PublicKey(e.tokenEscrow),
|
|
2246
2163
|
lpShareIndex: e.lpShareIndex,
|
|
2247
2164
|
lastSeenStaged: e.lastSeenStaged,
|
|
2248
2165
|
})),
|
|
2249
2166
|
},
|
|
2250
|
-
vault: Vault.loadFromJson(json.vault, new
|
|
2167
|
+
vault: Vault.loadFromJson(json.vault, new PublicKey(json.vault.selfAddress), env, connection),
|
|
2251
2168
|
sySupply: BigInt(json.sySupply),
|
|
2252
2169
|
statusFlags: json.statusFlags,
|
|
2253
2170
|
isCurrentFlashSwap: json.isCurrentFlashSwap,
|
|
@@ -2255,7 +2172,7 @@ export class Market {
|
|
|
2255
2172
|
syPosition: deserializeSyPosition(json.syPosition),
|
|
2256
2173
|
}
|
|
2257
2174
|
|
|
2258
|
-
return new Market(state, new
|
|
2175
|
+
return new Market(state, new PublicKey(json.address), env, connection)
|
|
2259
2176
|
}
|
|
2260
2177
|
|
|
2261
2178
|
/** Calculate available liquidity for PT trades
|
|
@@ -2296,17 +2213,17 @@ export class Market {
|
|
|
2296
2213
|
* @param additionalBytes - number of additional bytes to allocate
|
|
2297
2214
|
* @returns transaction instruction to realloc market
|
|
2298
2215
|
*/
|
|
2299
|
-
|
|
2300
|
-
const ix =
|
|
2301
|
-
|
|
2302
|
-
.accountsStrict({
|
|
2303
|
-
adminState: getExponentAdminStatePda(),
|
|
2216
|
+
realloc_market({ signer, additionalBytes }: { signer: PublicKey; additionalBytes: number }) {
|
|
2217
|
+
const ix = exponentCore.createReallocMarketInstruction(
|
|
2218
|
+
{
|
|
2304
2219
|
market: this.selfAddress,
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2220
|
+
signer,
|
|
2221
|
+
adminState: getExponentAdminStatePda(),
|
|
2222
|
+
systemProgram: SystemProgram.programId,
|
|
2223
|
+
rent: SYSVAR_RENT_PUBKEY,
|
|
2224
|
+
},
|
|
2225
|
+
{ additionalBytes: BigInt(additionalBytes) },
|
|
2226
|
+
)
|
|
2310
2227
|
|
|
2311
2228
|
return {
|
|
2312
2229
|
ixs: [ix],
|