@alphafi/alphafi-sdk 0.0.107 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +378 -130
- package/dist/cjs/core/index.d.ts +159 -0
- package/dist/cjs/core/index.d.ts.map +1 -0
- package/dist/cjs/core/index.js +253 -0
- package/dist/cjs/core/index.js.map +1 -0
- package/dist/cjs/core/types.d.ts +135 -0
- package/dist/cjs/core/types.d.ts.map +1 -0
- package/dist/cjs/core/types.js +7 -0
- package/dist/cjs/core/types.js.map +1 -0
- package/dist/cjs/index.d.ts +7 -46
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +8 -166
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/models/blockchain.d.ts +45 -0
- package/dist/cjs/models/blockchain.d.ts.map +1 -0
- package/dist/cjs/models/blockchain.js +237 -0
- package/dist/cjs/models/blockchain.js.map +1 -0
- package/dist/cjs/models/coinInfoProvider.d.ts +23 -0
- package/dist/cjs/models/coinInfoProvider.d.ts.map +1 -0
- package/dist/cjs/models/coinInfoProvider.js +87 -0
- package/dist/cjs/models/coinInfoProvider.js.map +1 -0
- package/dist/cjs/models/index.d.ts +3 -0
- package/dist/cjs/models/index.d.ts.map +1 -0
- package/dist/cjs/models/index.js +8 -0
- package/dist/cjs/models/index.js.map +1 -0
- package/dist/cjs/models/portfolio.d.ts +21 -0
- package/dist/cjs/models/portfolio.d.ts.map +1 -0
- package/dist/cjs/models/portfolio.js +173 -0
- package/dist/cjs/models/portfolio.js.map +1 -0
- package/dist/cjs/models/protocol.d.ts +25 -0
- package/dist/cjs/models/protocol.d.ts.map +1 -0
- package/dist/cjs/models/protocol.js +141 -0
- package/dist/cjs/models/protocol.js.map +1 -0
- package/dist/cjs/models/strategyContext.d.ts +150 -0
- package/dist/cjs/models/strategyContext.d.ts.map +1 -0
- package/dist/cjs/models/strategyContext.js +829 -0
- package/dist/cjs/models/strategyContext.js.map +1 -0
- package/dist/cjs/models/swap.d.ts +11 -0
- package/dist/cjs/models/swap.d.ts.map +1 -0
- package/dist/cjs/models/swap.js +60 -0
- package/dist/cjs/models/swap.js.map +1 -0
- package/dist/cjs/models/types.d.ts +145 -0
- package/dist/cjs/models/types.d.ts.map +1 -0
- package/dist/cjs/models/types.js.map +1 -0
- package/dist/cjs/strategies/alphaVault.d.ts +279 -0
- package/dist/cjs/strategies/alphaVault.d.ts.map +1 -0
- package/dist/cjs/strategies/alphaVault.js +891 -0
- package/dist/cjs/strategies/alphaVault.js.map +1 -0
- package/dist/cjs/strategies/autobalanceLp.d.ts +197 -0
- package/dist/cjs/strategies/autobalanceLp.d.ts.map +1 -0
- package/dist/cjs/strategies/autobalanceLp.js +567 -0
- package/dist/cjs/strategies/autobalanceLp.js.map +1 -0
- package/dist/cjs/strategies/fungibleLending.d.ts +98 -0
- package/dist/cjs/strategies/fungibleLending.d.ts.map +1 -0
- package/dist/cjs/strategies/fungibleLending.js +204 -0
- package/dist/cjs/strategies/fungibleLending.js.map +1 -0
- package/dist/cjs/strategies/fungibleLp.d.ts +165 -0
- package/dist/cjs/strategies/fungibleLp.d.ts.map +1 -0
- package/dist/cjs/strategies/fungibleLp.js +398 -0
- package/dist/cjs/strategies/fungibleLp.js.map +1 -0
- package/dist/cjs/strategies/index.d.ts +26 -0
- package/dist/cjs/strategies/index.d.ts.map +1 -0
- package/dist/cjs/strategies/index.js +24 -0
- package/dist/cjs/strategies/index.js.map +1 -0
- package/dist/cjs/strategies/lending.d.ts +155 -0
- package/dist/cjs/strategies/lending.d.ts.map +1 -0
- package/dist/cjs/strategies/lending.js +828 -0
- package/dist/cjs/strategies/lending.js.map +1 -0
- package/dist/cjs/strategies/looping.d.ts +176 -0
- package/dist/cjs/strategies/looping.d.ts.map +1 -0
- package/dist/cjs/strategies/looping.js +978 -0
- package/dist/cjs/strategies/looping.js.map +1 -0
- package/dist/cjs/strategies/lp.d.ts +207 -0
- package/dist/cjs/strategies/lp.d.ts.map +1 -0
- package/dist/cjs/strategies/lp.js +1452 -0
- package/dist/cjs/strategies/lp.js.map +1 -0
- package/dist/cjs/strategies/lyf.d.ts +207 -0
- package/dist/cjs/strategies/lyf.d.ts.map +1 -0
- package/dist/cjs/strategies/lyf.js +649 -0
- package/dist/cjs/strategies/lyf.js.map +1 -0
- package/dist/cjs/strategies/singleAssetLooping.d.ts +152 -0
- package/dist/cjs/strategies/singleAssetLooping.d.ts.map +1 -0
- package/dist/cjs/strategies/singleAssetLooping.js +631 -0
- package/dist/cjs/strategies/singleAssetLooping.js.map +1 -0
- package/dist/cjs/strategies/slushLending.d.ts +131 -0
- package/dist/cjs/strategies/slushLending.d.ts.map +1 -0
- package/dist/cjs/strategies/slushLending.js +392 -0
- package/dist/cjs/strategies/slushLending.js.map +1 -0
- package/dist/cjs/strategies/strategy.d.ts +198 -0
- package/dist/cjs/strategies/strategy.d.ts.map +1 -0
- package/dist/cjs/strategies/strategy.js +196 -0
- package/dist/cjs/strategies/strategy.js.map +1 -0
- package/dist/cjs/utils/cache.d.ts +98 -0
- package/dist/cjs/utils/cache.d.ts.map +1 -0
- package/dist/cjs/utils/cache.js +203 -0
- package/dist/cjs/utils/cache.js.map +1 -0
- package/dist/cjs/utils/constants.d.ts +236 -2
- package/dist/cjs/utils/constants.d.ts.map +1 -1
- package/dist/cjs/utils/constants.js +244 -107
- package/dist/cjs/utils/constants.js.map +1 -1
- package/dist/cjs/utils/poolMap.d.ts +20 -0
- package/dist/cjs/utils/poolMap.d.ts.map +1 -0
- package/dist/cjs/utils/poolMap.js +237 -0
- package/dist/cjs/utils/poolMap.js.map +1 -0
- package/dist/cjs/utils/testing-pools.d.ts +3 -0
- package/dist/cjs/utils/testing-pools.d.ts.map +1 -0
- package/dist/cjs/utils/testing-pools.js +27 -0
- package/dist/cjs/utils/testing-pools.js.map +1 -0
- package/dist/esm/core/index.d.ts +159 -0
- package/dist/esm/core/index.d.ts.map +1 -0
- package/dist/esm/core/index.js +249 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/core/types.d.ts +135 -0
- package/dist/esm/core/types.d.ts.map +1 -0
- package/dist/esm/core/types.js +6 -0
- package/dist/esm/core/types.js.map +1 -0
- package/dist/esm/index.d.ts +7 -46
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +8 -49
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/blockchain.d.ts +45 -0
- package/dist/esm/models/blockchain.d.ts.map +1 -0
- package/dist/esm/models/blockchain.js +233 -0
- package/dist/esm/models/blockchain.js.map +1 -0
- package/dist/esm/models/coinInfoProvider.d.ts +23 -0
- package/dist/esm/models/coinInfoProvider.d.ts.map +1 -0
- package/dist/esm/models/coinInfoProvider.js +83 -0
- package/dist/esm/models/coinInfoProvider.js.map +1 -0
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.d.ts.map +1 -0
- package/dist/esm/models/index.js +3 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/portfolio.d.ts +21 -0
- package/dist/esm/models/portfolio.d.ts.map +1 -0
- package/dist/esm/models/portfolio.js +169 -0
- package/dist/esm/models/portfolio.js.map +1 -0
- package/dist/esm/models/protocol.d.ts +25 -0
- package/dist/esm/models/protocol.d.ts.map +1 -0
- package/dist/esm/models/protocol.js +137 -0
- package/dist/esm/models/protocol.js.map +1 -0
- package/dist/esm/models/strategyContext.d.ts +150 -0
- package/dist/esm/models/strategyContext.d.ts.map +1 -0
- package/dist/esm/models/strategyContext.js +825 -0
- package/dist/esm/models/strategyContext.js.map +1 -0
- package/dist/esm/models/swap.d.ts +11 -0
- package/dist/esm/models/swap.d.ts.map +1 -0
- package/dist/esm/models/swap.js +58 -0
- package/dist/esm/models/swap.js.map +1 -0
- package/dist/esm/models/types.d.ts +145 -0
- package/dist/esm/models/types.d.ts.map +1 -0
- package/dist/esm/models/types.js.map +1 -0
- package/dist/esm/strategies/alphaVault.d.ts +279 -0
- package/dist/esm/strategies/alphaVault.d.ts.map +1 -0
- package/dist/esm/strategies/alphaVault.js +887 -0
- package/dist/esm/strategies/alphaVault.js.map +1 -0
- package/dist/esm/strategies/autobalanceLp.d.ts +197 -0
- package/dist/esm/strategies/autobalanceLp.d.ts.map +1 -0
- package/dist/esm/strategies/autobalanceLp.js +562 -0
- package/dist/esm/strategies/autobalanceLp.js.map +1 -0
- package/dist/esm/strategies/fungibleLending.d.ts +98 -0
- package/dist/esm/strategies/fungibleLending.d.ts.map +1 -0
- package/dist/esm/strategies/fungibleLending.js +200 -0
- package/dist/esm/strategies/fungibleLending.js.map +1 -0
- package/dist/esm/strategies/fungibleLp.d.ts +165 -0
- package/dist/esm/strategies/fungibleLp.d.ts.map +1 -0
- package/dist/esm/strategies/fungibleLp.js +393 -0
- package/dist/esm/strategies/fungibleLp.js.map +1 -0
- package/dist/esm/strategies/index.d.ts +26 -0
- package/dist/esm/strategies/index.d.ts.map +1 -0
- package/dist/esm/strategies/index.js +18 -0
- package/dist/esm/strategies/index.js.map +1 -0
- package/dist/esm/strategies/lending.d.ts +155 -0
- package/dist/esm/strategies/lending.d.ts.map +1 -0
- package/dist/esm/strategies/lending.js +824 -0
- package/dist/esm/strategies/lending.js.map +1 -0
- package/dist/esm/strategies/looping.d.ts +176 -0
- package/dist/esm/strategies/looping.d.ts.map +1 -0
- package/dist/esm/strategies/looping.js +974 -0
- package/dist/esm/strategies/looping.js.map +1 -0
- package/dist/esm/strategies/lp.d.ts +207 -0
- package/dist/esm/strategies/lp.d.ts.map +1 -0
- package/dist/esm/strategies/lp.js +1447 -0
- package/dist/esm/strategies/lp.js.map +1 -0
- package/dist/esm/strategies/lyf.d.ts +207 -0
- package/dist/esm/strategies/lyf.d.ts.map +1 -0
- package/dist/esm/strategies/lyf.js +644 -0
- package/dist/esm/strategies/lyf.js.map +1 -0
- package/dist/esm/strategies/singleAssetLooping.d.ts +152 -0
- package/dist/esm/strategies/singleAssetLooping.d.ts.map +1 -0
- package/dist/esm/strategies/singleAssetLooping.js +627 -0
- package/dist/esm/strategies/singleAssetLooping.js.map +1 -0
- package/dist/esm/strategies/slushLending.d.ts +131 -0
- package/dist/esm/strategies/slushLending.d.ts.map +1 -0
- package/dist/esm/strategies/slushLending.js +388 -0
- package/dist/esm/strategies/slushLending.js.map +1 -0
- package/dist/esm/strategies/strategy.d.ts +198 -0
- package/dist/esm/strategies/strategy.d.ts.map +1 -0
- package/dist/esm/strategies/strategy.js +192 -0
- package/dist/esm/strategies/strategy.js.map +1 -0
- package/dist/esm/utils/cache.d.ts +98 -0
- package/dist/esm/utils/cache.d.ts.map +1 -0
- package/dist/esm/utils/cache.js +198 -0
- package/dist/esm/utils/cache.js.map +1 -0
- package/dist/esm/utils/constants.d.ts +236 -2
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +243 -106
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/esm/utils/poolMap.d.ts +20 -0
- package/dist/esm/utils/poolMap.d.ts.map +1 -0
- package/dist/esm/utils/poolMap.js +233 -0
- package/dist/esm/utils/poolMap.js.map +1 -0
- package/dist/esm/utils/testing-pools.d.ts +3 -0
- package/dist/esm/utils/testing-pools.d.ts.map +1 -0
- package/dist/esm/utils/testing-pools.js +24 -0
- package/dist/esm/utils/testing-pools.js.map +1 -0
- package/package.json +45 -72
- package/dist/cjs/adminFunctions.d.ts +0 -33
- package/dist/cjs/adminFunctions.d.ts.map +0 -1
- package/dist/cjs/adminFunctions.js +0 -306
- package/dist/cjs/adminFunctions.js.map +0 -1
- package/dist/cjs/common/alphaTypes.d.ts +0 -110
- package/dist/cjs/common/alphaTypes.d.ts.map +0 -1
- package/dist/cjs/common/alphaTypes.js +0 -3
- package/dist/cjs/common/alphaTypes.js.map +0 -1
- package/dist/cjs/common/cetus_mainnet_config.d.ts +0 -3
- package/dist/cjs/common/cetus_mainnet_config.d.ts.map +0 -1
- package/dist/cjs/common/cetus_mainnet_config.js +0 -50
- package/dist/cjs/common/cetus_mainnet_config.js.map +0 -1
- package/dist/cjs/common/coins.d.ts +0 -6
- package/dist/cjs/common/coins.d.ts.map +0 -1
- package/dist/cjs/common/coins.js +0 -313
- package/dist/cjs/common/coins.js.map +0 -1
- package/dist/cjs/common/constants.d.ts +0 -3187
- package/dist/cjs/common/constants.d.ts.map +0 -1
- package/dist/cjs/common/constants.js +0 -2564
- package/dist/cjs/common/constants.js.map +0 -1
- package/dist/cjs/common/maps.d.ts +0 -120
- package/dist/cjs/common/maps.d.ts.map +0 -1
- package/dist/cjs/common/maps.js +0 -2527
- package/dist/cjs/common/maps.js.map +0 -1
- package/dist/cjs/common/pyth.d.ts +0 -7
- package/dist/cjs/common/pyth.d.ts.map +0 -1
- package/dist/cjs/common/pyth.js +0 -3
- package/dist/cjs/common/pyth.js.map +0 -1
- package/dist/cjs/common/types.d.ts +0 -736
- package/dist/cjs/common/types.d.ts.map +0 -1
- package/dist/cjs/common/types.js.map +0 -1
- package/dist/cjs/example.d.ts +0 -3
- package/dist/cjs/example.d.ts.map +0 -1
- package/dist/cjs/example.js +0 -42
- package/dist/cjs/example.js.map +0 -1
- package/dist/cjs/getAirdropShare.d.ts +0 -3
- package/dist/cjs/getAirdropShare.d.ts.map +0 -1
- package/dist/cjs/getAirdropShare.js +0 -10
- package/dist/cjs/getAirdropShare.js.map +0 -1
- package/dist/cjs/getAllVaults.d.ts +0 -7
- package/dist/cjs/getAllVaults.d.ts.map +0 -1
- package/dist/cjs/getAllVaults.js +0 -39
- package/dist/cjs/getAllVaults.js.map +0 -1
- package/dist/cjs/getAlphaUnlocks.d.ts +0 -15
- package/dist/cjs/getAlphaUnlocks.d.ts.map +0 -1
- package/dist/cjs/getAlphaUnlocks.js +0 -21
- package/dist/cjs/getAlphaUnlocks.js.map +0 -1
- package/dist/cjs/getAprs.d.ts +0 -14
- package/dist/cjs/getAprs.d.ts.map +0 -1
- package/dist/cjs/getAprs.js +0 -306
- package/dist/cjs/getAprs.js.map +0 -1
- package/dist/cjs/getLastAutoCompoundTime.d.ts +0 -4
- package/dist/cjs/getLastAutoCompoundTime.d.ts.map +0 -1
- package/dist/cjs/getLastAutoCompoundTime.js +0 -18
- package/dist/cjs/getLastAutoCompoundTime.js.map +0 -1
- package/dist/cjs/getRebalanceHistory.d.ts +0 -6
- package/dist/cjs/getRebalanceHistory.d.ts.map +0 -1
- package/dist/cjs/getRebalanceHistory.js +0 -26
- package/dist/cjs/getRebalanceHistory.js.map +0 -1
- package/dist/cjs/getTvls.d.ts +0 -10
- package/dist/cjs/getTvls.d.ts.map +0 -1
- package/dist/cjs/getTvls.js +0 -137
- package/dist/cjs/getTvls.js.map +0 -1
- package/dist/cjs/getVaultBalances.d.ts +0 -13
- package/dist/cjs/getVaultBalances.d.ts.map +0 -1
- package/dist/cjs/getVaultBalances.js +0 -103
- package/dist/cjs/getVaultBalances.js.map +0 -1
- package/dist/cjs/getVaults.d.ts +0 -8
- package/dist/cjs/getVaults.d.ts.map +0 -1
- package/dist/cjs/getVaults.js +0 -34
- package/dist/cjs/getVaults.js.map +0 -1
- package/dist/cjs/graphql/client.d.ts +0 -4
- package/dist/cjs/graphql/client.d.ts.map +0 -1
- package/dist/cjs/graphql/client.js +0 -14
- package/dist/cjs/graphql/client.js.map +0 -1
- package/dist/cjs/graphql/executeMutations.d.ts +0 -19
- package/dist/cjs/graphql/executeMutations.d.ts.map +0 -1
- package/dist/cjs/graphql/executeMutations.js +0 -40
- package/dist/cjs/graphql/executeMutations.js.map +0 -1
- package/dist/cjs/graphql/fetchAutoCompoundingEventsGql.d.ts +0 -28
- package/dist/cjs/graphql/fetchAutoCompoundingEventsGql.d.ts.map +0 -1
- package/dist/cjs/graphql/fetchAutoCompoundingEventsGql.js +0 -120
- package/dist/cjs/graphql/fetchAutoCompoundingEventsGql.js.map +0 -1
- package/dist/cjs/graphql/fetchData.d.ts +0 -35
- package/dist/cjs/graphql/fetchData.d.ts.map +0 -1
- package/dist/cjs/graphql/fetchData.js +0 -103
- package/dist/cjs/graphql/fetchData.js.map +0 -1
- package/dist/cjs/graphql/fetchNftHolders.d.ts +0 -4
- package/dist/cjs/graphql/fetchNftHolders.d.ts.map +0 -1
- package/dist/cjs/graphql/fetchNftHolders.js +0 -37
- package/dist/cjs/graphql/fetchNftHolders.js.map +0 -1
- package/dist/cjs/graphql/fetchReceipts.d.ts +0 -4
- package/dist/cjs/graphql/fetchReceipts.d.ts.map +0 -1
- package/dist/cjs/graphql/fetchReceipts.js +0 -38
- package/dist/cjs/graphql/fetchReceipts.js.map +0 -1
- package/dist/cjs/graphql/getMultiReceipts.d.ts +0 -4
- package/dist/cjs/graphql/getMultiReceipts.d.ts.map +0 -1
- package/dist/cjs/graphql/getMultiReceipts.js +0 -117
- package/dist/cjs/graphql/getMultiReceipts.js.map +0 -1
- package/dist/cjs/graphql/mutations.d.ts +0 -4
- package/dist/cjs/graphql/mutations.d.ts.map +0 -1
- package/dist/cjs/graphql/mutations.js +0 -33
- package/dist/cjs/graphql/mutations.js.map +0 -1
- package/dist/cjs/graphql/parseData.d.ts +0 -3
- package/dist/cjs/graphql/parseData.d.ts.map +0 -1
- package/dist/cjs/graphql/parseData.js +0 -10
- package/dist/cjs/graphql/parseData.js.map +0 -1
- package/dist/cjs/graphql/parseLockedTableId.d.ts +0 -8
- package/dist/cjs/graphql/parseLockedTableId.d.ts.map +0 -1
- package/dist/cjs/graphql/parseLockedTableId.js +0 -16
- package/dist/cjs/graphql/parseLockedTableId.js.map +0 -1
- package/dist/cjs/graphql/queries/autoCompoundEvents.d.ts +0 -2
- package/dist/cjs/graphql/queries/autoCompoundEvents.d.ts.map +0 -1
- package/dist/cjs/graphql/queries/autoCompoundEvents.js +0 -19
- package/dist/cjs/graphql/queries/autoCompoundEvents.js.map +0 -1
- package/dist/cjs/graphql/queries/cetusPools.d.ts +0 -2
- package/dist/cjs/graphql/queries/cetusPools.d.ts.map +0 -1
- package/dist/cjs/graphql/queries/cetusPools.js +0 -39
- package/dist/cjs/graphql/queries/cetusPools.js.map +0 -1
- package/dist/cjs/graphql/queries/getMultiReceipts.d.ts +0 -3
- package/dist/cjs/graphql/queries/getMultiReceipts.d.ts.map +0 -1
- package/dist/cjs/graphql/queries/getMultiReceipts.js +0 -59
- package/dist/cjs/graphql/queries/getMultiReceipts.js.map +0 -1
- package/dist/cjs/graphql/queries/investors.d.ts +0 -2
- package/dist/cjs/graphql/queries/investors.d.ts.map +0 -1
- package/dist/cjs/graphql/queries/investors.js +0 -39
- package/dist/cjs/graphql/queries/investors.js.map +0 -1
- package/dist/cjs/graphql/queries/lockedTableData.d.ts +0 -2
- package/dist/cjs/graphql/queries/lockedTableData.d.ts.map +0 -1
- package/dist/cjs/graphql/queries/lockedTableData.js +0 -30
- package/dist/cjs/graphql/queries/lockedTableData.js.map +0 -1
- package/dist/cjs/graphql/queries/lockedTableDataFragment.d.ts +0 -2
- package/dist/cjs/graphql/queries/lockedTableDataFragment.d.ts.map +0 -1
- package/dist/cjs/graphql/queries/lockedTableDataFragment.js +0 -24
- package/dist/cjs/graphql/queries/lockedTableDataFragment.js.map +0 -1
- package/dist/cjs/graphql/queries/nftHolders.d.ts +0 -2
- package/dist/cjs/graphql/queries/nftHolders.d.ts.map +0 -1
- package/dist/cjs/graphql/queries/nftHolders.js +0 -23
- package/dist/cjs/graphql/queries/nftHolders.js.map +0 -1
- package/dist/cjs/graphql/queries/pools.d.ts +0 -2
- package/dist/cjs/graphql/queries/pools.d.ts.map +0 -1
- package/dist/cjs/graphql/queries/pools.js +0 -57
- package/dist/cjs/graphql/queries/pools.js.map +0 -1
- package/dist/cjs/graphql/queries/receiptData.d.ts +0 -2
- package/dist/cjs/graphql/queries/receiptData.d.ts.map +0 -1
- package/dist/cjs/graphql/queries/receiptData.js +0 -21
- package/dist/cjs/graphql/queries/receiptData.js.map +0 -1
- package/dist/cjs/graphql/queries/userVaultBalances.d.ts +0 -2
- package/dist/cjs/graphql/queries/userVaultBalances.d.ts.map +0 -1
- package/dist/cjs/graphql/queries/userVaultBalances.js +0 -62
- package/dist/cjs/graphql/queries/userVaultBalances.js.map +0 -1
- package/dist/cjs/graphql/queries/userVaults.d.ts +0 -2
- package/dist/cjs/graphql/queries/userVaults.d.ts.map +0 -1
- package/dist/cjs/graphql/queries/userVaults.js +0 -62
- package/dist/cjs/graphql/queries/userVaults.js.map +0 -1
- package/dist/cjs/graphql/queries.d.ts +0 -15
- package/dist/cjs/graphql/queries.d.ts.map +0 -1
- package/dist/cjs/graphql/queries.js +0 -86
- package/dist/cjs/graphql/queries.js.map +0 -1
- package/dist/cjs/graphql/types.d.ts +0 -112
- package/dist/cjs/graphql/types.d.ts.map +0 -1
- package/dist/cjs/graphql/types.js +0 -3
- package/dist/cjs/graphql/types.js.map +0 -1
- package/dist/cjs/sui-sdk/client.d.ts +0 -44
- package/dist/cjs/sui-sdk/client.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/client.js +0 -90
- package/dist/cjs/sui-sdk/client.js.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchAfterTransactionEvents.d.ts +0 -10
- package/dist/cjs/sui-sdk/events/fetchAfterTransactionEvents.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchAfterTransactionEvents.js +0 -128
- package/dist/cjs/sui-sdk/events/fetchAfterTransactionEvents.js.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchAirdropClaimEvent.d.ts +0 -4
- package/dist/cjs/sui-sdk/events/fetchAirdropClaimEvent.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchAirdropClaimEvent.js +0 -20
- package/dist/cjs/sui-sdk/events/fetchAirdropClaimEvent.js.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchAutoCompoundingEvents.d.ts +0 -9
- package/dist/cjs/sui-sdk/events/fetchAutoCompoundingEvents.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchAutoCompoundingEvents.js +0 -406
- package/dist/cjs/sui-sdk/events/fetchAutoCompoundingEvents.js.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchCheckRatioEvents.d.ts +0 -4
- package/dist/cjs/sui-sdk/events/fetchCheckRatioEvents.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchCheckRatioEvents.js +0 -47
- package/dist/cjs/sui-sdk/events/fetchCheckRatioEvents.js.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchEvents.d.ts +0 -4
- package/dist/cjs/sui-sdk/events/fetchEvents.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchEvents.js +0 -453
- package/dist/cjs/sui-sdk/events/fetchEvents.js.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchLiquidityChangeEvents.d.ts +0 -4
- package/dist/cjs/sui-sdk/events/fetchLiquidityChangeEvents.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchLiquidityChangeEvents.js +0 -45
- package/dist/cjs/sui-sdk/events/fetchLiquidityChangeEvents.js.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchMultiCategoryEvents.d.ts +0 -9
- package/dist/cjs/sui-sdk/events/fetchMultiCategoryEvents.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchMultiCategoryEvents.js +0 -41
- package/dist/cjs/sui-sdk/events/fetchMultiCategoryEvents.js.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchRebalanceEvents.d.ts +0 -7
- package/dist/cjs/sui-sdk/events/fetchRebalanceEvents.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchRebalanceEvents.js +0 -91
- package/dist/cjs/sui-sdk/events/fetchRebalanceEvents.js.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchWithdrawV2Events.d.ts +0 -4
- package/dist/cjs/sui-sdk/events/fetchWithdrawV2Events.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/events/fetchWithdrawV2Events.js +0 -28
- package/dist/cjs/sui-sdk/events/fetchWithdrawV2Events.js.map +0 -1
- package/dist/cjs/sui-sdk/events/parseData.d.ts +0 -6
- package/dist/cjs/sui-sdk/events/parseData.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/events/parseData.js +0 -33
- package/dist/cjs/sui-sdk/events/parseData.js.map +0 -1
- package/dist/cjs/sui-sdk/events/types.d.ts +0 -238
- package/dist/cjs/sui-sdk/events/types.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/events/types.js +0 -9
- package/dist/cjs/sui-sdk/events/types.js.map +0 -1
- package/dist/cjs/sui-sdk/functions/fetchTableData.d.ts +0 -50
- package/dist/cjs/sui-sdk/functions/fetchTableData.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/functions/fetchTableData.js +0 -77
- package/dist/cjs/sui-sdk/functions/fetchTableData.js.map +0 -1
- package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.d.ts +0 -3
- package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.js +0 -73
- package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.js.map +0 -1
- package/dist/cjs/sui-sdk/functions/fetchUserVaults.d.ts +0 -3
- package/dist/cjs/sui-sdk/functions/fetchUserVaults.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/functions/fetchUserVaults.js +0 -50
- package/dist/cjs/sui-sdk/functions/fetchUserVaults.js.map +0 -1
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.d.ts +0 -19
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js +0 -314
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js.map +0 -1
- package/dist/cjs/sui-sdk/functions/getPositionRange.d.ts +0 -12
- package/dist/cjs/sui-sdk/functions/getPositionRange.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/functions/getPositionRange.js +0 -88
- package/dist/cjs/sui-sdk/functions/getPositionRange.js.map +0 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts +0 -69
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.js +0 -768
- package/dist/cjs/sui-sdk/functions/getReceipts.js.map +0 -1
- package/dist/cjs/sui-sdk/transactions/constants.d.ts +0 -4
- package/dist/cjs/sui-sdk/transactions/constants.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/transactions/constants.js +0 -90
- package/dist/cjs/sui-sdk/transactions/constants.js.map +0 -1
- package/dist/cjs/sui-sdk/transactions/fetchTransactions.d.ts +0 -5
- package/dist/cjs/sui-sdk/transactions/fetchTransactions.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/transactions/fetchTransactions.js +0 -65
- package/dist/cjs/sui-sdk/transactions/fetchTransactions.js.map +0 -1
- package/dist/cjs/sui-sdk/transactions/types.d.ts +0 -9
- package/dist/cjs/sui-sdk/transactions/types.d.ts.map +0 -1
- package/dist/cjs/sui-sdk/transactions/types.js +0 -3
- package/dist/cjs/sui-sdk/transactions/types.js.map +0 -1
- package/dist/cjs/transactions/7k.d.ts +0 -8
- package/dist/cjs/transactions/7k.d.ts.map +0 -1
- package/dist/cjs/transactions/7k.js +0 -34
- package/dist/cjs/transactions/7k.js.map +0 -1
- package/dist/cjs/transactions/alpha.d.ts +0 -6
- package/dist/cjs/transactions/alpha.d.ts.map +0 -1
- package/dist/cjs/transactions/alpha.js +0 -110
- package/dist/cjs/transactions/alpha.js.map +0 -1
- package/dist/cjs/transactions/alphaVault.d.ts +0 -33
- package/dist/cjs/transactions/alphaVault.d.ts.map +0 -1
- package/dist/cjs/transactions/alphaVault.js +0 -449
- package/dist/cjs/transactions/alphaVault.js.map +0 -1
- package/dist/cjs/transactions/alphalend.d.ts +0 -30
- package/dist/cjs/transactions/alphalend.d.ts.map +0 -1
- package/dist/cjs/transactions/alphalend.js +0 -286
- package/dist/cjs/transactions/alphalend.js.map +0 -1
- package/dist/cjs/transactions/blueRewards.d.ts +0 -15
- package/dist/cjs/transactions/blueRewards.d.ts.map +0 -1
- package/dist/cjs/transactions/blueRewards.js +0 -395
- package/dist/cjs/transactions/blueRewards.js.map +0 -1
- package/dist/cjs/transactions/bluefin.d.ts +0 -60
- package/dist/cjs/transactions/bluefin.d.ts.map +0 -1
- package/dist/cjs/transactions/bluefin.js +0 -3078
- package/dist/cjs/transactions/bluefin.js.map +0 -1
- package/dist/cjs/transactions/bucket.d.ts +0 -8
- package/dist/cjs/transactions/bucket.d.ts.map +0 -1
- package/dist/cjs/transactions/bucket.js +0 -144
- package/dist/cjs/transactions/bucket.js.map +0 -1
- package/dist/cjs/transactions/cetus.d.ts +0 -27
- package/dist/cjs/transactions/cetus.d.ts.map +0 -1
- package/dist/cjs/transactions/cetus.js +0 -466
- package/dist/cjs/transactions/cetus.js.map +0 -1
- package/dist/cjs/transactions/cetusSwap.d.ts +0 -15
- package/dist/cjs/transactions/cetusSwap.d.ts.map +0 -1
- package/dist/cjs/transactions/cetusSwap.js +0 -74
- package/dist/cjs/transactions/cetusSwap.js.map +0 -1
- package/dist/cjs/transactions/collect_rewards.d.ts +0 -11
- package/dist/cjs/transactions/collect_rewards.d.ts.map +0 -1
- package/dist/cjs/transactions/collect_rewards.js +0 -1292
- package/dist/cjs/transactions/collect_rewards.js.map +0 -1
- package/dist/cjs/transactions/deposit.d.ts +0 -15
- package/dist/cjs/transactions/deposit.d.ts.map +0 -1
- package/dist/cjs/transactions/deposit.js +0 -194
- package/dist/cjs/transactions/deposit.js.map +0 -1
- package/dist/cjs/transactions/get_navi_rewards.d.ts +0 -11
- package/dist/cjs/transactions/get_navi_rewards.d.ts.map +0 -1
- package/dist/cjs/transactions/get_navi_rewards.js +0 -39
- package/dist/cjs/transactions/get_navi_rewards.js.map +0 -1
- package/dist/cjs/transactions/navi-looping.d.ts +0 -55
- package/dist/cjs/transactions/navi-looping.d.ts.map +0 -1
- package/dist/cjs/transactions/navi-looping.js +0 -1718
- package/dist/cjs/transactions/navi-looping.js.map +0 -1
- package/dist/cjs/transactions/navi.d.ts +0 -9
- package/dist/cjs/transactions/navi.d.ts.map +0 -1
- package/dist/cjs/transactions/navi.js +0 -2541
- package/dist/cjs/transactions/navi.js.map +0 -1
- package/dist/cjs/transactions/naviOracle.d.ts +0 -5
- package/dist/cjs/transactions/naviOracle.d.ts.map +0 -1
- package/dist/cjs/transactions/naviOracle.js +0 -28
- package/dist/cjs/transactions/naviOracle.js.map +0 -1
- package/dist/cjs/transactions/newZapDeposit.d.ts +0 -19
- package/dist/cjs/transactions/newZapDeposit.d.ts.map +0 -1
- package/dist/cjs/transactions/newZapDeposit.js +0 -1622
- package/dist/cjs/transactions/newZapDeposit.js.map +0 -1
- package/dist/cjs/transactions/slush.d.ts +0 -16
- package/dist/cjs/transactions/slush.d.ts.map +0 -1
- package/dist/cjs/transactions/slush.js +0 -219
- package/dist/cjs/transactions/slush.js.map +0 -1
- package/dist/cjs/transactions/types.d.ts +0 -17
- package/dist/cjs/transactions/types.d.ts.map +0 -1
- package/dist/cjs/transactions/types.js +0 -3
- package/dist/cjs/transactions/types.js.map +0 -1
- package/dist/cjs/transactions/withdraw.d.ts +0 -9
- package/dist/cjs/transactions/withdraw.d.ts.map +0 -1
- package/dist/cjs/transactions/withdraw.js +0 -132
- package/dist/cjs/transactions/withdraw.js.map +0 -1
- package/dist/cjs/transactions/zapDeposit.d.ts +0 -6
- package/dist/cjs/transactions/zapDeposit.d.ts.map +0 -1
- package/dist/cjs/transactions/zapDeposit.js +0 -1731
- package/dist/cjs/transactions/zapDeposit.js.map +0 -1
- package/dist/cjs/types.d.ts +0 -201
- package/dist/cjs/types.d.ts.map +0 -1
- package/dist/cjs/types.js +0 -3
- package/dist/cjs/types.js.map +0 -1
- package/dist/cjs/utils/clmm/prices.d.ts +0 -20
- package/dist/cjs/utils/clmm/prices.d.ts.map +0 -1
- package/dist/cjs/utils/clmm/prices.js +0 -321
- package/dist/cjs/utils/clmm/prices.js.map +0 -1
- package/dist/cjs/utils/clmm/tokenAmountFromLiquidity.d.ts +0 -15
- package/dist/cjs/utils/clmm/tokenAmountFromLiquidity.d.ts.map +0 -1
- package/dist/cjs/utils/clmm/tokenAmountFromLiquidity.js +0 -200
- package/dist/cjs/utils/clmm/tokenAmountFromLiquidity.js.map +0 -1
- package/dist/cjs/utils/clmm/types.d.ts +0 -25
- package/dist/cjs/utils/clmm/types.d.ts.map +0 -1
- package/dist/cjs/utils/clmm/types.js +0 -3
- package/dist/cjs/utils/clmm/types.js.map +0 -1
- package/dist/cjs/utils/getReceipts.d.ts +0 -4
- package/dist/cjs/utils/getReceipts.d.ts.map +0 -1
- package/dist/cjs/utils/getReceipts.js +0 -47
- package/dist/cjs/utils/getReceipts.js.map +0 -1
- package/dist/cjs/utils/hop.d.ts +0 -16
- package/dist/cjs/utils/hop.d.ts.map +0 -1
- package/dist/cjs/utils/hop.js +0 -130
- package/dist/cjs/utils/hop.js.map +0 -1
- package/dist/cjs/utils/prices.d.ts +0 -15
- package/dist/cjs/utils/prices.d.ts.map +0 -1
- package/dist/cjs/utils/prices.js +0 -168
- package/dist/cjs/utils/prices.js.map +0 -1
- package/dist/cjs/utils/simpleCache.d.ts +0 -14
- package/dist/cjs/utils/simpleCache.d.ts.map +0 -1
- package/dist/cjs/utils/simpleCache.js +0 -92
- package/dist/cjs/utils/simpleCache.js.map +0 -1
- package/dist/cjs/utils/types.d.ts +0 -5
- package/dist/cjs/utils/types.d.ts.map +0 -1
- package/dist/cjs/utils/types.js +0 -3
- package/dist/cjs/utils/types.js.map +0 -1
- package/dist/cjs/utils/userHoldings.d.ts +0 -10
- package/dist/cjs/utils/userHoldings.d.ts.map +0 -1
- package/dist/cjs/utils/userHoldings.js +0 -229
- package/dist/cjs/utils/userHoldings.js.map +0 -1
- package/dist/cjs/vaultFunctions.d.ts +0 -8
- package/dist/cjs/vaultFunctions.d.ts.map +0 -1
- package/dist/cjs/vaultFunctions.js +0 -36
- package/dist/cjs/vaultFunctions.js.map +0 -1
- package/dist/esm/adminFunctions.d.ts +0 -33
- package/dist/esm/adminFunctions.d.ts.map +0 -1
- package/dist/esm/adminFunctions.js +0 -290
- package/dist/esm/adminFunctions.js.map +0 -1
- package/dist/esm/common/alphaTypes.d.ts +0 -110
- package/dist/esm/common/alphaTypes.d.ts.map +0 -1
- package/dist/esm/common/alphaTypes.js +0 -2
- package/dist/esm/common/alphaTypes.js.map +0 -1
- package/dist/esm/common/cetus_mainnet_config.d.ts +0 -3
- package/dist/esm/common/cetus_mainnet_config.d.ts.map +0 -1
- package/dist/esm/common/cetus_mainnet_config.js +0 -47
- package/dist/esm/common/cetus_mainnet_config.js.map +0 -1
- package/dist/esm/common/coins.d.ts +0 -6
- package/dist/esm/common/coins.d.ts.map +0 -1
- package/dist/esm/common/coins.js +0 -310
- package/dist/esm/common/coins.js.map +0 -1
- package/dist/esm/common/constants.d.ts +0 -3187
- package/dist/esm/common/constants.d.ts.map +0 -1
- package/dist/esm/common/constants.js +0 -2560
- package/dist/esm/common/constants.js.map +0 -1
- package/dist/esm/common/maps.d.ts +0 -120
- package/dist/esm/common/maps.d.ts.map +0 -1
- package/dist/esm/common/maps.js +0 -2516
- package/dist/esm/common/maps.js.map +0 -1
- package/dist/esm/common/pyth.d.ts +0 -7
- package/dist/esm/common/pyth.d.ts.map +0 -1
- package/dist/esm/common/pyth.js +0 -2
- package/dist/esm/common/pyth.js.map +0 -1
- package/dist/esm/common/types.d.ts +0 -736
- package/dist/esm/common/types.d.ts.map +0 -1
- package/dist/esm/common/types.js.map +0 -1
- package/dist/esm/example.d.ts +0 -3
- package/dist/esm/example.d.ts.map +0 -1
- package/dist/esm/example.js +0 -38
- package/dist/esm/example.js.map +0 -1
- package/dist/esm/getAirdropShare.d.ts +0 -3
- package/dist/esm/getAirdropShare.d.ts.map +0 -1
- package/dist/esm/getAirdropShare.js +0 -7
- package/dist/esm/getAirdropShare.js.map +0 -1
- package/dist/esm/getAllVaults.d.ts +0 -7
- package/dist/esm/getAllVaults.d.ts.map +0 -1
- package/dist/esm/getAllVaults.js +0 -34
- package/dist/esm/getAllVaults.js.map +0 -1
- package/dist/esm/getAlphaUnlocks.d.ts +0 -15
- package/dist/esm/getAlphaUnlocks.d.ts.map +0 -1
- package/dist/esm/getAlphaUnlocks.js +0 -18
- package/dist/esm/getAlphaUnlocks.js.map +0 -1
- package/dist/esm/getAprs.d.ts +0 -14
- package/dist/esm/getAprs.d.ts.map +0 -1
- package/dist/esm/getAprs.js +0 -297
- package/dist/esm/getAprs.js.map +0 -1
- package/dist/esm/getLastAutoCompoundTime.d.ts +0 -4
- package/dist/esm/getLastAutoCompoundTime.d.ts.map +0 -1
- package/dist/esm/getLastAutoCompoundTime.js +0 -15
- package/dist/esm/getLastAutoCompoundTime.js.map +0 -1
- package/dist/esm/getRebalanceHistory.d.ts +0 -6
- package/dist/esm/getRebalanceHistory.d.ts.map +0 -1
- package/dist/esm/getRebalanceHistory.js +0 -22
- package/dist/esm/getRebalanceHistory.js.map +0 -1
- package/dist/esm/getTvls.d.ts +0 -10
- package/dist/esm/getTvls.d.ts.map +0 -1
- package/dist/esm/getTvls.js +0 -130
- package/dist/esm/getTvls.js.map +0 -1
- package/dist/esm/getVaultBalances.d.ts +0 -13
- package/dist/esm/getVaultBalances.d.ts.map +0 -1
- package/dist/esm/getVaultBalances.js +0 -96
- package/dist/esm/getVaultBalances.js.map +0 -1
- package/dist/esm/getVaults.d.ts +0 -8
- package/dist/esm/getVaults.d.ts.map +0 -1
- package/dist/esm/getVaults.js +0 -29
- package/dist/esm/getVaults.js.map +0 -1
- package/dist/esm/graphql/client.d.ts +0 -4
- package/dist/esm/graphql/client.d.ts.map +0 -1
- package/dist/esm/graphql/client.js +0 -12
- package/dist/esm/graphql/client.js.map +0 -1
- package/dist/esm/graphql/executeMutations.d.ts +0 -19
- package/dist/esm/graphql/executeMutations.d.ts.map +0 -1
- package/dist/esm/graphql/executeMutations.js +0 -34
- package/dist/esm/graphql/executeMutations.js.map +0 -1
- package/dist/esm/graphql/fetchAutoCompoundingEventsGql.d.ts +0 -28
- package/dist/esm/graphql/fetchAutoCompoundingEventsGql.d.ts.map +0 -1
- package/dist/esm/graphql/fetchAutoCompoundingEventsGql.js +0 -117
- package/dist/esm/graphql/fetchAutoCompoundingEventsGql.js.map +0 -1
- package/dist/esm/graphql/fetchData.d.ts +0 -35
- package/dist/esm/graphql/fetchData.d.ts.map +0 -1
- package/dist/esm/graphql/fetchData.js +0 -89
- package/dist/esm/graphql/fetchData.js.map +0 -1
- package/dist/esm/graphql/fetchNftHolders.d.ts +0 -4
- package/dist/esm/graphql/fetchNftHolders.d.ts.map +0 -1
- package/dist/esm/graphql/fetchNftHolders.js +0 -33
- package/dist/esm/graphql/fetchNftHolders.js.map +0 -1
- package/dist/esm/graphql/fetchReceipts.d.ts +0 -4
- package/dist/esm/graphql/fetchReceipts.d.ts.map +0 -1
- package/dist/esm/graphql/fetchReceipts.js +0 -34
- package/dist/esm/graphql/fetchReceipts.js.map +0 -1
- package/dist/esm/graphql/getMultiReceipts.d.ts +0 -4
- package/dist/esm/graphql/getMultiReceipts.d.ts.map +0 -1
- package/dist/esm/graphql/getMultiReceipts.js +0 -114
- package/dist/esm/graphql/getMultiReceipts.js.map +0 -1
- package/dist/esm/graphql/mutations.d.ts +0 -4
- package/dist/esm/graphql/mutations.d.ts.map +0 -1
- package/dist/esm/graphql/mutations.js +0 -30
- package/dist/esm/graphql/mutations.js.map +0 -1
- package/dist/esm/graphql/parseData.d.ts +0 -3
- package/dist/esm/graphql/parseData.d.ts.map +0 -1
- package/dist/esm/graphql/parseData.js +0 -7
- package/dist/esm/graphql/parseData.js.map +0 -1
- package/dist/esm/graphql/parseLockedTableId.d.ts +0 -8
- package/dist/esm/graphql/parseLockedTableId.d.ts.map +0 -1
- package/dist/esm/graphql/parseLockedTableId.js +0 -13
- package/dist/esm/graphql/parseLockedTableId.js.map +0 -1
- package/dist/esm/graphql/queries/autoCompoundEvents.d.ts +0 -2
- package/dist/esm/graphql/queries/autoCompoundEvents.d.ts.map +0 -1
- package/dist/esm/graphql/queries/autoCompoundEvents.js +0 -16
- package/dist/esm/graphql/queries/autoCompoundEvents.js.map +0 -1
- package/dist/esm/graphql/queries/cetusPools.d.ts +0 -2
- package/dist/esm/graphql/queries/cetusPools.d.ts.map +0 -1
- package/dist/esm/graphql/queries/cetusPools.js +0 -36
- package/dist/esm/graphql/queries/cetusPools.js.map +0 -1
- package/dist/esm/graphql/queries/getMultiReceipts.d.ts +0 -3
- package/dist/esm/graphql/queries/getMultiReceipts.d.ts.map +0 -1
- package/dist/esm/graphql/queries/getMultiReceipts.js +0 -56
- package/dist/esm/graphql/queries/getMultiReceipts.js.map +0 -1
- package/dist/esm/graphql/queries/investors.d.ts +0 -2
- package/dist/esm/graphql/queries/investors.d.ts.map +0 -1
- package/dist/esm/graphql/queries/investors.js +0 -36
- package/dist/esm/graphql/queries/investors.js.map +0 -1
- package/dist/esm/graphql/queries/lockedTableData.d.ts +0 -2
- package/dist/esm/graphql/queries/lockedTableData.d.ts.map +0 -1
- package/dist/esm/graphql/queries/lockedTableData.js +0 -27
- package/dist/esm/graphql/queries/lockedTableData.js.map +0 -1
- package/dist/esm/graphql/queries/lockedTableDataFragment.d.ts +0 -2
- package/dist/esm/graphql/queries/lockedTableDataFragment.d.ts.map +0 -1
- package/dist/esm/graphql/queries/lockedTableDataFragment.js +0 -21
- package/dist/esm/graphql/queries/lockedTableDataFragment.js.map +0 -1
- package/dist/esm/graphql/queries/nftHolders.d.ts +0 -2
- package/dist/esm/graphql/queries/nftHolders.d.ts.map +0 -1
- package/dist/esm/graphql/queries/nftHolders.js +0 -20
- package/dist/esm/graphql/queries/nftHolders.js.map +0 -1
- package/dist/esm/graphql/queries/pools.d.ts +0 -2
- package/dist/esm/graphql/queries/pools.d.ts.map +0 -1
- package/dist/esm/graphql/queries/pools.js +0 -54
- package/dist/esm/graphql/queries/pools.js.map +0 -1
- package/dist/esm/graphql/queries/receiptData.d.ts +0 -2
- package/dist/esm/graphql/queries/receiptData.d.ts.map +0 -1
- package/dist/esm/graphql/queries/receiptData.js +0 -18
- package/dist/esm/graphql/queries/receiptData.js.map +0 -1
- package/dist/esm/graphql/queries/userVaultBalances.d.ts +0 -2
- package/dist/esm/graphql/queries/userVaultBalances.d.ts.map +0 -1
- package/dist/esm/graphql/queries/userVaultBalances.js +0 -59
- package/dist/esm/graphql/queries/userVaultBalances.js.map +0 -1
- package/dist/esm/graphql/queries/userVaults.d.ts +0 -2
- package/dist/esm/graphql/queries/userVaults.d.ts.map +0 -1
- package/dist/esm/graphql/queries/userVaults.js +0 -59
- package/dist/esm/graphql/queries/userVaults.js.map +0 -1
- package/dist/esm/graphql/queries.d.ts +0 -15
- package/dist/esm/graphql/queries.d.ts.map +0 -1
- package/dist/esm/graphql/queries.js +0 -83
- package/dist/esm/graphql/queries.js.map +0 -1
- package/dist/esm/graphql/types.d.ts +0 -112
- package/dist/esm/graphql/types.d.ts.map +0 -1
- package/dist/esm/graphql/types.js +0 -2
- package/dist/esm/graphql/types.js.map +0 -1
- package/dist/esm/sui-sdk/client.d.ts +0 -44
- package/dist/esm/sui-sdk/client.d.ts.map +0 -1
- package/dist/esm/sui-sdk/client.js +0 -82
- package/dist/esm/sui-sdk/client.js.map +0 -1
- package/dist/esm/sui-sdk/events/fetchAfterTransactionEvents.d.ts +0 -10
- package/dist/esm/sui-sdk/events/fetchAfterTransactionEvents.d.ts.map +0 -1
- package/dist/esm/sui-sdk/events/fetchAfterTransactionEvents.js +0 -125
- package/dist/esm/sui-sdk/events/fetchAfterTransactionEvents.js.map +0 -1
- package/dist/esm/sui-sdk/events/fetchAirdropClaimEvent.d.ts +0 -4
- package/dist/esm/sui-sdk/events/fetchAirdropClaimEvent.d.ts.map +0 -1
- package/dist/esm/sui-sdk/events/fetchAirdropClaimEvent.js +0 -17
- package/dist/esm/sui-sdk/events/fetchAirdropClaimEvent.js.map +0 -1
- package/dist/esm/sui-sdk/events/fetchAutoCompoundingEvents.d.ts +0 -9
- package/dist/esm/sui-sdk/events/fetchAutoCompoundingEvents.d.ts.map +0 -1
- package/dist/esm/sui-sdk/events/fetchAutoCompoundingEvents.js +0 -401
- package/dist/esm/sui-sdk/events/fetchAutoCompoundingEvents.js.map +0 -1
- package/dist/esm/sui-sdk/events/fetchCheckRatioEvents.d.ts +0 -4
- package/dist/esm/sui-sdk/events/fetchCheckRatioEvents.d.ts.map +0 -1
- package/dist/esm/sui-sdk/events/fetchCheckRatioEvents.js +0 -44
- package/dist/esm/sui-sdk/events/fetchCheckRatioEvents.js.map +0 -1
- package/dist/esm/sui-sdk/events/fetchEvents.d.ts +0 -4
- package/dist/esm/sui-sdk/events/fetchEvents.d.ts.map +0 -1
- package/dist/esm/sui-sdk/events/fetchEvents.js +0 -450
- package/dist/esm/sui-sdk/events/fetchEvents.js.map +0 -1
- package/dist/esm/sui-sdk/events/fetchLiquidityChangeEvents.d.ts +0 -4
- package/dist/esm/sui-sdk/events/fetchLiquidityChangeEvents.d.ts.map +0 -1
- package/dist/esm/sui-sdk/events/fetchLiquidityChangeEvents.js +0 -42
- package/dist/esm/sui-sdk/events/fetchLiquidityChangeEvents.js.map +0 -1
- package/dist/esm/sui-sdk/events/fetchMultiCategoryEvents.d.ts +0 -9
- package/dist/esm/sui-sdk/events/fetchMultiCategoryEvents.d.ts.map +0 -1
- package/dist/esm/sui-sdk/events/fetchMultiCategoryEvents.js +0 -38
- package/dist/esm/sui-sdk/events/fetchMultiCategoryEvents.js.map +0 -1
- package/dist/esm/sui-sdk/events/fetchRebalanceEvents.d.ts +0 -7
- package/dist/esm/sui-sdk/events/fetchRebalanceEvents.d.ts.map +0 -1
- package/dist/esm/sui-sdk/events/fetchRebalanceEvents.js +0 -86
- package/dist/esm/sui-sdk/events/fetchRebalanceEvents.js.map +0 -1
- package/dist/esm/sui-sdk/events/fetchWithdrawV2Events.d.ts +0 -4
- package/dist/esm/sui-sdk/events/fetchWithdrawV2Events.d.ts.map +0 -1
- package/dist/esm/sui-sdk/events/fetchWithdrawV2Events.js +0 -25
- package/dist/esm/sui-sdk/events/fetchWithdrawV2Events.js.map +0 -1
- package/dist/esm/sui-sdk/events/parseData.d.ts +0 -6
- package/dist/esm/sui-sdk/events/parseData.d.ts.map +0 -1
- package/dist/esm/sui-sdk/events/parseData.js +0 -29
- package/dist/esm/sui-sdk/events/parseData.js.map +0 -1
- package/dist/esm/sui-sdk/events/types.d.ts +0 -238
- package/dist/esm/sui-sdk/events/types.d.ts.map +0 -1
- package/dist/esm/sui-sdk/events/types.js +0 -6
- package/dist/esm/sui-sdk/events/types.js.map +0 -1
- package/dist/esm/sui-sdk/functions/fetchTableData.d.ts +0 -50
- package/dist/esm/sui-sdk/functions/fetchTableData.d.ts.map +0 -1
- package/dist/esm/sui-sdk/functions/fetchTableData.js +0 -73
- package/dist/esm/sui-sdk/functions/fetchTableData.js.map +0 -1
- package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.d.ts +0 -3
- package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.d.ts.map +0 -1
- package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.js +0 -70
- package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.js.map +0 -1
- package/dist/esm/sui-sdk/functions/fetchUserVaults.d.ts +0 -3
- package/dist/esm/sui-sdk/functions/fetchUserVaults.d.ts.map +0 -1
- package/dist/esm/sui-sdk/functions/fetchUserVaults.js +0 -47
- package/dist/esm/sui-sdk/functions/fetchUserVaults.js.map +0 -1
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.d.ts +0 -19
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.d.ts.map +0 -1
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js +0 -303
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js.map +0 -1
- package/dist/esm/sui-sdk/functions/getPositionRange.d.ts +0 -12
- package/dist/esm/sui-sdk/functions/getPositionRange.d.ts.map +0 -1
- package/dist/esm/sui-sdk/functions/getPositionRange.js +0 -84
- package/dist/esm/sui-sdk/functions/getPositionRange.js.map +0 -1
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts +0 -69
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts.map +0 -1
- package/dist/esm/sui-sdk/functions/getReceipts.js +0 -751
- package/dist/esm/sui-sdk/functions/getReceipts.js.map +0 -1
- package/dist/esm/sui-sdk/transactions/constants.d.ts +0 -4
- package/dist/esm/sui-sdk/transactions/constants.d.ts.map +0 -1
- package/dist/esm/sui-sdk/transactions/constants.js +0 -87
- package/dist/esm/sui-sdk/transactions/constants.js.map +0 -1
- package/dist/esm/sui-sdk/transactions/fetchTransactions.d.ts +0 -5
- package/dist/esm/sui-sdk/transactions/fetchTransactions.d.ts.map +0 -1
- package/dist/esm/sui-sdk/transactions/fetchTransactions.js +0 -62
- package/dist/esm/sui-sdk/transactions/fetchTransactions.js.map +0 -1
- package/dist/esm/sui-sdk/transactions/types.d.ts +0 -9
- package/dist/esm/sui-sdk/transactions/types.d.ts.map +0 -1
- package/dist/esm/sui-sdk/transactions/types.js +0 -2
- package/dist/esm/sui-sdk/transactions/types.js.map +0 -1
- package/dist/esm/transactions/7k.d.ts +0 -8
- package/dist/esm/transactions/7k.d.ts.map +0 -1
- package/dist/esm/transactions/7k.js +0 -30
- package/dist/esm/transactions/7k.js.map +0 -1
- package/dist/esm/transactions/alpha.d.ts +0 -6
- package/dist/esm/transactions/alpha.d.ts.map +0 -1
- package/dist/esm/transactions/alpha.js +0 -105
- package/dist/esm/transactions/alpha.js.map +0 -1
- package/dist/esm/transactions/alphaVault.d.ts +0 -33
- package/dist/esm/transactions/alphaVault.d.ts.map +0 -1
- package/dist/esm/transactions/alphaVault.js +0 -441
- package/dist/esm/transactions/alphaVault.js.map +0 -1
- package/dist/esm/transactions/alphalend.d.ts +0 -30
- package/dist/esm/transactions/alphalend.d.ts.map +0 -1
- package/dist/esm/transactions/alphalend.js +0 -277
- package/dist/esm/transactions/alphalend.js.map +0 -1
- package/dist/esm/transactions/blueRewards.d.ts +0 -15
- package/dist/esm/transactions/blueRewards.d.ts.map +0 -1
- package/dist/esm/transactions/blueRewards.js +0 -357
- package/dist/esm/transactions/blueRewards.js.map +0 -1
- package/dist/esm/transactions/bluefin.d.ts +0 -60
- package/dist/esm/transactions/bluefin.d.ts.map +0 -1
- package/dist/esm/transactions/bluefin.js +0 -3060
- package/dist/esm/transactions/bluefin.js.map +0 -1
- package/dist/esm/transactions/bucket.d.ts +0 -8
- package/dist/esm/transactions/bucket.d.ts.map +0 -1
- package/dist/esm/transactions/bucket.js +0 -140
- package/dist/esm/transactions/bucket.js.map +0 -1
- package/dist/esm/transactions/cetus.d.ts +0 -27
- package/dist/esm/transactions/cetus.d.ts.map +0 -1
- package/dist/esm/transactions/cetus.js +0 -457
- package/dist/esm/transactions/cetus.js.map +0 -1
- package/dist/esm/transactions/cetusSwap.d.ts +0 -15
- package/dist/esm/transactions/cetusSwap.d.ts.map +0 -1
- package/dist/esm/transactions/cetusSwap.js +0 -72
- package/dist/esm/transactions/cetusSwap.js.map +0 -1
- package/dist/esm/transactions/collect_rewards.d.ts +0 -11
- package/dist/esm/transactions/collect_rewards.d.ts.map +0 -1
- package/dist/esm/transactions/collect_rewards.js +0 -1286
- package/dist/esm/transactions/collect_rewards.js.map +0 -1
- package/dist/esm/transactions/deposit.d.ts +0 -15
- package/dist/esm/transactions/deposit.d.ts.map +0 -1
- package/dist/esm/transactions/deposit.js +0 -185
- package/dist/esm/transactions/deposit.js.map +0 -1
- package/dist/esm/transactions/get_navi_rewards.d.ts +0 -11
- package/dist/esm/transactions/get_navi_rewards.d.ts.map +0 -1
- package/dist/esm/transactions/get_navi_rewards.js +0 -36
- package/dist/esm/transactions/get_navi_rewards.js.map +0 -1
- package/dist/esm/transactions/navi-looping.d.ts +0 -55
- package/dist/esm/transactions/navi-looping.d.ts.map +0 -1
- package/dist/esm/transactions/navi-looping.js +0 -1703
- package/dist/esm/transactions/navi-looping.js.map +0 -1
- package/dist/esm/transactions/navi.d.ts +0 -9
- package/dist/esm/transactions/navi.d.ts.map +0 -1
- package/dist/esm/transactions/navi.js +0 -2537
- package/dist/esm/transactions/navi.js.map +0 -1
- package/dist/esm/transactions/naviOracle.d.ts +0 -5
- package/dist/esm/transactions/naviOracle.d.ts.map +0 -1
- package/dist/esm/transactions/naviOracle.js +0 -25
- package/dist/esm/transactions/naviOracle.js.map +0 -1
- package/dist/esm/transactions/newZapDeposit.d.ts +0 -19
- package/dist/esm/transactions/newZapDeposit.d.ts.map +0 -1
- package/dist/esm/transactions/newZapDeposit.js +0 -1617
- package/dist/esm/transactions/newZapDeposit.js.map +0 -1
- package/dist/esm/transactions/slush.d.ts +0 -16
- package/dist/esm/transactions/slush.d.ts.map +0 -1
- package/dist/esm/transactions/slush.js +0 -213
- package/dist/esm/transactions/slush.js.map +0 -1
- package/dist/esm/transactions/types.d.ts +0 -17
- package/dist/esm/transactions/types.d.ts.map +0 -1
- package/dist/esm/transactions/types.js +0 -2
- package/dist/esm/transactions/types.js.map +0 -1
- package/dist/esm/transactions/withdraw.d.ts +0 -9
- package/dist/esm/transactions/withdraw.d.ts.map +0 -1
- package/dist/esm/transactions/withdraw.js +0 -127
- package/dist/esm/transactions/withdraw.js.map +0 -1
- package/dist/esm/transactions/zapDeposit.d.ts +0 -6
- package/dist/esm/transactions/zapDeposit.d.ts.map +0 -1
- package/dist/esm/transactions/zapDeposit.js +0 -1727
- package/dist/esm/transactions/zapDeposit.js.map +0 -1
- package/dist/esm/types.d.ts +0 -201
- package/dist/esm/types.d.ts.map +0 -1
- package/dist/esm/types.js +0 -2
- package/dist/esm/types.js.map +0 -1
- package/dist/esm/utils/clmm/prices.d.ts +0 -20
- package/dist/esm/utils/clmm/prices.d.ts.map +0 -1
- package/dist/esm/utils/clmm/prices.js +0 -313
- package/dist/esm/utils/clmm/prices.js.map +0 -1
- package/dist/esm/utils/clmm/tokenAmountFromLiquidity.d.ts +0 -15
- package/dist/esm/utils/clmm/tokenAmountFromLiquidity.d.ts.map +0 -1
- package/dist/esm/utils/clmm/tokenAmountFromLiquidity.js +0 -192
- package/dist/esm/utils/clmm/tokenAmountFromLiquidity.js.map +0 -1
- package/dist/esm/utils/clmm/types.d.ts +0 -25
- package/dist/esm/utils/clmm/types.d.ts.map +0 -1
- package/dist/esm/utils/clmm/types.js +0 -2
- package/dist/esm/utils/clmm/types.js.map +0 -1
- package/dist/esm/utils/getReceipts.d.ts +0 -4
- package/dist/esm/utils/getReceipts.d.ts.map +0 -1
- package/dist/esm/utils/getReceipts.js +0 -44
- package/dist/esm/utils/getReceipts.js.map +0 -1
- package/dist/esm/utils/hop.d.ts +0 -16
- package/dist/esm/utils/hop.d.ts.map +0 -1
- package/dist/esm/utils/hop.js +0 -122
- package/dist/esm/utils/hop.js.map +0 -1
- package/dist/esm/utils/prices.d.ts +0 -15
- package/dist/esm/utils/prices.d.ts.map +0 -1
- package/dist/esm/utils/prices.js +0 -161
- package/dist/esm/utils/prices.js.map +0 -1
- package/dist/esm/utils/simpleCache.d.ts +0 -14
- package/dist/esm/utils/simpleCache.d.ts.map +0 -1
- package/dist/esm/utils/simpleCache.js +0 -88
- package/dist/esm/utils/simpleCache.js.map +0 -1
- package/dist/esm/utils/types.d.ts +0 -5
- package/dist/esm/utils/types.d.ts.map +0 -1
- package/dist/esm/utils/types.js +0 -2
- package/dist/esm/utils/types.js.map +0 -1
- package/dist/esm/utils/userHoldings.d.ts +0 -10
- package/dist/esm/utils/userHoldings.d.ts.map +0 -1
- package/dist/esm/utils/userHoldings.js +0 -223
- package/dist/esm/utils/userHoldings.js.map +0 -1
- package/dist/esm/vaultFunctions.d.ts +0 -8
- package/dist/esm/vaultFunctions.d.ts.map +0 -1
- package/dist/esm/vaultFunctions.js +0 -31
- package/dist/esm/vaultFunctions.js.map +0 -1
- package/docs/assets/hierarchy.js +0 -1
- package/docs/assets/highlight.css +0 -78
- package/docs/assets/icons.js +0 -18
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -60
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1633
- package/docs/functions/addAirdropCoin.html +0 -1
- package/docs/functions/alphaLpBreakdown.html +0 -1
- package/docs/functions/cetusLpBreakdown.html +0 -1
- package/docs/functions/claimAirdropTx.html +0 -1
- package/docs/functions/claimRewardTxb.html +0 -1
- package/docs/functions/claimRewardsTxb.html +0 -1
- package/docs/functions/claimWithdrawAlphaTx.html +0 -1
- package/docs/functions/coinAmountToXTokensDoubleAsset.html +0 -1
- package/docs/functions/coinAmountToXTokensSingleAsset.html +0 -1
- package/docs/functions/coinsInPool.html +0 -1
- package/docs/functions/collectAndSwapRewardsLyf.html +0 -1
- package/docs/functions/collectAndSwapRewardsSingleLoop.html +0 -1
- package/docs/functions/collectRewardTxb.html +0 -1
- package/docs/functions/collectRewards.html +0 -1
- package/docs/functions/collectRewardsAndSwapSlush.html +0 -1
- package/docs/functions/collectUnsuppliedBalance.html +0 -1
- package/docs/functions/deposit.html +0 -1
- package/docs/functions/depositAlphaTx.html +0 -1
- package/docs/functions/depositDoubleAssetTxb.html +0 -1
- package/docs/functions/depositSingleAssetTxb.html +0 -1
- package/docs/functions/fetchAfterTransactionEvents.html +0 -1
- package/docs/functions/fetchAirdropClaimEvents.html +0 -1
- package/docs/functions/fetchAutoCompoundingEvents.html +0 -1
- package/docs/functions/fetchAutoCompoundingEventsGql.html +0 -1
- package/docs/functions/fetchCetusPools.html +0 -1
- package/docs/functions/fetchChainIdentifier.html +0 -1
- package/docs/functions/fetchCheckRatioEvents.html +0 -1
- package/docs/functions/fetchEvents.html +0 -1
- package/docs/functions/fetchLiquidityChangeEvents.html +0 -1
- package/docs/functions/fetchMultiCategoryEvents.html +0 -1
- package/docs/functions/fetchMultiReceipts.html +0 -1
- package/docs/functions/fetchNftHolders.html +0 -1
- package/docs/functions/fetchPools.html +0 -1
- package/docs/functions/fetchPortfolioData.html +0 -1
- package/docs/functions/fetchProtocolData.html +0 -1
- package/docs/functions/fetchRequiredPrices.html +0 -1
- package/docs/functions/fetchTVL.html +0 -1
- package/docs/functions/fetchTransactions.html +0 -1
- package/docs/functions/fetchUserVaultBalances.html +0 -1
- package/docs/functions/fetchUserVaults.html +0 -1
- package/docs/functions/fetchUserWalletData.html +0 -1
- package/docs/functions/fetchVoloExchangeRate.html +0 -1
- package/docs/functions/fetchWithdrawV2Events.html +0 -1
- package/docs/functions/getAirdropShare.html +0 -1
- package/docs/functions/getAllDoubleAssetVaults.html +0 -1
- package/docs/functions/getAllSingleAssetVaults.html +0 -1
- package/docs/functions/getAllVaultBalances.html +0 -1
- package/docs/functions/getAllVaults.html +0 -1
- package/docs/functions/getAlphaUnlocks.html +0 -1
- package/docs/functions/getAlphaVaultBalance.html +0 -1
- package/docs/functions/getAmounts.html +0 -1
- package/docs/functions/getApr.html +0 -1
- package/docs/functions/getAprs.html +0 -1
- package/docs/functions/getApy.html +0 -1
- package/docs/functions/getApys.html +0 -1
- package/docs/functions/getCetusInvestorTicksMap.html +0 -1
- package/docs/functions/getCetusPool.html +0 -1
- package/docs/functions/getCetusSqrtPriceMap.html +0 -1
- package/docs/functions/getCoinAmountsFromLiquidity.html +0 -1
- package/docs/functions/getConf.html +0 -1
- package/docs/functions/getCurrentTick.html +0 -1
- package/docs/functions/getDistributor.html +0 -1
- package/docs/functions/getDoubleAssetVaultBalance.html +0 -1
- package/docs/functions/getDoubleAssetVaults.html +0 -1
- package/docs/functions/getInvestor.html +0 -1
- package/docs/functions/getInvestorPoolMap.html +0 -1
- package/docs/functions/getLastAutoCompoundTime.html +0 -1
- package/docs/functions/getLatestPrices.html +0 -1
- package/docs/functions/getLiquidity.html +0 -1
- package/docs/functions/getMultiCetusPool.html +0 -1
- package/docs/functions/getMultiInvestor.html +0 -1
- package/docs/functions/getMultiLatestPrices.html +0 -1
- package/docs/functions/getMultiParentPool.html +0 -1
- package/docs/functions/getMultiPool.html +0 -1
- package/docs/functions/getMultiReceipts.html +0 -1
- package/docs/functions/getParentPool.html +0 -1
- package/docs/functions/getPool.html +0 -1
- package/docs/functions/getPoolExchangeRate.html +0 -1
- package/docs/functions/getPoolExchangeRateMap.html +0 -1
- package/docs/functions/getPoolsWeightDistribution.html +0 -1
- package/docs/functions/getPositionRange.html +0 -1
- package/docs/functions/getPositionRanges.html +0 -1
- package/docs/functions/getPositionTicks.html +0 -1
- package/docs/functions/getPriceToTick.html +0 -1
- package/docs/functions/getRebalanceCap.html +0 -1
- package/docs/functions/getRebalanceHistories.html +0 -1
- package/docs/functions/getRebalanceHistory.html +0 -1
- package/docs/functions/getReceipts.html +0 -1
- package/docs/functions/getSingleAssetVaultBalance.html +0 -1
- package/docs/functions/getSingleAssetVaults.html +0 -1
- package/docs/functions/getSlushUserTotalXtokens.html +0 -1
- package/docs/functions/getSuiClient.html +0 -3
- package/docs/functions/getSuiNodeUrl.html +0 -3
- package/docs/functions/getTVLs-1.html +0 -1
- package/docs/functions/getTickSpacing.html +0 -1
- package/docs/functions/getTickToPrice.html +0 -1
- package/docs/functions/getTvls.html +0 -1
- package/docs/functions/getVaultBalance.html +0 -1
- package/docs/functions/getVaults.html +0 -1
- package/docs/functions/getWithdrawRequestsAndUnsuppliedAmount.html +0 -1
- package/docs/functions/initiateWithdrawAlpha.html +0 -1
- package/docs/functions/lastAutocompoundTime.html +0 -1
- package/docs/functions/liquidityToTokens.html +0 -1
- package/docs/functions/migrateBoostedToLoop.html +0 -1
- package/docs/functions/multiLiquidityToTokens.html +0 -1
- package/docs/functions/multiTokensToUsd.html +0 -1
- package/docs/functions/multiXTokensToLiquidity.html +0 -1
- package/docs/functions/parseUserWalletData.html +0 -1
- package/docs/functions/pendingRewardAmount.html +0 -1
- package/docs/functions/processWithdrawRequestsManual.html +0 -1
- package/docs/functions/setCustomSuiClient.html +0 -5
- package/docs/functions/setSuiClient.html +0 -7
- package/docs/functions/setSuiNodeUrl.html +0 -5
- package/docs/functions/setWeights.html +0 -1
- package/docs/functions/slushDeposit.html +0 -1
- package/docs/functions/slushWithdraw.html +0 -1
- package/docs/functions/updateSingleTokenPrice.html +0 -1
- package/docs/functions/withdraw.html +0 -1
- package/docs/functions/withdrawAlphaTxb.html +0 -1
- package/docs/functions/withdrawTxb.html +0 -1
- package/docs/functions/zapDepositQuoteTxb.html +0 -1
- package/docs/functions/zapDepositTxb.html +0 -1
- package/docs/hierarchy.html +0 -1
- package/docs/index.html +0 -82
- package/docs/interfaces/Coin.html +0 -12
- package/docs/interfaces/CoinPair.html +0 -3
- package/docs/interfaces/CommonEventAttributes.html +0 -7
- package/docs/interfaces/NaviVoloData.html +0 -3
- package/docs/interfaces/PoolData.html +0 -8
- package/docs/interfaces/PoolWeightDistribution.html +0 -4
- package/docs/interfaces/RebalanceHistoryType.html +0 -9
- package/docs/modules.html +0 -1
- package/docs/types/AfterTransactionEventNode.html +0 -1
- package/docs/types/AirdropClaimEventNode.html +0 -1
- package/docs/types/Allocator.html +0 -3
- package/docs/types/AlphaFiDoubleAssetVault.html +0 -9
- package/docs/types/AlphaFiMultiVaultBalance.html +0 -1
- package/docs/types/AlphaFiSingleAssetVault.html +0 -7
- package/docs/types/AlphaFiVault.html +0 -1
- package/docs/types/AlphaFiVaultBalance.html +0 -1
- package/docs/types/AlphaLendInvestor.html +0 -1
- package/docs/types/AlphaPoolType.html +0 -5
- package/docs/types/AlphaReceipt.html +0 -4
- package/docs/types/AlphaReceiptFields.html +0 -11
- package/docs/types/AlphaVaultBalance.html +0 -7
- package/docs/types/AutoBalancePoolNames.html +0 -1
- package/docs/types/AutoCompoundingEventNode.html +0 -1
- package/docs/types/Bag.html +0 -3
- package/docs/types/BluefinInvestor.html +0 -1
- package/docs/types/BluefinLyfInvestor.html +0 -1
- package/docs/types/BluefinPoolType.html +0 -5
- package/docs/types/BucketInvestor.html +0 -2
- package/docs/types/CetusInvestor.html +0 -2
- package/docs/types/CetusPoolType.html +0 -5
- package/docs/types/CetusSwapOptions.html +0 -1
- package/docs/types/CoinAmounts.html +0 -3
- package/docs/types/CoinName.html +0 -1
- package/docs/types/CoinType.html +0 -1
- package/docs/types/CommonInvestorFields.html +0 -6
- package/docs/types/CreatePoolOptions.html +0 -8
- package/docs/types/Distributor.html +0 -6
- package/docs/types/DoubleAssetMultiVaultBalance.html +0 -6
- package/docs/types/DoubleAssetPoolNames.html +0 -1
- package/docs/types/DoubleAssetTokenHoldings.html +0 -5
- package/docs/types/DoubleAssetVaultBalance.html +0 -4
- package/docs/types/EventCategory.html +0 -1
- package/docs/types/EventNode.html +0 -1
- package/docs/types/GetHoldersParams.html +0 -4
- package/docs/types/GetTokenHoldingsParams.html +0 -4
- package/docs/types/GetUserTokensFromTransactionsParams.html +0 -5
- package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +0 -6
- package/docs/types/GetVaultBalanceParams.html +0 -1
- package/docs/types/HoldingsObj.html +0 -4
- package/docs/types/Icon.html +0 -1
- package/docs/types/Investor.html +0 -1
- package/docs/types/LiquidityChangeEventNode.html +0 -1
- package/docs/types/LiquidityToTokensParams.html +0 -3
- package/docs/types/LiquidityToUsdParams.html +0 -6
- package/docs/types/LoopingDebt.html +0 -5
- package/docs/types/LoopingPoolNames.html +0 -1
- package/docs/types/LpBreakdownType.html +0 -6
- package/docs/types/MemberPoolDataType.html +0 -3
- package/docs/types/MemberType.html +0 -3
- package/docs/types/MultiGetVaultBalancesParams.html +0 -4
- package/docs/types/NaviInvestor.html +0 -2
- package/docs/types/ObjectTable.html +0 -1
- package/docs/types/OtherReceiptFields.html +0 -9
- package/docs/types/PoolName.html +0 -1
- package/docs/types/PoolReceipt.html +0 -1
- package/docs/types/PoolType.html +0 -5
- package/docs/types/Receipt.html +0 -5
- package/docs/types/ReceiptGQL.html +0 -6
- package/docs/types/SingleAssetMultiVaultBalance.html +0 -5
- package/docs/types/SingleAssetPoolNames.html +0 -1
- package/docs/types/SingleAssetTokenHoldings.html +0 -4
- package/docs/types/SingleAssetVaultBalance.html +0 -3
- package/docs/types/SingleGetVaultBalancesParams.html +0 -3
- package/docs/types/StrategyType.html +0 -1
- package/docs/types/SuiNetwork.html +0 -1
- package/docs/types/SwapOptions.html +0 -1
- package/docs/types/TickSpacing.html +0 -1
- package/docs/types/TotalWeightType.html +0 -3
- package/docs/types/TransactionBlockType.html +0 -6
- package/docs/types/UserPoolLiquidity.html +0 -4
- package/docs/types/UserPoolTokenHoldings.html +0 -1
- package/docs/types/UserUsdHoldings.html +0 -4
- package/docs/types/VaultBalance.html +0 -1
- package/docs/types/VecMap.html +0 -3
- package/docs/types/VoteCastEvent.html +0 -1
- package/docs/types/WithdrawV2EventNode.html +0 -1
- package/docs/variables/AUTOBALANCE_SUI_FIRST_POOLS.html +0 -1
- package/docs/variables/AUTOBALANCE_SUI_SECOND_POOLS.html +0 -1
- package/docs/variables/AUTOBALANCE_TYPE_1_POOLS.html +0 -1
- package/docs/variables/alphalendMarketIdMap.html +0 -1
- package/docs/variables/bluefinPoolMap.html +0 -1
- package/docs/variables/cetusPoolMap.html +0 -1
- package/docs/variables/coinsList.html +0 -1
- package/docs/variables/defunctPoolsSet.html +0 -1
- package/docs/variables/doubleAssetPoolCoinMap.html +0 -1
- package/docs/variables/eventCategories.html +0 -1
- package/docs/variables/ignoredWalletsForDailyRevenue.html +0 -1
- package/docs/variables/loopingAccountAddresses.html +0 -1
- package/docs/variables/loopingPoolCoinMap.html +0 -1
- package/docs/variables/naviAssetMap.html +0 -1
- package/docs/variables/naviPriceFeedMap.html +0 -1
- package/docs/variables/poolIdPoolNameMap.html +0 -1
- package/docs/variables/poolInfo.html +0 -1
- package/docs/variables/singleAssetPoolCoinMap.html +0 -1
- package/docs/variables/stableCoins.html +0 -1
- package/eslint.config.js +0 -53
- package/prettier.config.js +0 -3
- package/scripts/package-lock.json +0 -2506
- package/scripts/package.json +0 -30
- package/scripts/testRun.ts +0 -117
- package/scripts/utils.ts +0 -108
- /package/dist/cjs/{common → models}/types.js +0 -0
- /package/dist/esm/{common → models}/types.js +0 -0
|
@@ -0,0 +1,1452 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LP Strategy
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LpStrategy = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
const decimal_js_1 = require("decimal.js");
|
|
9
|
+
const strategy_js_1 = require("./strategy.js");
|
|
10
|
+
const bn_js_1 = tslib_1.__importDefault(require("bn.js"));
|
|
11
|
+
const cetus_sui_clmm_sdk_1 = require("@cetusprotocol/cetus-sui-clmm-sdk");
|
|
12
|
+
const constants_js_1 = require("../utils/constants.js");
|
|
13
|
+
/**
|
|
14
|
+
* LP Strategy for dual-asset liquidity pools
|
|
15
|
+
*/
|
|
16
|
+
class LpStrategy extends strategy_js_1.BaseStrategy {
|
|
17
|
+
poolLabel;
|
|
18
|
+
poolObject;
|
|
19
|
+
investorObject;
|
|
20
|
+
parentPoolObject;
|
|
21
|
+
receiptObjects = [];
|
|
22
|
+
context;
|
|
23
|
+
constructor(poolLabel, poolObject, investorObject, parentPoolObject, context) {
|
|
24
|
+
super();
|
|
25
|
+
this.poolLabel = poolLabel;
|
|
26
|
+
this.poolObject = this.parsePoolObject(poolObject);
|
|
27
|
+
this.investorObject = this.parseInvestorObject(investorObject);
|
|
28
|
+
this.context = context;
|
|
29
|
+
this.parentPoolObject = this.parseParentPoolObject(parentPoolObject);
|
|
30
|
+
}
|
|
31
|
+
getPoolLabel() {
|
|
32
|
+
return this.poolLabel;
|
|
33
|
+
}
|
|
34
|
+
updateReceipts(receipts) {
|
|
35
|
+
this.receiptObjects = this.parseReceiptObjects(receipts);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get alpha mining data including pool and receipt information
|
|
39
|
+
*/
|
|
40
|
+
getAlphaMiningData() {
|
|
41
|
+
const receipt = this.receiptObjects.length > 0 ? this.receiptObjects[0] : null;
|
|
42
|
+
return {
|
|
43
|
+
poolId: this.poolLabel.poolId,
|
|
44
|
+
accRewardsPerXtoken: this.poolObject.accRewardsPerXtoken,
|
|
45
|
+
xTokenSupply: this.poolObject.xTokenSupply,
|
|
46
|
+
receipt: receipt
|
|
47
|
+
? {
|
|
48
|
+
lastAccRewardPerXtoken: receipt.lastAccRewardPerXtoken,
|
|
49
|
+
pendingRewards: receipt.pendingRewards,
|
|
50
|
+
xTokenBalance: receipt.xTokenBalance,
|
|
51
|
+
}
|
|
52
|
+
: null,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get the exchange rate for xtoken to underlying token ratio
|
|
57
|
+
* Calculated as tokens_invested / xtoken_supply
|
|
58
|
+
*/
|
|
59
|
+
exchangeRate() {
|
|
60
|
+
const tokensInvested = new decimal_js_1.Decimal(this.poolObject.tokensInvested);
|
|
61
|
+
const xtokenSupply = new decimal_js_1.Decimal(this.poolObject.xTokenSupply);
|
|
62
|
+
if (xtokenSupply.isZero()) {
|
|
63
|
+
return new decimal_js_1.Decimal(1); // Default exchange rate when no tokens are supplied
|
|
64
|
+
}
|
|
65
|
+
return tokensInvested.div(xtokenSupply);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get comprehensive pool data including TVL, LP breakdown, price, and position range
|
|
69
|
+
*/
|
|
70
|
+
async getData() {
|
|
71
|
+
const [alphafi, parent, lpBreakdown, parentLpBreakdown, currentLPPoolPrice, positionRange, apr,] = await Promise.all([
|
|
72
|
+
this.getTvl(),
|
|
73
|
+
this.getParentTvl(),
|
|
74
|
+
this.getLpBreakdown(),
|
|
75
|
+
this.getParentLpBreakdown(),
|
|
76
|
+
this.getCurrentLPPoolPrice(),
|
|
77
|
+
this.getPositionRange(),
|
|
78
|
+
this.context.getAprData(this.poolLabel.poolId),
|
|
79
|
+
]);
|
|
80
|
+
return {
|
|
81
|
+
poolId: this.poolLabel.poolId,
|
|
82
|
+
strategyType: this.poolLabel.strategyType,
|
|
83
|
+
coinAType: this.poolLabel.assetA.type,
|
|
84
|
+
coinBType: this.poolLabel.assetB.type,
|
|
85
|
+
poolName: this.poolLabel.poolName,
|
|
86
|
+
apr,
|
|
87
|
+
tvl: {
|
|
88
|
+
alphafi,
|
|
89
|
+
parent,
|
|
90
|
+
},
|
|
91
|
+
lpBreakdown,
|
|
92
|
+
parentLpBreakdown,
|
|
93
|
+
currentLPPoolPrice,
|
|
94
|
+
positionRange,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Calculate total value locked using current asset prices and token amounts
|
|
99
|
+
*/
|
|
100
|
+
async getTvl() {
|
|
101
|
+
const coinTypeA = this.poolLabel.assetA.type;
|
|
102
|
+
const coinTypeB = this.poolLabel.assetB.type;
|
|
103
|
+
const priceA = await this.context.getCoinPrice(coinTypeA);
|
|
104
|
+
const priceB = await this.context.getCoinPrice(coinTypeB);
|
|
105
|
+
const { amountA, amountB } = await this.getTokenAmounts(this.poolObject.tokensInvested);
|
|
106
|
+
const usdValue = amountA.mul(priceA).add(amountB.mul(priceB));
|
|
107
|
+
return { tokenAmountA: amountA, tokenAmountB: amountB, usdValue };
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Calculate parent pool TVL from underlying protocol reserves
|
|
111
|
+
*/
|
|
112
|
+
async getParentTvl() {
|
|
113
|
+
const coinTypeA = this.poolLabel.assetA.type;
|
|
114
|
+
const coinTypeB = this.poolLabel.assetB.type;
|
|
115
|
+
const decimalsA = await this.context.getCoinDecimals(coinTypeA);
|
|
116
|
+
const decimalsB = await this.context.getCoinDecimals(coinTypeB);
|
|
117
|
+
const priceA = await this.context.getCoinPrice(coinTypeA);
|
|
118
|
+
const priceB = await this.context.getCoinPrice(coinTypeB);
|
|
119
|
+
const tokenAmountA = new decimal_js_1.Decimal(this.parentPoolObject.coinA).div(new decimal_js_1.Decimal(10).pow(decimalsA));
|
|
120
|
+
const tokenAmountB = new decimal_js_1.Decimal(this.parentPoolObject.coinB).div(new decimal_js_1.Decimal(10).pow(decimalsB));
|
|
121
|
+
const usdValue = tokenAmountA.mul(priceA).add(tokenAmountB.mul(priceB));
|
|
122
|
+
return { tokenAmountA, tokenAmountB, usdValue };
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get LP token breakdown showing individual asset amounts and total liquidity
|
|
126
|
+
*/
|
|
127
|
+
async getLpBreakdown() {
|
|
128
|
+
const liquidity = this.poolObject.tokensInvested;
|
|
129
|
+
const { amountA, amountB } = await this.getTokenAmounts(liquidity);
|
|
130
|
+
const totalLiquidity = new decimal_js_1.Decimal(liquidity).div(new decimal_js_1.Decimal(1e9));
|
|
131
|
+
return {
|
|
132
|
+
token1Amount: amountA,
|
|
133
|
+
token2Amount: amountB,
|
|
134
|
+
totalLiquidity,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get parent pool LP breakdown from underlying protocol
|
|
139
|
+
*/
|
|
140
|
+
async getParentLpBreakdown() {
|
|
141
|
+
const coinTypeA = this.poolLabel.assetA.type;
|
|
142
|
+
const coinTypeB = this.poolLabel.assetB.type;
|
|
143
|
+
const decimalsA = await this.context.getCoinDecimals(coinTypeA);
|
|
144
|
+
const decimalsB = await this.context.getCoinDecimals(coinTypeB);
|
|
145
|
+
const token1Amount = new decimal_js_1.Decimal(this.parentPoolObject.coinA).div(new decimal_js_1.Decimal(10).pow(decimalsA));
|
|
146
|
+
const token2Amount = new decimal_js_1.Decimal(this.parentPoolObject.coinB).div(new decimal_js_1.Decimal(10).pow(decimalsB));
|
|
147
|
+
const totalLiquidity = new decimal_js_1.Decimal(this.parentPoolObject.liquidity).div(new decimal_js_1.Decimal(1e9));
|
|
148
|
+
return { token1Amount, token2Amount, totalLiquidity };
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get current LP pool price from tick index
|
|
152
|
+
*/
|
|
153
|
+
async getCurrentLPPoolPrice() {
|
|
154
|
+
const coinTypeA = this.poolLabel.assetA.type;
|
|
155
|
+
const coinTypeB = this.poolLabel.assetB.type;
|
|
156
|
+
const decimalsA = await this.context.getCoinDecimals(coinTypeA);
|
|
157
|
+
const decimalsB = await this.context.getCoinDecimals(coinTypeB);
|
|
158
|
+
let currentTick = this.parentPoolObject.currentTickIndex;
|
|
159
|
+
const upperBound = 443636;
|
|
160
|
+
if (currentTick > upperBound) {
|
|
161
|
+
currentTick = -~(currentTick - 1);
|
|
162
|
+
}
|
|
163
|
+
const price = cetus_sui_clmm_sdk_1.TickMath.tickIndexToPrice(currentTick, decimalsA, decimalsB);
|
|
164
|
+
return new decimal_js_1.Decimal(price.toString());
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get position price range from lower and upper tick bounds
|
|
168
|
+
*/
|
|
169
|
+
async getPositionRange() {
|
|
170
|
+
const coinTypeA = this.poolLabel.assetA.type;
|
|
171
|
+
const coinTypeB = this.poolLabel.assetB.type;
|
|
172
|
+
const decimalsA = await this.context.getCoinDecimals(coinTypeA);
|
|
173
|
+
const decimalsB = await this.context.getCoinDecimals(coinTypeB);
|
|
174
|
+
const upperBound = 443636;
|
|
175
|
+
let lowerTick = this.investorObject.lowerTick;
|
|
176
|
+
let upperTick = this.investorObject.upperTick;
|
|
177
|
+
if (lowerTick > upperBound) {
|
|
178
|
+
lowerTick = -~(lowerTick - 1);
|
|
179
|
+
}
|
|
180
|
+
if (upperTick > upperBound) {
|
|
181
|
+
upperTick = -~(upperTick - 1);
|
|
182
|
+
}
|
|
183
|
+
const lower = cetus_sui_clmm_sdk_1.TickMath.tickIndexToPrice(lowerTick, decimalsA, decimalsB);
|
|
184
|
+
const upper = cetus_sui_clmm_sdk_1.TickMath.tickIndexToPrice(upperTick, decimalsA, decimalsB);
|
|
185
|
+
return { lowerPrice: new decimal_js_1.Decimal(lower.toString()), upperPrice: new decimal_js_1.Decimal(upper.toString()) };
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Calculate user's current pool balance from receipt objects
|
|
189
|
+
* Converts xToken balance to underlying assets and USD value
|
|
190
|
+
*/
|
|
191
|
+
async getBalance(_userAddress) {
|
|
192
|
+
if (this.receiptObjects.length === 0 || this.receiptObjects[0].xTokenBalance === '0') {
|
|
193
|
+
return {
|
|
194
|
+
tokenAAmount: new decimal_js_1.Decimal(0),
|
|
195
|
+
tokenBAmount: new decimal_js_1.Decimal(0),
|
|
196
|
+
usdValue: new decimal_js_1.Decimal(0),
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
const xTokens = new decimal_js_1.Decimal(this.receiptObjects[0].xTokenBalance);
|
|
200
|
+
const exchangeRate = this.exchangeRate();
|
|
201
|
+
const coinTypeA = this.poolLabel.assetA.type;
|
|
202
|
+
const coinTypeB = this.poolLabel.assetB.type;
|
|
203
|
+
const [priceA, priceB] = await Promise.all([
|
|
204
|
+
this.context.getCoinPrice(coinTypeA),
|
|
205
|
+
this.context.getCoinPrice(coinTypeB),
|
|
206
|
+
]);
|
|
207
|
+
const tokens = xTokens.mul(exchangeRate);
|
|
208
|
+
const { amountA, amountB } = await this.getTokenAmounts(tokens.floor().toString());
|
|
209
|
+
const usdValue = amountA.mul(priceA).add(amountB.mul(priceB));
|
|
210
|
+
return { tokenAAmount: amountA, tokenBAmount: amountB, usdValue };
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Calculate token A and B amounts from liquidity using Cetus CLMM SDK
|
|
214
|
+
*/
|
|
215
|
+
async getTokenAmounts(liquidity) {
|
|
216
|
+
const coinTypeA = this.poolLabel.assetA.type;
|
|
217
|
+
const coinTypeB = this.poolLabel.assetB.type;
|
|
218
|
+
const scalingA = new decimal_js_1.Decimal(10).pow(await this.context.getCoinDecimals(coinTypeA));
|
|
219
|
+
const scalingB = new decimal_js_1.Decimal(10).pow(await this.context.getCoinDecimals(coinTypeB));
|
|
220
|
+
const liquidityBN = new bn_js_1.default(new decimal_js_1.Decimal(liquidity).toFixed(0));
|
|
221
|
+
const currentSqrtPriceBN = new bn_js_1.default(this.parentPoolObject.currentSqrtPrice);
|
|
222
|
+
const upperBound = 443636;
|
|
223
|
+
let lowerTick = this.investorObject.lowerTick;
|
|
224
|
+
let upperTick = this.investorObject.upperTick;
|
|
225
|
+
if (lowerTick > upperBound) {
|
|
226
|
+
lowerTick = -~(lowerTick - 1);
|
|
227
|
+
}
|
|
228
|
+
if (upperTick > upperBound) {
|
|
229
|
+
upperTick = -~(upperTick - 1);
|
|
230
|
+
}
|
|
231
|
+
const lowerSqrtPriceBN = cetus_sui_clmm_sdk_1.TickMath.tickIndexToSqrtPriceX64(lowerTick);
|
|
232
|
+
const upperSqrtPriceBN = cetus_sui_clmm_sdk_1.TickMath.tickIndexToSqrtPriceX64(upperTick);
|
|
233
|
+
const amounts = cetus_sui_clmm_sdk_1.ClmmPoolUtil.getCoinAmountFromLiquidity(liquidityBN, currentSqrtPriceBN, lowerSqrtPriceBN, upperSqrtPriceBN, false);
|
|
234
|
+
const amountA = new decimal_js_1.Decimal(amounts.coinA.toString()).div(scalingA);
|
|
235
|
+
const amountB = new decimal_js_1.Decimal(amounts.coinB.toString()).div(scalingB);
|
|
236
|
+
return { amountA, amountB };
|
|
237
|
+
}
|
|
238
|
+
getLiquidity(amount, isAmountA) {
|
|
239
|
+
const upperBound = 443636;
|
|
240
|
+
let lowerTick = this.investorObject.lowerTick;
|
|
241
|
+
let upperTick = this.investorObject.upperTick;
|
|
242
|
+
if (lowerTick > upperBound) {
|
|
243
|
+
lowerTick = -~(lowerTick - 1);
|
|
244
|
+
}
|
|
245
|
+
if (upperTick > upperBound) {
|
|
246
|
+
upperTick = -~(upperTick - 1);
|
|
247
|
+
}
|
|
248
|
+
const currentSqrtPriceBN = new bn_js_1.default(this.parentPoolObject.currentSqrtPrice);
|
|
249
|
+
return cetus_sui_clmm_sdk_1.ClmmPoolUtil.estLiquidityAndcoinAmountFromOneAmounts(lowerTick, upperTick, new bn_js_1.default(`${Math.floor(parseFloat(amount))}`), isAmountA, false, 0.5, currentSqrtPriceBN);
|
|
250
|
+
}
|
|
251
|
+
getOtherAmount(amount, isAmountA) {
|
|
252
|
+
const liquidity = this.getLiquidity(amount, isAmountA);
|
|
253
|
+
return [liquidity.coinAmountA.toString(), liquidity.coinAmountB.toString()];
|
|
254
|
+
}
|
|
255
|
+
coinAmountToXToken(amount, isAmountA) {
|
|
256
|
+
const liquidity = new decimal_js_1.Decimal(this.getLiquidity(amount, isAmountA).liquidityAmount.toString());
|
|
257
|
+
const exchangeRate = this.exchangeRate();
|
|
258
|
+
return liquidity.div(exchangeRate).floor().toString();
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Parse pool object from blockchain response
|
|
262
|
+
*/
|
|
263
|
+
parsePoolObject(response) {
|
|
264
|
+
return this.safeParseObject(() => {
|
|
265
|
+
const fields = this.extractFields(response);
|
|
266
|
+
return {
|
|
267
|
+
accRewardsPerXtoken: this.parseVecMap(fields.acc_rewards_per_xtoken || {}),
|
|
268
|
+
depositFee: this.getStringField(fields, 'deposit_fee'),
|
|
269
|
+
depositFeeMaxCap: this.getStringField(fields, 'deposit_fee_max_cap'),
|
|
270
|
+
id: this.getStringField(fields, 'id'),
|
|
271
|
+
imageUrl: this.getStringField(fields, 'image_url'),
|
|
272
|
+
name: this.getStringField(fields, 'name'),
|
|
273
|
+
paused: this.getBooleanField(fields, 'paused', false),
|
|
274
|
+
rewards: (() => {
|
|
275
|
+
const idVal = this.getNestedField(fields, 'rewards.id');
|
|
276
|
+
const sizeVal = this.getNestedField(fields, 'rewards.size');
|
|
277
|
+
return { id: String(idVal), size: String(sizeVal) };
|
|
278
|
+
})(),
|
|
279
|
+
tokensInvested: this.getStringField(fields, 'tokensInvested'),
|
|
280
|
+
withdrawFeeMaxCap: this.getStringField(fields, 'withdraw_fee_max_cap'),
|
|
281
|
+
withdrawalFee: this.getStringField(fields, 'withdrawal_fee'),
|
|
282
|
+
xTokenSupply: this.getStringField(fields, 'xTokenSupply'),
|
|
283
|
+
};
|
|
284
|
+
}, `Failed to parse LP pool object (poolId=${this.poolLabel.poolId})`);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Parse investor object from blockchain response
|
|
288
|
+
*/
|
|
289
|
+
parseInvestorObject(response) {
|
|
290
|
+
return this.safeParseObject(() => {
|
|
291
|
+
const fields = this.extractFields(response);
|
|
292
|
+
return {
|
|
293
|
+
emergencyBalanceA: this.getStringField(fields, 'emergency_balance_a'),
|
|
294
|
+
emergencyBalanceB: this.getStringField(fields, 'emergency_balance_b'),
|
|
295
|
+
freeBalanceA: this.getStringField(fields, 'free_balance_a'),
|
|
296
|
+
freeBalanceB: this.getStringField(fields, 'free_balance_b'),
|
|
297
|
+
freeRewards: (() => {
|
|
298
|
+
const idVal = this.getNestedField(fields, 'free_rewards.id');
|
|
299
|
+
const sizeVal = this.getNestedField(fields, 'free_rewards.size');
|
|
300
|
+
return { id: String(idVal), size: String(sizeVal) };
|
|
301
|
+
})(),
|
|
302
|
+
id: this.getStringField(fields, 'id'),
|
|
303
|
+
isEmergency: this.getBooleanField(fields, 'is_emergency', false),
|
|
304
|
+
lowerTick: this.getNumberField(fields, 'lower_tick'),
|
|
305
|
+
minimumSwapAmount: this.getStringField(fields, 'minimum_swap_amount'),
|
|
306
|
+
performanceFee: this.getStringField(fields, 'performance_fee'),
|
|
307
|
+
performanceFeeMaxCap: this.getStringField(fields, 'performance_fee_max_cap'),
|
|
308
|
+
upperTick: this.getNumberField(fields, 'upper_tick'),
|
|
309
|
+
};
|
|
310
|
+
}, `Failed to parse LP investor object (poolId=${this.poolLabel.poolId})`);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Parse parent pool object from blockchain response
|
|
314
|
+
*/
|
|
315
|
+
parseParentPoolObject(response) {
|
|
316
|
+
return this.safeParseObject(() => {
|
|
317
|
+
const fields = this.extractFields(response);
|
|
318
|
+
return {
|
|
319
|
+
coinA: this.getStringField(fields, 'coin_a'),
|
|
320
|
+
coinB: this.getStringField(fields, 'coin_b'),
|
|
321
|
+
currentSqrtPrice: this.getStringField(fields, 'current_sqrt_price'),
|
|
322
|
+
currentTickIndex: this.getNestedField(fields, 'current_tick_index.bits'),
|
|
323
|
+
id: this.getStringField(fields, 'id'),
|
|
324
|
+
liquidity: this.getStringField(fields, 'liquidity'),
|
|
325
|
+
};
|
|
326
|
+
}, `Failed to parse LP parent pool object (poolId=${this.poolLabel.poolId})`);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Parse receipt objects from blockchain responses
|
|
330
|
+
*/
|
|
331
|
+
parseReceiptObjects(responses) {
|
|
332
|
+
return responses
|
|
333
|
+
.map((response, index) => {
|
|
334
|
+
return this.safeParseObject(() => {
|
|
335
|
+
const fields = this.extractFields(response);
|
|
336
|
+
return {
|
|
337
|
+
id: this.getStringField(fields, 'id'),
|
|
338
|
+
imageUrl: this.getStringField(fields, 'image_url'),
|
|
339
|
+
lastAccRewardPerXtoken: this.parseVecMap(fields.last_acc_reward_per_xtoken || {}),
|
|
340
|
+
owner: this.getStringField(fields, 'owner'),
|
|
341
|
+
name: this.getStringField(fields, 'name'),
|
|
342
|
+
pendingRewards: this.parseVecMap(fields.pending_rewards || {}),
|
|
343
|
+
poolId: this.getStringField(fields, 'pool_id'),
|
|
344
|
+
xTokenBalance: this.getStringField(fields, 'xTokenBalance'),
|
|
345
|
+
};
|
|
346
|
+
}, `Failed to parse LP receipt object at index ${index}`);
|
|
347
|
+
})
|
|
348
|
+
.filter((receipt) => receipt.poolId === this.poolLabel.poolId);
|
|
349
|
+
}
|
|
350
|
+
async depositBluefinSuiFirstTx(tx, receiptOption, depositCoinA, depositCoinB) {
|
|
351
|
+
const [blueCoin, suiCoin] = await this.context.getCoinsBySymbols(['BLUE', 'SUI']);
|
|
352
|
+
tx.moveCall({
|
|
353
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_sui_first_pool::user_deposit_v2`,
|
|
354
|
+
typeArguments: [
|
|
355
|
+
this.poolLabel.assetA.type,
|
|
356
|
+
this.poolLabel.assetB.type,
|
|
357
|
+
blueCoin.coinType,
|
|
358
|
+
suiCoin.coinType,
|
|
359
|
+
],
|
|
360
|
+
arguments: [
|
|
361
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
362
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
363
|
+
receiptOption,
|
|
364
|
+
tx.object(this.poolLabel.poolId),
|
|
365
|
+
depositCoinA,
|
|
366
|
+
depositCoinB,
|
|
367
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
368
|
+
tx.object(this.poolLabel.investorId),
|
|
369
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
370
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
371
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
372
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
373
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
374
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
375
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
376
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
377
|
+
],
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
async withdrawBluefinSuiFirstTx(tx, noneAlphaReceipt, xTokensAmount) {
|
|
381
|
+
const [blueCoin, suiCoin] = await this.context.getCoinsBySymbols(['BLUE', 'SUI']);
|
|
382
|
+
tx.moveCall({
|
|
383
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_sui_first_pool::user_withdraw_v2`,
|
|
384
|
+
typeArguments: [
|
|
385
|
+
this.poolLabel.assetA.type,
|
|
386
|
+
this.poolLabel.assetB.type,
|
|
387
|
+
blueCoin.coinType,
|
|
388
|
+
suiCoin.coinType,
|
|
389
|
+
],
|
|
390
|
+
arguments: [
|
|
391
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
392
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
393
|
+
tx.object(this.receiptObjects[0].id),
|
|
394
|
+
noneAlphaReceipt,
|
|
395
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
396
|
+
tx.object(this.poolLabel.poolId),
|
|
397
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
398
|
+
tx.object(this.poolLabel.investorId),
|
|
399
|
+
tx.pure.u128(xTokensAmount),
|
|
400
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
401
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
402
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
403
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
404
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
405
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
406
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
407
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
408
|
+
],
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
async depositBluefinSuiSecondTx(tx, receiptOption, depositCoinA, depositCoinB) {
|
|
412
|
+
const [deepCoin, blueCoin, suiCoin] = await this.context.getCoinsBySymbols([
|
|
413
|
+
'DEEP',
|
|
414
|
+
'BLUE',
|
|
415
|
+
'SUI',
|
|
416
|
+
]);
|
|
417
|
+
if (this.poolLabel.poolName === 'BLUEFIN-STSUI-SUI') {
|
|
418
|
+
tx.moveCall({
|
|
419
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_stsui_sui_pool::user_deposit`,
|
|
420
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type, blueCoin.coinType],
|
|
421
|
+
arguments: [
|
|
422
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
423
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
424
|
+
receiptOption,
|
|
425
|
+
tx.object(this.poolLabel.poolId),
|
|
426
|
+
depositCoinA,
|
|
427
|
+
depositCoinB,
|
|
428
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
429
|
+
tx.object(this.poolLabel.investorId),
|
|
430
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
431
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
432
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
433
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
434
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
435
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
436
|
+
],
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
tx.moveCall({
|
|
441
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_sui_second_pool::user_deposit_v2`,
|
|
442
|
+
typeArguments: [
|
|
443
|
+
this.poolLabel.assetA.type,
|
|
444
|
+
this.poolLabel.assetB.type,
|
|
445
|
+
this.poolLabel.assetA.name === 'BLUE' ? deepCoin.coinType : blueCoin.coinType,
|
|
446
|
+
suiCoin.coinType,
|
|
447
|
+
],
|
|
448
|
+
arguments: [
|
|
449
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
450
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
451
|
+
receiptOption,
|
|
452
|
+
tx.object(this.poolLabel.poolId),
|
|
453
|
+
depositCoinA,
|
|
454
|
+
depositCoinB,
|
|
455
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
456
|
+
tx.object(this.poolLabel.investorId),
|
|
457
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
458
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
459
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
460
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name === 'BLUE' ? 'DEEP' : 'BLUE', 'bluefin')),
|
|
461
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
462
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
463
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
464
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
465
|
+
],
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
async withdrawBluefinSuiSecondTx(tx, noneAlphaReceipt, xTokensAmount) {
|
|
470
|
+
const [blueCoin, suiCoin, deepCoin] = await this.context.getCoinsBySymbols([
|
|
471
|
+
'BLUE',
|
|
472
|
+
'SUI',
|
|
473
|
+
'DEEP',
|
|
474
|
+
]);
|
|
475
|
+
if (this.poolLabel.poolName === 'BLUEFIN-STSUI-SUI') {
|
|
476
|
+
tx.moveCall({
|
|
477
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_stsui_sui_pool::user_withdraw`,
|
|
478
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type, blueCoin.coinType],
|
|
479
|
+
arguments: [
|
|
480
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
481
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
482
|
+
tx.object(this.receiptObjects[0].id),
|
|
483
|
+
noneAlphaReceipt,
|
|
484
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
485
|
+
tx.object(this.poolLabel.poolId),
|
|
486
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
487
|
+
tx.object(this.poolLabel.investorId),
|
|
488
|
+
tx.pure.u128(xTokensAmount),
|
|
489
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
490
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
491
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
492
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
493
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
494
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
495
|
+
],
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
tx.moveCall({
|
|
500
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_sui_second_pool::user_withdraw_v2`,
|
|
501
|
+
typeArguments: [
|
|
502
|
+
this.poolLabel.assetA.type,
|
|
503
|
+
this.poolLabel.assetB.type,
|
|
504
|
+
this.poolLabel.assetA.name === 'BLUE' ? deepCoin.coinType : blueCoin.coinType,
|
|
505
|
+
suiCoin.coinType,
|
|
506
|
+
],
|
|
507
|
+
arguments: [
|
|
508
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
509
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
510
|
+
tx.object(this.receiptObjects[0].id),
|
|
511
|
+
noneAlphaReceipt,
|
|
512
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
513
|
+
tx.object(this.poolLabel.poolId),
|
|
514
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
515
|
+
tx.object(this.poolLabel.investorId),
|
|
516
|
+
tx.pure.u128(xTokensAmount),
|
|
517
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
518
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
519
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
520
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name === 'BLUE' ? 'DEEP' : 'BLUE', 'bluefin')),
|
|
521
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
522
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
523
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
524
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
525
|
+
],
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
async depositBluefinType1Tx(tx, receiptOption, depositCoinA, depositCoinB) {
|
|
530
|
+
const [blueCoin, suiCoin, deepCoin] = await this.context.getCoinsBySymbols([
|
|
531
|
+
'BLUE',
|
|
532
|
+
'SUI',
|
|
533
|
+
'DEEP',
|
|
534
|
+
]);
|
|
535
|
+
if (this.poolLabel.poolName === 'BLUEFIN-STSUI-USDC') {
|
|
536
|
+
tx.moveCall({
|
|
537
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_1_pool::user_deposit`,
|
|
538
|
+
typeArguments: [
|
|
539
|
+
this.poolLabel.assetA.type,
|
|
540
|
+
this.poolLabel.assetB.type,
|
|
541
|
+
blueCoin.coinType,
|
|
542
|
+
suiCoin.coinType,
|
|
543
|
+
],
|
|
544
|
+
arguments: [
|
|
545
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
546
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
547
|
+
receiptOption,
|
|
548
|
+
tx.object(this.poolLabel.poolId),
|
|
549
|
+
depositCoinA,
|
|
550
|
+
depositCoinB,
|
|
551
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
552
|
+
tx.object(this.poolLabel.investorId),
|
|
553
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
554
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
555
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
556
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
557
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
558
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'USDC', 'cetus')),
|
|
559
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
560
|
+
],
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
else if (this.poolLabel.poolName === 'BLUEFIN-SUIBTC-USDC' ||
|
|
564
|
+
this.poolLabel.poolName === 'BLUEFIN-LBTC-SUIBTC') {
|
|
565
|
+
tx.moveCall({
|
|
566
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_1_investor::collect_and_swap_rewards_to_token_b_bluefin`,
|
|
567
|
+
typeArguments: [
|
|
568
|
+
this.poolLabel.assetA.type,
|
|
569
|
+
this.poolLabel.assetB.type,
|
|
570
|
+
blueCoin.coinType,
|
|
571
|
+
suiCoin.coinType,
|
|
572
|
+
deepCoin.coinType,
|
|
573
|
+
],
|
|
574
|
+
arguments: [
|
|
575
|
+
tx.object(constants_js_1.VERSIONS.BLUEFIN_V2),
|
|
576
|
+
tx.object(this.poolLabel.investorId),
|
|
577
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
578
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
579
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
580
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'DEEP', 'bluefin')),
|
|
581
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'bluefin')),
|
|
582
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
583
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
584
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
585
|
+
],
|
|
586
|
+
});
|
|
587
|
+
tx.moveCall({
|
|
588
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_1_pool::user_deposit`,
|
|
589
|
+
typeArguments: [
|
|
590
|
+
this.poolLabel.assetA.type,
|
|
591
|
+
this.poolLabel.assetB.type,
|
|
592
|
+
blueCoin.coinType,
|
|
593
|
+
suiCoin.coinType,
|
|
594
|
+
deepCoin.coinType,
|
|
595
|
+
],
|
|
596
|
+
arguments: [
|
|
597
|
+
tx.object(constants_js_1.VERSIONS.BLUEFIN_V2),
|
|
598
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
599
|
+
receiptOption,
|
|
600
|
+
tx.object(this.poolLabel.poolId),
|
|
601
|
+
depositCoinA,
|
|
602
|
+
depositCoinB,
|
|
603
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
604
|
+
tx.object(this.poolLabel.investorId),
|
|
605
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
606
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
607
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
608
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
609
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'DEEP', 'bluefin')),
|
|
610
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
611
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')),
|
|
612
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
613
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
614
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
615
|
+
],
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
tx.moveCall({
|
|
620
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_1_investor::collect_and_swap_rewards_to_token_b_bluefin`,
|
|
621
|
+
typeArguments: [
|
|
622
|
+
this.poolLabel.assetA.type,
|
|
623
|
+
this.poolLabel.assetB.type,
|
|
624
|
+
blueCoin.coinType,
|
|
625
|
+
suiCoin.coinType,
|
|
626
|
+
],
|
|
627
|
+
arguments: [
|
|
628
|
+
tx.object(this.poolLabel.investorId),
|
|
629
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
630
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
631
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
632
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
633
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'USDC', 'bluefin')),
|
|
634
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
635
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
636
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
637
|
+
],
|
|
638
|
+
});
|
|
639
|
+
tx.moveCall({
|
|
640
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_1_pool::user_deposit_v2`,
|
|
641
|
+
typeArguments: [
|
|
642
|
+
this.poolLabel.assetA.type,
|
|
643
|
+
this.poolLabel.assetB.type,
|
|
644
|
+
blueCoin.coinType,
|
|
645
|
+
suiCoin.coinType,
|
|
646
|
+
],
|
|
647
|
+
arguments: [
|
|
648
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
649
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
650
|
+
receiptOption,
|
|
651
|
+
tx.object(this.poolLabel.poolId),
|
|
652
|
+
depositCoinA,
|
|
653
|
+
depositCoinB,
|
|
654
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
655
|
+
tx.object(this.poolLabel.investorId),
|
|
656
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
657
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
658
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
659
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
660
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')), // cetus pool with same tokens
|
|
661
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')), // cetus pool with assetB, SUI
|
|
662
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
663
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
664
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
665
|
+
],
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
async withdrawBluefinType1Tx(tx, noneAlphaReceipt, xTokensAmount) {
|
|
670
|
+
const [blueCoin, suiCoin, deepCoin] = await this.context.getCoinsBySymbols([
|
|
671
|
+
'BLUE',
|
|
672
|
+
'SUI',
|
|
673
|
+
'DEEP',
|
|
674
|
+
]);
|
|
675
|
+
if (this.poolLabel.poolName === 'BLUEFIN-STSUI-USDC') {
|
|
676
|
+
tx.moveCall({
|
|
677
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_1_pool::user_withdraw`,
|
|
678
|
+
typeArguments: [
|
|
679
|
+
this.poolLabel.assetA.type,
|
|
680
|
+
this.poolLabel.assetB.type,
|
|
681
|
+
blueCoin.coinType,
|
|
682
|
+
suiCoin.coinType,
|
|
683
|
+
],
|
|
684
|
+
arguments: [
|
|
685
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
686
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
687
|
+
tx.object(this.receiptObjects[0].id),
|
|
688
|
+
noneAlphaReceipt,
|
|
689
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
690
|
+
tx.object(this.poolLabel.poolId),
|
|
691
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
692
|
+
tx.object(this.poolLabel.investorId),
|
|
693
|
+
tx.pure.u128(xTokensAmount),
|
|
694
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
695
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
696
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
697
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
698
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
699
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'USDC', 'cetus')),
|
|
700
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
701
|
+
],
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
else if (this.poolLabel.poolName === 'BLUEFIN-SUIBTC-USDC' ||
|
|
705
|
+
this.poolLabel.poolName === 'BLUEFIN-LBTC-SUIBTC') {
|
|
706
|
+
tx.moveCall({
|
|
707
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_1_investor::collect_and_swap_rewards_to_token_b_bluefin`,
|
|
708
|
+
typeArguments: [
|
|
709
|
+
this.poolLabel.assetA.type,
|
|
710
|
+
this.poolLabel.assetB.type,
|
|
711
|
+
blueCoin.coinType,
|
|
712
|
+
suiCoin.coinType,
|
|
713
|
+
deepCoin.coinType,
|
|
714
|
+
],
|
|
715
|
+
arguments: [
|
|
716
|
+
tx.object(constants_js_1.VERSIONS.BLUEFIN_V2),
|
|
717
|
+
tx.object(this.poolLabel.investorId),
|
|
718
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
719
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
720
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
721
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'DEEP', 'bluefin')),
|
|
722
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'bluefin')),
|
|
723
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
724
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
725
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
726
|
+
],
|
|
727
|
+
});
|
|
728
|
+
tx.moveCall({
|
|
729
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_1_pool::user_withdraw`,
|
|
730
|
+
typeArguments: [
|
|
731
|
+
this.poolLabel.assetA.type,
|
|
732
|
+
this.poolLabel.assetB.type,
|
|
733
|
+
blueCoin.coinType,
|
|
734
|
+
suiCoin.coinType,
|
|
735
|
+
deepCoin.coinType,
|
|
736
|
+
],
|
|
737
|
+
arguments: [
|
|
738
|
+
tx.object(constants_js_1.VERSIONS.BLUEFIN_V2),
|
|
739
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
740
|
+
tx.object(this.receiptObjects[0].id),
|
|
741
|
+
noneAlphaReceipt,
|
|
742
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
743
|
+
tx.object(this.poolLabel.poolId),
|
|
744
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
745
|
+
tx.object(this.poolLabel.investorId),
|
|
746
|
+
tx.pure.u128(xTokensAmount),
|
|
747
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
748
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
749
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
750
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
751
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'DEEP', 'bluefin')),
|
|
752
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
753
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')),
|
|
754
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
755
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
756
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
757
|
+
],
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
761
|
+
tx.moveCall({
|
|
762
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_1_investor::collect_and_swap_rewards_to_token_b_bluefin`,
|
|
763
|
+
typeArguments: [
|
|
764
|
+
this.poolLabel.assetA.type,
|
|
765
|
+
this.poolLabel.assetB.type,
|
|
766
|
+
blueCoin.coinType,
|
|
767
|
+
suiCoin.coinType,
|
|
768
|
+
],
|
|
769
|
+
arguments: [
|
|
770
|
+
tx.object(this.poolLabel.investorId),
|
|
771
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
772
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
773
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
774
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
775
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'USDC', 'bluefin')),
|
|
776
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
777
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
778
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
779
|
+
],
|
|
780
|
+
});
|
|
781
|
+
tx.moveCall({
|
|
782
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_1_pool::user_withdraw_v2`,
|
|
783
|
+
typeArguments: [
|
|
784
|
+
this.poolLabel.assetA.type,
|
|
785
|
+
this.poolLabel.assetB.type,
|
|
786
|
+
blueCoin.coinType,
|
|
787
|
+
suiCoin.coinType,
|
|
788
|
+
],
|
|
789
|
+
arguments: [
|
|
790
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
791
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
792
|
+
tx.object(this.receiptObjects[0].id),
|
|
793
|
+
noneAlphaReceipt,
|
|
794
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
795
|
+
tx.object(this.poolLabel.poolId),
|
|
796
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
797
|
+
tx.object(this.poolLabel.investorId),
|
|
798
|
+
tx.pure.u128(xTokensAmount),
|
|
799
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
800
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
801
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
802
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
803
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')), // cetus pool with same tokens
|
|
804
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')), // cetus pool with assetB, SUI
|
|
805
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
806
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
807
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
808
|
+
],
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
async depositBluefinType2Tx(tx, receiptOption, depositCoinA, depositCoinB) {
|
|
813
|
+
const [blueCoin, suiCoin, deepCoin] = await this.context.getCoinsBySymbols([
|
|
814
|
+
'BLUE',
|
|
815
|
+
'SUI',
|
|
816
|
+
'DEEP',
|
|
817
|
+
]);
|
|
818
|
+
if (this.poolLabel.poolName === 'BLUEFIN-STSUI-ETH' ||
|
|
819
|
+
this.poolLabel.poolName === 'BLUEFIN-STSUI-WSOL') {
|
|
820
|
+
tx.moveCall({
|
|
821
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_2_pool::user_deposit`,
|
|
822
|
+
typeArguments: [
|
|
823
|
+
this.poolLabel.assetA.type,
|
|
824
|
+
this.poolLabel.assetB.type,
|
|
825
|
+
blueCoin.coinType,
|
|
826
|
+
suiCoin.coinType,
|
|
827
|
+
],
|
|
828
|
+
arguments: [
|
|
829
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
830
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
831
|
+
receiptOption,
|
|
832
|
+
tx.object(this.poolLabel.poolId),
|
|
833
|
+
depositCoinA,
|
|
834
|
+
depositCoinB,
|
|
835
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
836
|
+
tx.object(this.poolLabel.investorId),
|
|
837
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
838
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
839
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
840
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name === 'BLUE' ? 'DEEP' : 'BLUE', 'bluefin')),
|
|
841
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')), // same asset cetus pool
|
|
842
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')), // cetus pool with assetB, SUI
|
|
843
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
844
|
+
],
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
else {
|
|
848
|
+
tx.moveCall({
|
|
849
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_2_pool::user_deposit_v2`,
|
|
850
|
+
typeArguments: [
|
|
851
|
+
this.poolLabel.assetA.type,
|
|
852
|
+
this.poolLabel.assetB.type,
|
|
853
|
+
this.poolLabel.assetA.type === 'BLUE' ? deepCoin.coinType : blueCoin.coinType,
|
|
854
|
+
suiCoin.coinType,
|
|
855
|
+
],
|
|
856
|
+
arguments: [
|
|
857
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
858
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
859
|
+
receiptOption,
|
|
860
|
+
tx.object(this.poolLabel.poolId),
|
|
861
|
+
depositCoinA,
|
|
862
|
+
depositCoinB,
|
|
863
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
864
|
+
tx.object(this.poolLabel.investorId),
|
|
865
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
866
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
867
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
868
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name === 'BLUE' ? 'DEEP' : 'BLUE', 'bluefin')),
|
|
869
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')), // same asset cetus pool
|
|
870
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')), // cetus pool with assetB, SUI
|
|
871
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
872
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
873
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
874
|
+
],
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
async withdrawBluefinType2Tx(tx, noneAlphaReceipt, xTokensAmount) {
|
|
879
|
+
const [blueCoin, suiCoin] = await this.context.getCoinsBySymbols(['BLUE', 'SUI']);
|
|
880
|
+
if (this.poolLabel.poolName === 'BLUEFIN-STSUI-ETH' ||
|
|
881
|
+
this.poolLabel.poolName === 'BLUEFIN-STSUI-WSOL') {
|
|
882
|
+
tx.moveCall({
|
|
883
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_2_pool::user_withdraw`,
|
|
884
|
+
typeArguments: [
|
|
885
|
+
this.poolLabel.assetA.type,
|
|
886
|
+
this.poolLabel.assetB.type,
|
|
887
|
+
blueCoin.coinType,
|
|
888
|
+
suiCoin.coinType,
|
|
889
|
+
],
|
|
890
|
+
arguments: [
|
|
891
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
892
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
893
|
+
tx.object(this.receiptObjects[0].id),
|
|
894
|
+
noneAlphaReceipt,
|
|
895
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
896
|
+
tx.object(this.poolLabel.poolId),
|
|
897
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
898
|
+
tx.object(this.poolLabel.investorId),
|
|
899
|
+
tx.pure.u128(xTokensAmount),
|
|
900
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
901
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
902
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
903
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name === 'BLUE' ? 'DEEP' : 'BLUE', 'bluefin')),
|
|
904
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')), // same asset cetus pool
|
|
905
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')), // cetus pool with assetB, SUI
|
|
906
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
907
|
+
],
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
else {
|
|
911
|
+
tx.moveCall({
|
|
912
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_type_2_pool::user_withdraw_v2`,
|
|
913
|
+
typeArguments: [
|
|
914
|
+
this.poolLabel.assetA.type,
|
|
915
|
+
this.poolLabel.assetB.type,
|
|
916
|
+
blueCoin.coinType,
|
|
917
|
+
suiCoin.coinType,
|
|
918
|
+
],
|
|
919
|
+
arguments: [
|
|
920
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[4]),
|
|
921
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
922
|
+
tx.object(this.receiptObjects[0].id),
|
|
923
|
+
noneAlphaReceipt,
|
|
924
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
925
|
+
tx.object(this.poolLabel.poolId),
|
|
926
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
927
|
+
tx.object(this.poolLabel.investorId),
|
|
928
|
+
tx.pure.u128(xTokensAmount),
|
|
929
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
930
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
931
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
932
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name === 'BLUE' ? 'DEEP' : 'BLUE', 'bluefin')),
|
|
933
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')), // same asset cetus pool
|
|
934
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')), // cetus pool with assetB, SUI
|
|
935
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
936
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
937
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
938
|
+
],
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
async depositBluefinStsuiTx(tx, receiptOption, depositCoinA, depositCoinB) {
|
|
943
|
+
const [blueCoin] = await this.context.getCoinsBySymbols(['BLUE']);
|
|
944
|
+
if (this.poolLabel.poolName === 'BLUEFIN-ALPHA-STSUI' ||
|
|
945
|
+
this.poolLabel.poolName === 'BLUEFIN-WAL-STSUI') {
|
|
946
|
+
tx.moveCall({
|
|
947
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_stsui_second_pool::user_deposit`,
|
|
948
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type, blueCoin.coinType],
|
|
949
|
+
arguments: [
|
|
950
|
+
tx.object(constants_js_1.VERSIONS.STSUI),
|
|
951
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
952
|
+
receiptOption,
|
|
953
|
+
tx.object(this.poolLabel.poolId),
|
|
954
|
+
depositCoinA,
|
|
955
|
+
depositCoinB,
|
|
956
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
957
|
+
tx.object(this.poolLabel.investorId),
|
|
958
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
959
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
960
|
+
tx.object(this.poolLabel.parentPoolId), // parent-pool id
|
|
961
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
962
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name, 'cetus')), // cetus pool with assetA, SUI
|
|
963
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name, 'bluefin')), // bluefin pool with assetA, SUI
|
|
964
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
965
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
966
|
+
tx.pure.bool(true),
|
|
967
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
968
|
+
],
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
else {
|
|
972
|
+
tx.moveCall({
|
|
973
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_stsui_first_pool::user_deposit`,
|
|
974
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type, blueCoin.coinType],
|
|
975
|
+
arguments: [
|
|
976
|
+
tx.object(constants_js_1.VERSIONS.STSUI),
|
|
977
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
978
|
+
receiptOption,
|
|
979
|
+
tx.object(this.poolLabel.poolId),
|
|
980
|
+
depositCoinA,
|
|
981
|
+
depositCoinB,
|
|
982
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
983
|
+
tx.object(this.poolLabel.investorId),
|
|
984
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
985
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
986
|
+
tx.object(this.poolLabel.parentPoolId), // parent-pool id
|
|
987
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
988
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')), // cetus pool with assetB, SUI
|
|
989
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'bluefin')), // bluefin pool with assetB, SUI
|
|
990
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
991
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
992
|
+
tx.pure.bool(true),
|
|
993
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
994
|
+
],
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
async withdrawBluefinStsuiTx(tx, noneAlphaReceipt, xTokensAmount) {
|
|
999
|
+
const [blueCoin] = await this.context.getCoinsBySymbols(['BLUE']);
|
|
1000
|
+
if (this.poolLabel.poolName === 'BLUEFIN-ALPHA-STSUI' ||
|
|
1001
|
+
this.poolLabel.poolName === 'BLUEFIN-WAL-STSUI') {
|
|
1002
|
+
tx.moveCall({
|
|
1003
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_stsui_second_pool::user_withdraw`,
|
|
1004
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type, blueCoin.coinType],
|
|
1005
|
+
arguments: [
|
|
1006
|
+
tx.object(constants_js_1.VERSIONS.STSUI),
|
|
1007
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1008
|
+
tx.object(this.receiptObjects[0].id),
|
|
1009
|
+
noneAlphaReceipt,
|
|
1010
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
1011
|
+
tx.object(this.poolLabel.poolId),
|
|
1012
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1013
|
+
tx.object(this.poolLabel.investorId),
|
|
1014
|
+
tx.pure.u128(xTokensAmount),
|
|
1015
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
1016
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
1017
|
+
tx.object(this.poolLabel.parentPoolId), // parent-pool id
|
|
1018
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
1019
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name, 'cetus')), // cetus pool with assetA, SUI
|
|
1020
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name, 'bluefin')), // bluefin pool with assetA, SUI
|
|
1021
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
1022
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
1023
|
+
tx.pure.bool(true),
|
|
1024
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1025
|
+
],
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
else {
|
|
1029
|
+
tx.moveCall({
|
|
1030
|
+
target: `${this.poolLabel.packageId}::alphafi_bluefin_stsui_first_pool::user_withdraw`,
|
|
1031
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type, blueCoin.coinType],
|
|
1032
|
+
arguments: [
|
|
1033
|
+
tx.object(constants_js_1.VERSIONS.STSUI),
|
|
1034
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1035
|
+
tx.object(this.receiptObjects[0].id),
|
|
1036
|
+
noneAlphaReceipt,
|
|
1037
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
1038
|
+
tx.object(this.poolLabel.poolId),
|
|
1039
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1040
|
+
tx.object(this.poolLabel.investorId),
|
|
1041
|
+
tx.pure.u128(xTokensAmount),
|
|
1042
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.BLUEFIN),
|
|
1043
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
1044
|
+
tx.object(this.poolLabel.parentPoolId), // parent-pool id
|
|
1045
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'BLUE', 'bluefin')),
|
|
1046
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')), // cetus pool with assetB, SUI
|
|
1047
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'bluefin')), // bluefin pool with assetB, SUI
|
|
1048
|
+
tx.object(constants_js_1.STSUI.LST_INFO),
|
|
1049
|
+
tx.object(constants_js_1.SUI_SYSTEM_STATE),
|
|
1050
|
+
tx.pure.bool(true),
|
|
1051
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1052
|
+
],
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
async depositCetusTx(tx, receiptOption, depositCoinA, depositCoinB) {
|
|
1057
|
+
if (this.poolLabel.poolName == 'WUSDC-WBTC' ||
|
|
1058
|
+
this.poolLabel.poolName == 'USDC-USDT' ||
|
|
1059
|
+
this.poolLabel.poolName == 'USDC-WUSDC' ||
|
|
1060
|
+
this.poolLabel.poolName == 'USDC-ETH') {
|
|
1061
|
+
tx.moveCall({
|
|
1062
|
+
target: `${this.poolLabel.packageId}::alphafi_cetus_pool_base_a::user_deposit`,
|
|
1063
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type],
|
|
1064
|
+
arguments: [
|
|
1065
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1066
|
+
receiptOption,
|
|
1067
|
+
tx.object(this.poolLabel.poolId),
|
|
1068
|
+
depositCoinA,
|
|
1069
|
+
depositCoinB,
|
|
1070
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1071
|
+
tx.object(this.poolLabel.investorId),
|
|
1072
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
1073
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS_REWARDER_GLOBAL_VAULT_ID),
|
|
1074
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name, 'cetus')),
|
|
1075
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'CETUS', 'cetus')),
|
|
1076
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
1077
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1078
|
+
],
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
else {
|
|
1082
|
+
tx.moveCall({
|
|
1083
|
+
target: `${this.poolLabel.packageId}::alphafi_cetus_pool::user_deposit`,
|
|
1084
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type],
|
|
1085
|
+
arguments: [
|
|
1086
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1087
|
+
receiptOption,
|
|
1088
|
+
tx.object(this.poolLabel.poolId),
|
|
1089
|
+
depositCoinA,
|
|
1090
|
+
depositCoinB,
|
|
1091
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1092
|
+
tx.object(this.poolLabel.investorId),
|
|
1093
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
1094
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS_REWARDER_GLOBAL_VAULT_ID),
|
|
1095
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')),
|
|
1096
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'CETUS', 'cetus')),
|
|
1097
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
1098
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1099
|
+
],
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
async withdrawCetusTx(tx, noneAlphaReceipt, xTokensAmount) {
|
|
1104
|
+
if (this.poolLabel.poolName == 'WUSDC-WBTC' ||
|
|
1105
|
+
this.poolLabel.poolName == 'USDC-USDT' ||
|
|
1106
|
+
this.poolLabel.poolName == 'USDC-WUSDC' ||
|
|
1107
|
+
this.poolLabel.poolName == 'USDC-ETH') {
|
|
1108
|
+
tx.moveCall({
|
|
1109
|
+
target: `${this.poolLabel.packageId}::alphafi_cetus_pool_base_a::user_withdraw`,
|
|
1110
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type],
|
|
1111
|
+
arguments: [
|
|
1112
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1113
|
+
tx.object(this.receiptObjects[0].id),
|
|
1114
|
+
noneAlphaReceipt,
|
|
1115
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
1116
|
+
tx.object(this.poolLabel.poolId),
|
|
1117
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1118
|
+
tx.object(this.poolLabel.investorId),
|
|
1119
|
+
tx.pure.u128(xTokensAmount),
|
|
1120
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
1121
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS_REWARDER_GLOBAL_VAULT_ID),
|
|
1122
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetA.name, 'cetus')),
|
|
1123
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'CETUS', 'cetus')),
|
|
1124
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
1125
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1126
|
+
],
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
else {
|
|
1130
|
+
tx.moveCall({
|
|
1131
|
+
target: `${this.poolLabel.packageId}::alphafi_cetus_pool::user_withdraw`,
|
|
1132
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type],
|
|
1133
|
+
arguments: [
|
|
1134
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1135
|
+
tx.object(this.receiptObjects[0].id),
|
|
1136
|
+
noneAlphaReceipt,
|
|
1137
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
1138
|
+
tx.object(this.poolLabel.poolId),
|
|
1139
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1140
|
+
tx.object(this.poolLabel.investorId),
|
|
1141
|
+
tx.pure.u128(xTokensAmount),
|
|
1142
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
1143
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS_REWARDER_GLOBAL_VAULT_ID),
|
|
1144
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', this.poolLabel.assetB.name, 'cetus')),
|
|
1145
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'CETUS', 'cetus')),
|
|
1146
|
+
tx.object(this.poolLabel.parentPoolId),
|
|
1147
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1148
|
+
],
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
async depositCetusAlphaSuiTx(tx, receiptOption, depositCoinA, depositCoinB) {
|
|
1153
|
+
tx.moveCall({
|
|
1154
|
+
target: `${this.poolLabel.packageId}::alphafi_cetus_sui_pool::user_deposit`,
|
|
1155
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type],
|
|
1156
|
+
arguments: [
|
|
1157
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1158
|
+
receiptOption,
|
|
1159
|
+
tx.object(this.poolLabel.poolId),
|
|
1160
|
+
depositCoinA,
|
|
1161
|
+
depositCoinB,
|
|
1162
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1163
|
+
tx.object(this.poolLabel.investorId),
|
|
1164
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
1165
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS_REWARDER_GLOBAL_VAULT_ID),
|
|
1166
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'CETUS', 'cetus')),
|
|
1167
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
1168
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1169
|
+
],
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
async withdrawCetusAlphaSuiTx(tx, noneAlphaReceipt, xTokensAmount) {
|
|
1173
|
+
tx.moveCall({
|
|
1174
|
+
target: `${this.poolLabel.packageId}::alphafi_cetus_sui_pool::user_withdraw`,
|
|
1175
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type],
|
|
1176
|
+
arguments: [
|
|
1177
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1178
|
+
tx.object(this.receiptObjects[0].id),
|
|
1179
|
+
noneAlphaReceipt,
|
|
1180
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
1181
|
+
tx.object(this.poolLabel.poolId),
|
|
1182
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1183
|
+
tx.object(this.poolLabel.investorId),
|
|
1184
|
+
tx.pure.u128(xTokensAmount),
|
|
1185
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
1186
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS_REWARDER_GLOBAL_VAULT_ID),
|
|
1187
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol('SUI', 'CETUS', 'cetus')),
|
|
1188
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
1189
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1190
|
+
],
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
async depositCetusSuiTx(tx, receiptOption, depositCoinA, depositCoinB) {
|
|
1194
|
+
tx.moveCall({
|
|
1195
|
+
target: `${this.poolLabel.packageId}::alphafi_cetus_sui_pool::user_deposit`,
|
|
1196
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type],
|
|
1197
|
+
arguments: [
|
|
1198
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[2]),
|
|
1199
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1200
|
+
receiptOption,
|
|
1201
|
+
tx.object(this.poolLabel.poolId),
|
|
1202
|
+
depositCoinA,
|
|
1203
|
+
depositCoinB,
|
|
1204
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1205
|
+
tx.object(this.poolLabel.investorId),
|
|
1206
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
1207
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS_REWARDER_GLOBAL_VAULT_ID),
|
|
1208
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
1209
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1210
|
+
],
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1213
|
+
async withdrawCetusSuiTx(tx, noneAlphaReceipt, xTokensAmount) {
|
|
1214
|
+
tx.moveCall({
|
|
1215
|
+
target: `${this.poolLabel.packageId}::alphafi_cetus_sui_pool::user_withdraw`,
|
|
1216
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type],
|
|
1217
|
+
arguments: [
|
|
1218
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[2]),
|
|
1219
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1220
|
+
tx.object(this.receiptObjects[0].id),
|
|
1221
|
+
noneAlphaReceipt,
|
|
1222
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
1223
|
+
tx.object(this.poolLabel.poolId),
|
|
1224
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1225
|
+
tx.object(this.poolLabel.investorId),
|
|
1226
|
+
tx.pure.u128(xTokensAmount),
|
|
1227
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS),
|
|
1228
|
+
tx.object(constants_js_1.GLOBAL_CONFIGS.CETUS_REWARDER_GLOBAL_VAULT_ID),
|
|
1229
|
+
tx.object(await this.context.getPoolIdBySymbolsAndProtocol(this.poolLabel.assetA.name, this.poolLabel.assetB.name, 'cetus')),
|
|
1230
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1231
|
+
],
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
async deposit(tx, options) {
|
|
1235
|
+
if (options.isAmountA === undefined) {
|
|
1236
|
+
throw new Error('isAmountA is required for AutobalanceLp strategy');
|
|
1237
|
+
}
|
|
1238
|
+
const [amountA, amountB] = this.getOtherAmount(options.amount.toString(), options.isAmountA);
|
|
1239
|
+
// get Coin Objects
|
|
1240
|
+
const depositCoinA = await this.context.blockchain.getCoinObject(tx, this.poolLabel.assetA.type, options.address, BigInt(amountA));
|
|
1241
|
+
const depositCoinB = await this.context.blockchain.getCoinObject(tx, this.poolLabel.assetB.type, options.address, BigInt(amountB));
|
|
1242
|
+
const receiptOption = this.context.blockchain.getOptionReceipt(tx, this.poolLabel.receipt.type, this.receiptObjects.length > 0 ? this.receiptObjects[0].id : undefined);
|
|
1243
|
+
if (this.poolLabel.parentProtocol === 'Cetus') {
|
|
1244
|
+
if (this.poolLabel.assetA.name === 'CETUS' && this.poolLabel.assetB.name === 'SUI') {
|
|
1245
|
+
await this.depositCetusSuiTx(tx, receiptOption, depositCoinA, depositCoinB);
|
|
1246
|
+
}
|
|
1247
|
+
else if (this.poolLabel.assetB.name === 'SUI') {
|
|
1248
|
+
await this.depositCetusAlphaSuiTx(tx, receiptOption, depositCoinA, depositCoinB);
|
|
1249
|
+
}
|
|
1250
|
+
else {
|
|
1251
|
+
await this.depositCetusTx(tx, receiptOption, depositCoinA, depositCoinB);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
else if (this.poolLabel.parentProtocol === 'Bluefin') {
|
|
1255
|
+
if (this.poolLabel.poolName === 'BLUEFIN-NAVX-VSUI' ||
|
|
1256
|
+
this.poolLabel.poolName === 'BLUEFIN-ALPHA-USDC' ||
|
|
1257
|
+
this.poolLabel.poolName === 'BLUEFIN-BLUE-USDC') {
|
|
1258
|
+
await this.depositBluefinType2Tx(tx, receiptOption, depositCoinA, depositCoinB);
|
|
1259
|
+
}
|
|
1260
|
+
else if (this.poolLabel.assetA.name === 'SUI') {
|
|
1261
|
+
await this.depositBluefinSuiFirstTx(tx, receiptOption, depositCoinA, depositCoinB);
|
|
1262
|
+
}
|
|
1263
|
+
else if (this.poolLabel.assetB.name === 'SUI') {
|
|
1264
|
+
await this.depositBluefinSuiSecondTx(tx, receiptOption, depositCoinA, depositCoinB);
|
|
1265
|
+
}
|
|
1266
|
+
else if (this.poolLabel.assetA.name === 'stSUI' || this.poolLabel.assetB.name === 'stSUI') {
|
|
1267
|
+
await this.depositBluefinStsuiTx(tx, receiptOption, depositCoinA, depositCoinB);
|
|
1268
|
+
}
|
|
1269
|
+
else {
|
|
1270
|
+
await this.depositBluefinType1Tx(tx, receiptOption, depositCoinA, depositCoinB);
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
async withdraw(tx, options) {
|
|
1275
|
+
if (options.isAmountA === undefined) {
|
|
1276
|
+
throw new Error('isAmountA is required for AutobalanceLp strategy');
|
|
1277
|
+
}
|
|
1278
|
+
if (this.receiptObjects.length === 0) {
|
|
1279
|
+
throw new Error('No receipt found!');
|
|
1280
|
+
}
|
|
1281
|
+
let xTokenAmount = '0';
|
|
1282
|
+
if (options.withdrawMax) {
|
|
1283
|
+
xTokenAmount = this.receiptObjects[0].xTokenBalance;
|
|
1284
|
+
}
|
|
1285
|
+
else {
|
|
1286
|
+
xTokenAmount = this.coinAmountToXToken(options.amount.toString(), options.isAmountA);
|
|
1287
|
+
}
|
|
1288
|
+
const noneAlphaReceipt = tx.moveCall({
|
|
1289
|
+
target: `0x1::option::none`,
|
|
1290
|
+
typeArguments: [
|
|
1291
|
+
'0x9bbd650b8442abb082c20f3bc95a9434a8d47b4bef98b0832dab57c1a8ba7123::alphapool::Receipt',
|
|
1292
|
+
],
|
|
1293
|
+
arguments: [],
|
|
1294
|
+
});
|
|
1295
|
+
if (this.poolLabel.parentProtocol === 'Cetus') {
|
|
1296
|
+
if (this.poolLabel.assetA.name === 'CETUS' && this.poolLabel.assetB.name === 'SUI') {
|
|
1297
|
+
await this.withdrawCetusSuiTx(tx, noneAlphaReceipt, xTokenAmount);
|
|
1298
|
+
}
|
|
1299
|
+
else if (this.poolLabel.assetB.name === 'SUI') {
|
|
1300
|
+
await this.withdrawCetusAlphaSuiTx(tx, noneAlphaReceipt, xTokenAmount);
|
|
1301
|
+
}
|
|
1302
|
+
else {
|
|
1303
|
+
await this.withdrawCetusTx(tx, noneAlphaReceipt, xTokenAmount);
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
else if (this.poolLabel.parentProtocol === 'Bluefin') {
|
|
1307
|
+
if (this.poolLabel.poolName === 'BLUEFIN-NAVX-VSUI' ||
|
|
1308
|
+
this.poolLabel.poolName === 'BLUEFIN-ALPHA-USDC' ||
|
|
1309
|
+
this.poolLabel.poolName === 'BLUEFIN-BLUE-USDC') {
|
|
1310
|
+
await this.withdrawBluefinType2Tx(tx, noneAlphaReceipt, xTokenAmount);
|
|
1311
|
+
}
|
|
1312
|
+
else if (this.poolLabel.assetA.name === 'SUI') {
|
|
1313
|
+
await this.withdrawBluefinSuiFirstTx(tx, noneAlphaReceipt, xTokenAmount);
|
|
1314
|
+
}
|
|
1315
|
+
else if (this.poolLabel.assetB.name === 'SUI') {
|
|
1316
|
+
await this.withdrawBluefinSuiSecondTx(tx, noneAlphaReceipt, xTokenAmount);
|
|
1317
|
+
}
|
|
1318
|
+
else if (this.poolLabel.assetA.name === 'stSUI' || this.poolLabel.assetB.name === 'stSUI') {
|
|
1319
|
+
await this.withdrawBluefinStsuiTx(tx, noneAlphaReceipt, xTokenAmount);
|
|
1320
|
+
}
|
|
1321
|
+
else {
|
|
1322
|
+
await this.withdrawBluefinType1Tx(tx, noneAlphaReceipt, xTokenAmount);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
async claimRewards(tx, alphaReceipt) {
|
|
1327
|
+
if (this.poolLabel.parentProtocol === 'Cetus') {
|
|
1328
|
+
if (this.poolLabel.poolName === 'CETUS-SUI') {
|
|
1329
|
+
this.receiptObjects.forEach((receipt) => {
|
|
1330
|
+
alphaReceipt = tx.moveCall({
|
|
1331
|
+
target: `${this.poolLabel.packageId}::alphafi_cetus_sui_pool::get_user_rewards_all`,
|
|
1332
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type],
|
|
1333
|
+
arguments: [
|
|
1334
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[2]),
|
|
1335
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1336
|
+
tx.object(receipt.id),
|
|
1337
|
+
alphaReceipt,
|
|
1338
|
+
tx.object(this.poolLabel.poolId),
|
|
1339
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
1340
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1341
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1342
|
+
],
|
|
1343
|
+
});
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1346
|
+
else {
|
|
1347
|
+
let target;
|
|
1348
|
+
if (this.poolLabel.assetB.name == 'SUI') {
|
|
1349
|
+
target = `${this.poolLabel.packageId}::alphafi_cetus_sui_pool::get_user_rewards_all`;
|
|
1350
|
+
}
|
|
1351
|
+
else if (this.poolLabel.poolName == 'WUSDC-WBTC' ||
|
|
1352
|
+
this.poolLabel.poolName == 'USDC-USDT' ||
|
|
1353
|
+
this.poolLabel.poolName == 'USDC-WUSDC' ||
|
|
1354
|
+
this.poolLabel.poolName == 'USDC-ETH') {
|
|
1355
|
+
target = `${this.poolLabel.packageId}::alphafi_cetus_pool_base_a::get_user_rewards_all`;
|
|
1356
|
+
}
|
|
1357
|
+
else {
|
|
1358
|
+
target = `${this.poolLabel.packageId}::alphafi_cetus_pool::get_user_rewards_all`;
|
|
1359
|
+
}
|
|
1360
|
+
if (target) {
|
|
1361
|
+
this.receiptObjects.forEach((receipt) => {
|
|
1362
|
+
alphaReceipt = tx.moveCall({
|
|
1363
|
+
target,
|
|
1364
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type],
|
|
1365
|
+
arguments: [
|
|
1366
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1367
|
+
tx.object(receipt.id),
|
|
1368
|
+
alphaReceipt,
|
|
1369
|
+
tx.object(this.poolLabel.poolId),
|
|
1370
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
1371
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1372
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1373
|
+
],
|
|
1374
|
+
});
|
|
1375
|
+
});
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
else if (this.poolLabel.parentProtocol === 'Bluefin') {
|
|
1380
|
+
let version, target;
|
|
1381
|
+
if (this.poolLabel.poolName === 'BLUEFIN-SUIBTC-USDC' ||
|
|
1382
|
+
this.poolLabel.poolName === 'BLUEFIN-LBTC-SUIBTC') {
|
|
1383
|
+
target = `${this.poolLabel.packageId}::alphafi_bluefin_type_1_pool::get_user_rewards_all`;
|
|
1384
|
+
version = constants_js_1.VERSIONS.BLUEFIN_V2;
|
|
1385
|
+
}
|
|
1386
|
+
else if (this.poolLabel.poolName == 'BLUEFIN-SUI-USDC' ||
|
|
1387
|
+
this.poolLabel.poolName === 'BLUEFIN-SUI-BUCK' ||
|
|
1388
|
+
this.poolLabel.poolName === 'BLUEFIN-SUI-AUSD') {
|
|
1389
|
+
target = `${this.poolLabel.packageId}::alphafi_bluefin_sui_first_pool::get_user_rewards_all`;
|
|
1390
|
+
version = constants_js_1.VERSIONS.ALPHA_VERSIONS[4];
|
|
1391
|
+
}
|
|
1392
|
+
else if (this.poolLabel.poolName == 'BLUEFIN-USDT-USDC' ||
|
|
1393
|
+
this.poolLabel.poolName === 'BLUEFIN-AUSD-USDC' ||
|
|
1394
|
+
this.poolLabel.poolName === 'BLUEFIN-WBTC-USDC' ||
|
|
1395
|
+
this.poolLabel.poolName === 'BLUEFIN-SEND-USDC' ||
|
|
1396
|
+
this.poolLabel.poolName === 'BLUEFIN-SUIUSDT-USDC' ||
|
|
1397
|
+
this.poolLabel.poolName === 'BLUEFIN-WAL-USDC') {
|
|
1398
|
+
target = `${this.poolLabel.packageId}::alphafi_bluefin_type_1_pool::get_user_rewards_all`;
|
|
1399
|
+
version = constants_js_1.VERSIONS.ALPHA_VERSIONS[4];
|
|
1400
|
+
}
|
|
1401
|
+
else if (this.poolLabel.poolName === 'BLUEFIN-ALPHA-USDC' ||
|
|
1402
|
+
this.poolLabel.poolName === 'BLUEFIN-NAVX-VSUI' ||
|
|
1403
|
+
this.poolLabel.poolName === 'BLUEFIN-BLUE-USDC') {
|
|
1404
|
+
target = `${this.poolLabel.packageId}::alphafi_bluefin_type_2_pool::get_user_rewards_all`;
|
|
1405
|
+
version = constants_js_1.VERSIONS.ALPHA_VERSIONS[4];
|
|
1406
|
+
}
|
|
1407
|
+
else if (this.poolLabel.poolName === 'BLUEFIN-BLUE-SUI' ||
|
|
1408
|
+
this.poolLabel.poolName === 'BLUEFIN-WBTC-SUI' ||
|
|
1409
|
+
this.poolLabel.poolName === 'BLUEFIN-DEEP-SUI') {
|
|
1410
|
+
target = `${this.poolLabel.packageId}::alphafi_bluefin_sui_second_pool::get_user_rewards_all`;
|
|
1411
|
+
version = constants_js_1.VERSIONS.ALPHA_VERSIONS[4];
|
|
1412
|
+
}
|
|
1413
|
+
else if (this.poolLabel.poolName === 'BLUEFIN-STSUI-SUI') {
|
|
1414
|
+
target = `${this.poolLabel.packageId}::alphafi_bluefin_stsui_sui_pool::get_user_rewards_all`;
|
|
1415
|
+
version = constants_js_1.VERSIONS.ALPHA_VERSIONS[4];
|
|
1416
|
+
}
|
|
1417
|
+
else if (this.poolLabel.poolName === 'BLUEFIN-STSUI-USDC' ||
|
|
1418
|
+
this.poolLabel.poolName === 'BLUEFIN-STSUI-WSOL' ||
|
|
1419
|
+
this.poolLabel.poolName === 'BLUEFIN-STSUI-ETH' ||
|
|
1420
|
+
this.poolLabel.poolName === 'BLUEFIN-STSUI-BUCK' ||
|
|
1421
|
+
this.poolLabel.poolName === 'BLUEFIN-STSUI-MUSD') {
|
|
1422
|
+
target = `${this.poolLabel.packageId}::alphafi_bluefin_stsui_first_pool::get_user_rewards_all`;
|
|
1423
|
+
version = constants_js_1.VERSIONS.STSUI;
|
|
1424
|
+
}
|
|
1425
|
+
else if (this.poolLabel.poolName === 'BLUEFIN-ALPHA-STSUI' ||
|
|
1426
|
+
this.poolLabel.poolName === 'BLUEFIN-WAL-STSUI') {
|
|
1427
|
+
target = `${this.poolLabel.packageId}::alphafi_bluefin_stsui_second_pool::get_user_rewards_all`;
|
|
1428
|
+
version = constants_js_1.VERSIONS.STSUI;
|
|
1429
|
+
}
|
|
1430
|
+
if (version && target) {
|
|
1431
|
+
this.receiptObjects.forEach((receipt) => {
|
|
1432
|
+
alphaReceipt = tx.moveCall({
|
|
1433
|
+
target,
|
|
1434
|
+
typeArguments: [this.poolLabel.assetA.type, this.poolLabel.assetB.type],
|
|
1435
|
+
arguments: [
|
|
1436
|
+
tx.object(version),
|
|
1437
|
+
tx.object(constants_js_1.VERSIONS.ALPHA_VERSIONS[1]),
|
|
1438
|
+
tx.object(receipt.id),
|
|
1439
|
+
alphaReceipt,
|
|
1440
|
+
tx.object(this.poolLabel.poolId),
|
|
1441
|
+
tx.object(constants_js_1.POOLS.ALPHA_LEGACY),
|
|
1442
|
+
tx.object(constants_js_1.DISTRIBUTOR_OBJECT_ID),
|
|
1443
|
+
tx.object(constants_js_1.CLOCK_PACKAGE_ID),
|
|
1444
|
+
],
|
|
1445
|
+
});
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
exports.LpStrategy = LpStrategy;
|
|
1452
|
+
//# sourceMappingURL=lp.js.map
|