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