@alphafi/alphafi-sdk 0.0.55 → 0.0.58

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.
Files changed (303) hide show
  1. package/dist/cjs/common/coins.d.ts.map +1 -1
  2. package/dist/cjs/common/coins.js +6 -0
  3. package/dist/cjs/common/coins.js.map +1 -1
  4. package/dist/cjs/common/constants.d.ts +93 -0
  5. package/dist/cjs/common/constants.d.ts.map +1 -1
  6. package/dist/cjs/common/constants.js +90 -25
  7. package/dist/cjs/common/constants.js.map +1 -1
  8. package/dist/cjs/common/maps.d.ts.map +1 -1
  9. package/dist/cjs/common/maps.js +91 -39
  10. package/dist/cjs/common/maps.js.map +1 -1
  11. package/dist/cjs/common/pyth.d.ts +1 -1
  12. package/dist/cjs/common/pyth.d.ts.map +1 -1
  13. package/dist/cjs/common/pyth.js.map +1 -1
  14. package/dist/cjs/common/types.d.ts +4 -4
  15. package/dist/cjs/common/types.d.ts.map +1 -1
  16. package/dist/cjs/common/types.js.map +1 -1
  17. package/dist/cjs/getLastAutoCompoundTime.js +2 -2
  18. package/dist/cjs/getLastAutoCompoundTime.js.map +1 -1
  19. package/dist/cjs/sui-sdk/events/fetchAutoCompoundingEvents.d.ts.map +1 -1
  20. package/dist/cjs/sui-sdk/events/fetchAutoCompoundingEvents.js +2 -1
  21. package/dist/cjs/sui-sdk/events/fetchAutoCompoundingEvents.js.map +1 -1
  22. package/dist/cjs/sui-sdk/functions/getReceipts.d.ts +1 -0
  23. package/dist/cjs/sui-sdk/functions/getReceipts.d.ts.map +1 -1
  24. package/dist/cjs/transactions/7k.d.ts +1 -1
  25. package/dist/cjs/transactions/7k.d.ts.map +1 -1
  26. package/dist/cjs/transactions/7k.js +2 -1
  27. package/dist/cjs/transactions/7k.js.map +1 -1
  28. package/dist/cjs/transactions/blueRewards.d.ts.map +1 -1
  29. package/dist/cjs/transactions/blueRewards.js +18 -6
  30. package/dist/cjs/transactions/blueRewards.js.map +1 -1
  31. package/dist/cjs/transactions/bluefin.d.ts.map +1 -1
  32. package/dist/cjs/transactions/bluefin.js +364 -40
  33. package/dist/cjs/transactions/bluefin.js.map +1 -1
  34. package/dist/cjs/transactions/collect_rewards.d.ts.map +1 -1
  35. package/dist/cjs/transactions/collect_rewards.js +5 -1
  36. package/dist/cjs/transactions/collect_rewards.js.map +1 -1
  37. package/dist/cjs/transactions/deposit.d.ts.map +1 -1
  38. package/dist/cjs/transactions/deposit.js +2 -4
  39. package/dist/cjs/transactions/deposit.js.map +1 -1
  40. package/dist/cjs/transactions/navi.d.ts.map +1 -1
  41. package/dist/cjs/transactions/navi.js +64 -0
  42. package/dist/cjs/transactions/navi.js.map +1 -1
  43. package/dist/cjs/transactions/zapDeposit.d.ts.map +1 -1
  44. package/dist/cjs/transactions/zapDeposit.js +89 -38
  45. package/dist/cjs/transactions/zapDeposit.js.map +1 -1
  46. package/dist/cjs/utils/constants.d.ts.map +1 -1
  47. package/dist/cjs/utils/constants.js +5 -0
  48. package/dist/cjs/utils/constants.js.map +1 -1
  49. package/dist/esm/common/coins.d.ts.map +1 -1
  50. package/dist/esm/common/coins.js +6 -0
  51. package/dist/esm/common/coins.js.map +1 -1
  52. package/dist/esm/common/constants.d.ts +93 -0
  53. package/dist/esm/common/constants.d.ts.map +1 -1
  54. package/dist/esm/common/constants.js +90 -25
  55. package/dist/esm/common/constants.js.map +1 -1
  56. package/dist/esm/common/maps.d.ts.map +1 -1
  57. package/dist/esm/common/maps.js +91 -39
  58. package/dist/esm/common/maps.js.map +1 -1
  59. package/dist/esm/common/pyth.d.ts +1 -1
  60. package/dist/esm/common/pyth.d.ts.map +1 -1
  61. package/dist/esm/common/pyth.js.map +1 -1
  62. package/dist/esm/common/types.d.ts +4 -4
  63. package/dist/esm/common/types.d.ts.map +1 -1
  64. package/dist/esm/common/types.js.map +1 -1
  65. package/dist/esm/getLastAutoCompoundTime.js +2 -2
  66. package/dist/esm/getLastAutoCompoundTime.js.map +1 -1
  67. package/dist/esm/sui-sdk/events/fetchAutoCompoundingEvents.d.ts.map +1 -1
  68. package/dist/esm/sui-sdk/events/fetchAutoCompoundingEvents.js +2 -1
  69. package/dist/esm/sui-sdk/events/fetchAutoCompoundingEvents.js.map +1 -1
  70. package/dist/esm/sui-sdk/functions/getReceipts.d.ts +1 -0
  71. package/dist/esm/sui-sdk/functions/getReceipts.d.ts.map +1 -1
  72. package/dist/esm/transactions/7k.d.ts +1 -1
  73. package/dist/esm/transactions/7k.d.ts.map +1 -1
  74. package/dist/esm/transactions/7k.js +2 -1
  75. package/dist/esm/transactions/7k.js.map +1 -1
  76. package/dist/esm/transactions/blueRewards.d.ts.map +1 -1
  77. package/dist/esm/transactions/blueRewards.js +18 -6
  78. package/dist/esm/transactions/blueRewards.js.map +1 -1
  79. package/dist/esm/transactions/bluefin.d.ts.map +1 -1
  80. package/dist/esm/transactions/bluefin.js +364 -40
  81. package/dist/esm/transactions/bluefin.js.map +1 -1
  82. package/dist/esm/transactions/collect_rewards.d.ts.map +1 -1
  83. package/dist/esm/transactions/collect_rewards.js +5 -1
  84. package/dist/esm/transactions/collect_rewards.js.map +1 -1
  85. package/dist/esm/transactions/deposit.d.ts.map +1 -1
  86. package/dist/esm/transactions/deposit.js +2 -4
  87. package/dist/esm/transactions/deposit.js.map +1 -1
  88. package/dist/esm/transactions/navi.d.ts.map +1 -1
  89. package/dist/esm/transactions/navi.js +64 -0
  90. package/dist/esm/transactions/navi.js.map +1 -1
  91. package/dist/esm/transactions/zapDeposit.d.ts.map +1 -1
  92. package/dist/esm/transactions/zapDeposit.js +89 -38
  93. package/dist/esm/transactions/zapDeposit.js.map +1 -1
  94. package/dist/esm/utils/constants.d.ts.map +1 -1
  95. package/dist/esm/utils/constants.js +5 -0
  96. package/dist/esm/utils/constants.js.map +1 -1
  97. package/docs/assets/highlight.css +74 -51
  98. package/docs/assets/icons.js +20 -17
  99. package/docs/assets/main.js +2163 -5
  100. package/docs/assets/navigation.js +2 -1
  101. package/docs/assets/search.js +2 -1
  102. package/docs/assets/style.css +846 -850
  103. package/docs/functions/alphaLpBreakdown.html +253 -1
  104. package/docs/functions/cetusLpBreakdown.html +253 -1
  105. package/docs/functions/claimBlueRewardTxb.html +258 -1
  106. package/docs/functions/claimRewardTxb.html +243 -1
  107. package/docs/functions/coinAmountToXTokensDoubleAsset.html +267 -1
  108. package/docs/functions/coinAmountToXTokensSingleAsset.html +260 -1
  109. package/docs/functions/coinsInPool.html +438 -1
  110. package/docs/functions/collectRewards.html +242 -1
  111. package/docs/functions/deposit.html +246 -1
  112. package/docs/functions/depositDoubleAssetTxb.html +270 -1
  113. package/docs/functions/depositSingleAssetTxb.html +263 -1
  114. package/docs/functions/fetchAfterTransactionEvents.html +328 -1
  115. package/docs/functions/fetchAutoCompoundingEvents.html +257 -1
  116. package/docs/functions/fetchAutoCompoundingEventsGql.html +251 -1
  117. package/docs/functions/fetchCetusPools.html +231 -1
  118. package/docs/functions/fetchChainIdentifier.html +233 -1
  119. package/docs/functions/fetchCheckRatioEvents.html +249 -1
  120. package/docs/functions/fetchLiquidityChangeEvents.html +257 -1
  121. package/docs/functions/fetchMultiCategoryEvents.html +348 -1
  122. package/docs/functions/fetchMultiReceipts.html +261 -1
  123. package/docs/functions/fetchNftHolders.html +233 -1
  124. package/docs/functions/fetchPools.html +230 -1
  125. package/docs/functions/fetchPortfolioData.html +243 -1
  126. package/docs/functions/fetchProtocolData.html +231 -1
  127. package/docs/functions/fetchTVL.html +253 -1
  128. package/docs/functions/fetchUserVaultBalances.html +245 -1
  129. package/docs/functions/fetchUserVaults.html +243 -1
  130. package/docs/functions/fetchUserWalletData.html +243 -1
  131. package/docs/functions/fetchVoloExchangeRate.html +251 -1
  132. package/docs/functions/fetchWithdrawV2Events.html +255 -1
  133. package/docs/functions/getAirdropShare.html +243 -1
  134. package/docs/functions/getAllDoubleAssetVaults.html +235 -1
  135. package/docs/functions/getAllSingleAssetVaults.html +235 -1
  136. package/docs/functions/getAllVaultBalances.html +265 -1
  137. package/docs/functions/getAllVaults.html +233 -1
  138. package/docs/functions/getAlphaUnlocks.html +245 -1
  139. package/docs/functions/getAlphaVaultBalance.html +255 -1
  140. package/docs/functions/getAmounts.html +272 -1
  141. package/docs/functions/getApr.html +243 -1
  142. package/docs/functions/getAprs.html +255 -1
  143. package/docs/functions/getApy.html +243 -1
  144. package/docs/functions/getApys.html +255 -1
  145. package/docs/functions/getCetusInvestorTicksMap.html +284 -1
  146. package/docs/functions/getCetusPool.html +270 -1
  147. package/docs/functions/getCetusSqrtPriceMap.html +249 -1
  148. package/docs/functions/getCoinAmountsFromLiquidity.html +273 -1
  149. package/docs/functions/getConf.html +13163 -1
  150. package/docs/functions/getCurrentTick.html +247 -1
  151. package/docs/functions/getDistributor.html +252 -1
  152. package/docs/functions/getDoubleAssetVaultBalance.html +268 -1
  153. package/docs/functions/getDoubleAssetVaults.html +253 -1
  154. package/docs/functions/getHoldersFromTransactions.html +299 -1
  155. package/docs/functions/getInvestor.html +259 -1
  156. package/docs/functions/getInvestorPoolMap.html +241 -1
  157. package/docs/functions/getLastAutoCompoundTime.html +249 -1
  158. package/docs/functions/getLatestPrices.html +253 -1
  159. package/docs/functions/getLiquidity.html +260 -1
  160. package/docs/functions/getMultiCetusPool.html +231 -1
  161. package/docs/functions/getMultiInvestor.html +231 -1
  162. package/docs/functions/getMultiLatestPrices.html +233 -1
  163. package/docs/functions/getMultiParentPool.html +231 -1
  164. package/docs/functions/getMultiPool.html +231 -1
  165. package/docs/functions/getMultiReceipts.html +243 -1
  166. package/docs/functions/getParentPool.html +266 -1
  167. package/docs/functions/getPool.html +262 -1
  168. package/docs/functions/getPoolExchangeRate.html +254 -1
  169. package/docs/functions/getPoolExchangeRateMap.html +249 -1
  170. package/docs/functions/getPoolsWeightDistribution.html +266 -1
  171. package/docs/functions/getPositionRange.html +283 -1
  172. package/docs/functions/getPositionRanges.html +289 -1
  173. package/docs/functions/getPositionTicks.html +249 -1
  174. package/docs/functions/getPriceToTick.html +264 -1
  175. package/docs/functions/getRebalanceHistories.html +269 -1
  176. package/docs/functions/getRebalanceHistory.html +255 -1
  177. package/docs/functions/getReceipts.html +268 -1
  178. package/docs/functions/getSingleAssetVaultBalance.html +268 -1
  179. package/docs/functions/getSingleAssetVaults.html +253 -1
  180. package/docs/functions/getSuiClient.html +247 -3
  181. package/docs/functions/getSuiNodeUrl.html +232 -3
  182. package/docs/functions/getTVLs-1.html +243 -1
  183. package/docs/functions/getTickSpacing.html +247 -1
  184. package/docs/functions/getTickToPrice.html +248 -1
  185. package/docs/functions/getTvls.html +259 -1
  186. package/docs/functions/getUserTokensFromTransactions.html +269 -1
  187. package/docs/functions/getUserTokensInUsdFromTransactions.html +263 -1
  188. package/docs/functions/getVaultBalance.html +277 -1
  189. package/docs/functions/getVaultBalanceForActiveUsers.html +261 -1
  190. package/docs/functions/getVaults.html +250 -1
  191. package/docs/functions/getXTokenVaultBalanceForActiveUsers.html +261 -1
  192. package/docs/functions/getZapAmounts.html +323 -1
  193. package/docs/functions/lastAutocompoundTime.html +249 -1
  194. package/docs/functions/liquidityToTokens.html +253 -1
  195. package/docs/functions/multiLiquidityToTokens.html +271 -1
  196. package/docs/functions/multiTokensToUsd.html +262 -1
  197. package/docs/functions/multiXTokensToLiquidity.html +257 -1
  198. package/docs/functions/parseUserWalletData.html +243 -1
  199. package/docs/functions/pendingBlueRewardAmount.html +256 -1
  200. package/docs/functions/setCustomSuiClient.html +251 -5
  201. package/docs/functions/setSuiClient.html +255 -7
  202. package/docs/functions/setSuiNodeUrl.html +249 -5
  203. package/docs/functions/setWeights.html +270 -1
  204. package/docs/functions/withdraw.html +249 -1
  205. package/docs/functions/withdrawAlphaTxb.html +257 -1
  206. package/docs/functions/withdrawTxb.html +260 -1
  207. package/docs/functions/zapDepositTxb.html +300 -1
  208. package/docs/index.html +587 -41
  209. package/docs/interfaces/Coin.html +474 -12
  210. package/docs/interfaces/CoinPair.html +358 -3
  211. package/docs/interfaces/NaviVoloData.html +514 -3
  212. package/docs/interfaces/PoolData.html +579 -8
  213. package/docs/interfaces/PoolWeightDistribution.html +414 -4
  214. package/docs/interfaces/RebalanceHistoryType.html +652 -9
  215. package/docs/modules.html +1430 -198
  216. package/docs/types/AfterTransactionEventNode.html +305 -1
  217. package/docs/types/Allocator.html +321 -1
  218. package/docs/types/AlphaFiDoubleAssetVault.html +258 -1
  219. package/docs/types/AlphaFiMultiVaultBalance.html +219 -1
  220. package/docs/types/AlphaFiSingleAssetVault.html +244 -1
  221. package/docs/types/AlphaFiVault.html +214 -1
  222. package/docs/types/AlphaFiVaultBalance.html +220 -1
  223. package/docs/types/AlphaPoolType.html +383 -1
  224. package/docs/types/AlphaReceipt.html +220 -1
  225. package/docs/types/AlphaReceiptFields.html +421 -1
  226. package/docs/types/AlphaVaultBalance.html +245 -1
  227. package/docs/types/AutoBalancePoolNames.html +226 -1
  228. package/docs/types/AutoCompoundingEventNode.html +230 -1
  229. package/docs/types/BluefinInvestor.html +209 -1
  230. package/docs/types/BluefinPoolType.html +440 -1
  231. package/docs/types/BucketInvestor.html +249 -1
  232. package/docs/types/CetusInvestor.html +240 -1
  233. package/docs/types/CetusPoolType.html +433 -1
  234. package/docs/types/CetusSwapOptions.html +209 -1
  235. package/docs/types/CoinAmounts.html +216 -1
  236. package/docs/types/CoinName.html +293 -1
  237. package/docs/types/CoinType.html +294 -1
  238. package/docs/types/CommonInvestorFields.html +276 -1
  239. package/docs/types/CreatePoolOptions.html +246 -1
  240. package/docs/types/Distributor.html +341 -1
  241. package/docs/types/DoubleAssetMultiVaultBalance.html +236 -1
  242. package/docs/types/DoubleAssetPoolNames.html +297 -1
  243. package/docs/types/DoubleAssetTokenHoldings.html +232 -1
  244. package/docs/types/DoubleAssetVaultBalance.html +229 -1
  245. package/docs/types/EventCategory.html +209 -1
  246. package/docs/types/EventNode.html +229 -1
  247. package/docs/types/GetHoldersParams.html +221 -1
  248. package/docs/types/GetTokenHoldingsParams.html +227 -1
  249. package/docs/types/GetUserTokensFromTransactionsParams.html +233 -1
  250. package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +244 -1
  251. package/docs/types/GetVaultBalanceForActiveUsersParams.html +231 -1
  252. package/docs/types/GetVaultBalanceParams.html +217 -1
  253. package/docs/types/HoldingsObj.html +223 -1
  254. package/docs/types/Icon.html +266 -1
  255. package/docs/types/Investor.html +245 -1
  256. package/docs/types/LiquidityChangeEventNode.html +220 -1
  257. package/docs/types/LiquidityToTokensParams.html +255 -1
  258. package/docs/types/LiquidityToUsdParams.html +267 -1
  259. package/docs/types/LoopingDebt.html +258 -1
  260. package/docs/types/LoopingPoolNames.html +216 -1
  261. package/docs/types/LpBreakdownType.html +238 -1
  262. package/docs/types/MemberPoolDataType.html +276 -1
  263. package/docs/types/MemberType.html +269 -1
  264. package/docs/types/MultiGetVaultBalancesParams.html +229 -1
  265. package/docs/types/NaviInvestor.html +235 -1
  266. package/docs/types/OtherReceiptFields.html +373 -1
  267. package/docs/types/PoolName.html +214 -1
  268. package/docs/types/PoolReceipt.html +253 -1
  269. package/docs/types/PoolType.html +388 -1
  270. package/docs/types/Receipt.html +475 -1
  271. package/docs/types/ReceiptGQL.html +374 -1
  272. package/docs/types/SingleAssetMultiVaultBalance.html +232 -1
  273. package/docs/types/SingleAssetPoolNames.html +244 -1
  274. package/docs/types/SingleAssetTokenHoldings.html +228 -1
  275. package/docs/types/SingleAssetVaultBalance.html +223 -1
  276. package/docs/types/SingleGetVaultBalancesParams.html +224 -1
  277. package/docs/types/StrategyType.html +221 -1
  278. package/docs/types/SuiNetwork.html +213 -1
  279. package/docs/types/SwapOptions.html +248 -1
  280. package/docs/types/TickSpacing.html +212 -1
  281. package/docs/types/TotalWeightType.html +246 -1
  282. package/docs/types/TransactionBlockType.html +358 -1
  283. package/docs/types/UserPoolLiquidity.html +221 -1
  284. package/docs/types/UserPoolTokenHoldings.html +217 -1
  285. package/docs/types/UserUsdHoldings.html +223 -1
  286. package/docs/types/VaultBalance.html +216 -1
  287. package/docs/types/WithdrawV2EventNode.html +208 -1
  288. package/docs/variables/bluefinPoolMap.html +214 -1
  289. package/docs/variables/cetusPoolMap.html +214 -1
  290. package/docs/variables/coinsList.html +220 -1
  291. package/docs/variables/defunctPoolsSet.html +209 -1
  292. package/docs/variables/doubleAssetPoolCoinMap.html +237 -1
  293. package/docs/variables/eventCategories.html +210 -1
  294. package/docs/variables/ignoredWalletsForDailyRevenue.html +218 -1
  295. package/docs/variables/loopingAccountAddresses.html +219 -1
  296. package/docs/variables/loopingPoolCoinMap.html +233 -1
  297. package/docs/variables/naviAssetMap.html +215 -1
  298. package/docs/variables/poolIdPoolNameMap.html +218 -1
  299. package/docs/variables/poolInfo.html +319 -1
  300. package/docs/variables/singleAssetPoolCoinMap.html +229 -1
  301. package/docs/variables/stableCoins.html +207 -1
  302. package/package.json +2 -2
  303. package/prettier.config.js +3 -0
@@ -51,7 +51,7 @@ options) {
51
51
  inAmount: new BN(inputCoinAmount),
52
52
  slippage: slippage,
53
53
  };
54
- const result = await zapSwap(swapOptionsI2B, txb);
54
+ const result = await zapSwap(swapOptionsI2B, txb, poolName);
55
55
  if (result) {
56
56
  amountB = result.amountOut;
57
57
  txb = result.tx;
@@ -84,7 +84,7 @@ options) {
84
84
  inAmount: new BN(inputCoinAmount),
85
85
  slippage: slippage,
86
86
  };
87
- const result = await zapSwap(swapOptionsI2A, txb);
87
+ const result = await zapSwap(swapOptionsI2A, txb, poolName);
88
88
  if (result) {
89
89
  amountA = result.amountOut;
90
90
  txb = result.tx;
@@ -106,7 +106,7 @@ options) {
106
106
  inAmount: new BN(amount1),
107
107
  slippage: slippage,
108
108
  };
109
- const ratioQuote = await zapGetQuote(swapGateway, swapOptions);
109
+ const ratioQuote = await zapGetQuote(swapGateway, swapOptions, poolName);
110
110
  if (ratioQuote === undefined) {
111
111
  console.error("Error fetching ratioQuote for zap");
112
112
  return undefined;
@@ -134,7 +134,7 @@ options) {
134
134
  slippage: slippage,
135
135
  };
136
136
  if (inputCoinName === coinTypeA) {
137
- const result = await zapSwap(swapOptionsI2B, txb);
137
+ const result = await zapSwap(swapOptionsI2B, txb, poolName);
138
138
  if (result) {
139
139
  amountB = result.amountOut;
140
140
  txb = result.tx;
@@ -153,7 +153,7 @@ options) {
153
153
  }
154
154
  }
155
155
  else if (inputCoinName === coinTypeB) {
156
- const result = await zapSwap(swapOptionsI2A, txb);
156
+ const result = await zapSwap(swapOptionsI2A, txb, poolName);
157
157
  if (result) {
158
158
  amountA = result.amountOut;
159
159
  txb = result.tx;
@@ -172,7 +172,7 @@ options) {
172
172
  }
173
173
  }
174
174
  else {
175
- let result = await zapSwap(swapOptionsI2A, txb);
175
+ let result = await zapSwap(swapOptionsI2A, txb, poolName);
176
176
  if (result) {
177
177
  amountA = result.amountOut;
178
178
  txb = result.tx;
@@ -180,7 +180,7 @@ options) {
180
180
  coin1 = result.coinOut;
181
181
  }
182
182
  }
183
- result = await zapSwap(swapOptionsI2B, txb);
183
+ result = await zapSwap(swapOptionsI2B, txb, poolName);
184
184
  if (result) {
185
185
  amountB = result.amountOut;
186
186
  txb = result.tx;
@@ -201,8 +201,8 @@ options) {
201
201
  txb.transferObjects([feeCoinA, feeCoinB], fee_address);
202
202
  const pool1 = doubleAssetPoolCoinMap[poolName].coin1;
203
203
  const pool2 = doubleAssetPoolCoinMap[poolName].coin2;
204
- amountA = (Number(amountA) * 0.999).toString();
205
- amountB = (Number(amountB) * 0.999).toString();
204
+ amountA = (Number(amountA) * 0.995).toString();
205
+ amountB = (Number(amountB) * 0.995).toString();
206
206
  if (poolInfo[poolName].parentProtocolName === "CETUS") {
207
207
  if (pool1 === "CETUS" && pool2 === "SUI") {
208
208
  txb = await depositCetusSuiTxb(amountA, amountB, poolName, { address }, txb, coin1, coin2);
@@ -237,7 +237,7 @@ options) {
237
237
  txb.setGasBudget(100000000);
238
238
  return txb;
239
239
  }
240
- async function zapGetQuote(swapGateway, swapOptions) {
240
+ async function zapGetQuote(swapGateway, swapOptions, poolName) {
241
241
  if (swapOptions.pair.coinA.name === "SUI" &&
242
242
  swapOptions.pair.coinB.name === "STSUI") {
243
243
  const exchangeRate = new Decimal(await stSuiExchangeRate());
@@ -251,7 +251,9 @@ async function zapGetQuote(swapGateway, swapOptions) {
251
251
  return amount.mul(exchangeRate).toString();
252
252
  }
253
253
  else {
254
- const quoteResponse = await swapGateway.getQuote(swapOptions);
254
+ const quoteResponse = await swapGateway.getQuote(swapOptions, [
255
+ poolInfo[poolName].parentPoolId,
256
+ ]);
255
257
  if (quoteResponse) {
256
258
  return quoteResponse.returnAmountWithDecimal
257
259
  ? quoteResponse.returnAmountWithDecimal
@@ -259,10 +261,9 @@ async function zapGetQuote(swapGateway, swapOptions) {
259
261
  }
260
262
  }
261
263
  }
262
- async function zapSwap(swapOptions, txb) {
264
+ async function zapSwap(swapOptions, txb, poolName) {
263
265
  if (swapOptions.pair.coinA.name === "SUI" &&
264
266
  swapOptions.pair.coinB.name === "STSUI") {
265
- console.log("mintTx called");
266
267
  const result = await mintTx(swapOptions.inAmount ? swapOptions.inAmount.toString() : "0", txb);
267
268
  return {
268
269
  tx: result.tx,
@@ -273,14 +274,14 @@ async function zapSwap(swapOptions, txb) {
273
274
  }
274
275
  else if (swapOptions.pair.coinA.name === "STSUI" &&
275
276
  swapOptions.pair.coinB.name === "SUI") {
276
- console.log("redeemTx called");
277
277
  const result = await redeemTx(swapOptions.inAmount ? swapOptions.inAmount.toString() : "0", txb, { address: swapOptions.senderAddress });
278
278
  return result;
279
279
  }
280
280
  else {
281
- console.log("7k swap", swapOptions);
282
281
  const swapGateway = new SevenKGateway();
283
- const quoteResponse = await swapGateway.getQuote(swapOptions);
282
+ const quoteResponse = await swapGateway.getQuote(swapOptions, [
283
+ poolInfo[poolName].parentPoolId,
284
+ ]);
284
285
  if (quoteResponse) {
285
286
  const result = await swapGateway.getTransactionBlock(swapOptions, quoteResponse, txb);
286
287
  return {
@@ -590,7 +591,7 @@ const depositBluefinSuiFirstTxb = async (amountA, amountB, poolName, options, tr
590
591
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
591
592
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
592
593
  txb.object(getConf().BLUEFIN_SUI_USDC_POOL),
593
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
594
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
594
595
  txb.object(cetusPoolMap["USDC-SUI"]),
595
596
  txb.object(getConf().CLOCK_PACKAGE_ID),
596
597
  ],
@@ -617,7 +618,7 @@ const depositBluefinSuiFirstTxb = async (amountA, amountB, poolName, options, tr
617
618
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
618
619
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
619
620
  txb.object(getConf().BLUEFIN_SUI_BUCK_POOL),
620
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
621
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
621
622
  txb.object(cetusPoolMap["BUCK-SUI"]),
622
623
  txb.object(getConf().CLOCK_PACKAGE_ID),
623
624
  ],
@@ -644,7 +645,7 @@ const depositBluefinSuiFirstTxb = async (amountA, amountB, poolName, options, tr
644
645
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
645
646
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
646
647
  txb.object(getConf().BLUEFIN_SUI_AUSD_POOL),
647
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
648
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
648
649
  txb.object(cetusPoolMap["AUSD-SUI"]),
649
650
  txb.object(getConf().CLOCK_PACKAGE_ID),
650
651
  ],
@@ -670,7 +671,7 @@ const depositBluefinSuiFirstTxb = async (amountA, amountB, poolName, options, tr
670
671
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
671
672
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
672
673
  txb.object(getConf().BLUEFIN_SUI_USDC_POOL),
673
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
674
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
674
675
  txb.object(cetusPoolMap["USDC-SUI"]),
675
676
  txb.object(getConf().CLOCK_PACKAGE_ID),
676
677
  ],
@@ -740,7 +741,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
740
741
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
741
742
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
742
743
  txb.object(getConf().BLUEFIN_USDT_USDC_POOL),
743
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
744
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
744
745
  txb.object(cetusPoolMap["USDC-USDT"]),
745
746
  txb.object(cetusPoolMap["USDC-SUI"]),
746
747
  txb.object(getConf().CLOCK_PACKAGE_ID),
@@ -768,7 +769,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
768
769
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
769
770
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
770
771
  txb.object(getConf().BLUEFIN_AUSD_USDC_POOL),
771
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
772
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
772
773
  txb.object(cetusPoolMap["USDC-AUSD"]),
773
774
  txb.object(cetusPoolMap["USDC-SUI"]),
774
775
  txb.object(getConf().CLOCK_PACKAGE_ID),
@@ -796,7 +797,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
796
797
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
797
798
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
798
799
  txb.object(getConf().BLUEFIN_WBTC_USDC_POOL),
799
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
800
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
800
801
  txb.object(cetusPoolMap["USDC-WBTC"]),
801
802
  txb.object(cetusPoolMap["USDC-SUI"]),
802
803
  txb.object(getConf().CLOCK_PACKAGE_ID),
@@ -824,7 +825,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
824
825
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
825
826
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
826
827
  txb.object(getConf().BLUEFIN_SEND_USDC_POOL),
827
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
828
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
828
829
  txb.object(cetusPoolMap["USDC-SEND"]),
829
830
  txb.object(cetusPoolMap["USDC-SUI"]),
830
831
  txb.object(getConf().CLOCK_PACKAGE_ID),
@@ -852,7 +853,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
852
853
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
853
854
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
854
855
  txb.object(getConf().BLUEFIN_STSUI_USDC_POOL),
855
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
856
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
856
857
  txb.object(cetusPoolMap["USDC-STSUI"]),
857
858
  txb.object(cetusPoolMap["USDC-SUI"]),
858
859
  txb.object(getConf().CLOCK_PACKAGE_ID),
@@ -879,7 +880,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
879
880
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
880
881
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
881
882
  txb.object(getConf().BLUEFIN_USDT_USDC_POOL),
882
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
883
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
883
884
  txb.object(cetusPoolMap["USDC-USDT"]),
884
885
  txb.object(cetusPoolMap["USDC-SUI"]),
885
886
  txb.object(getConf().CLOCK_PACKAGE_ID),
@@ -907,7 +908,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
907
908
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
908
909
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
909
910
  txb.object(getConf().BLUEFIN_SUIUSDT_USDC_POOL),
910
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
911
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
911
912
  txb.object(cetusPoolMap["USDC-SUIUSDT"]),
912
913
  txb.object(cetusPoolMap["USDC-SUI"]),
913
914
  txb.object(getConf().CLOCK_PACKAGE_ID),
@@ -934,7 +935,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
934
935
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
935
936
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
936
937
  txb.object(getConf().BLUEFIN_SUIUSDT_USDC_POOL),
937
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
938
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
938
939
  txb.object(cetusPoolMap["USDC-SUIUSDT"]),
939
940
  txb.object(cetusPoolMap["USDC-SUI"]),
940
941
  txb.object(getConf().CLOCK_PACKAGE_ID),
@@ -961,7 +962,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
961
962
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
962
963
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
963
964
  txb.object(getConf().BLUEFIN_DEEP_BLUE_POOL),
964
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
965
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
965
966
  txb.object(cetusPoolMap["BLUE-DEEP"]),
966
967
  txb.object(cetusPoolMap["BLUE-SUI"]),
967
968
  txb.object(getConf().CLOCK_PACKAGE_ID),
@@ -1032,7 +1033,7 @@ const depositBluefinType2Txb = async (amountA, amountB, poolName, options, trans
1032
1033
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
1033
1034
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
1034
1035
  txb.object(getConf().BLUEFIN_ALPHA_USDC_POOL),
1035
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1036
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
1036
1037
  txb.object(cetusPoolMap["ALPHA-USDC"]),
1037
1038
  txb.object(cetusPoolMap["USDC-SUI"]),
1038
1039
  txb.object(getConf().CLOCK_PACKAGE_ID),
@@ -1060,7 +1061,7 @@ const depositBluefinType2Txb = async (amountA, amountB, poolName, options, trans
1060
1061
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
1061
1062
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
1062
1063
  txb.object(getConf().BLUEFIN_NAVX_VSUI_POOL),
1063
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1064
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
1064
1065
  txb.object(cetusPoolMap["NAVX-VSUI"]),
1065
1066
  txb.object(cetusPoolMap["VSUI-SUI"]),
1066
1067
  txb.object(getConf().CLOCK_PACKAGE_ID),
@@ -1301,6 +1302,56 @@ const depositBluefinSuiSecondTxb = async (amountA, amountB, poolName, options, t
1301
1302
  ],
1302
1303
  });
1303
1304
  }
1305
+ else if (poolName === "BLUEFIN-AUTOBALANCE-DEEP-SUI") {
1306
+ txb.moveCall({
1307
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit`,
1308
+ typeArguments: [
1309
+ coinsList[pool1].type,
1310
+ coinsList[pool2].type,
1311
+ coinsList["BLUE"].type,
1312
+ ],
1313
+ arguments: [
1314
+ txb.object(getConf().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
1315
+ someReceipt,
1316
+ txb.object(poolinfo.poolId),
1317
+ depositCoinA,
1318
+ depositCoinB,
1319
+ txb.object(getConf().ALPHA_DISTRIBUTOR),
1320
+ txb.object(poolinfo.investorId),
1321
+ txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
1322
+ txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
1323
+ txb.object(getConf().BLUEFIN_DEEP_SUI_POOL),
1324
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
1325
+ txb.object(cetusPoolMap["DEEP-SUI"]),
1326
+ txb.object(getConf().CLOCK_PACKAGE_ID),
1327
+ ],
1328
+ });
1329
+ }
1330
+ else if (poolName === "BLUEFIN-AUTOBALANCE-BLUE-SUI") {
1331
+ txb.moveCall({
1332
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit`,
1333
+ typeArguments: [
1334
+ coinsList[pool1].type,
1335
+ coinsList[pool2].type,
1336
+ coinsList["DEEP"].type,
1337
+ ],
1338
+ arguments: [
1339
+ txb.object(getConf().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
1340
+ someReceipt,
1341
+ txb.object(poolinfo.poolId),
1342
+ depositCoinA,
1343
+ depositCoinB,
1344
+ txb.object(getConf().ALPHA_DISTRIBUTOR),
1345
+ txb.object(poolinfo.investorId),
1346
+ txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
1347
+ txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
1348
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
1349
+ txb.object(getConf().BLUEFIN_DEEP_SUI_POOL),
1350
+ txb.object(cetusPoolMap["BLUE-SUI"]),
1351
+ txb.object(getConf().CLOCK_PACKAGE_ID),
1352
+ ],
1353
+ });
1354
+ }
1304
1355
  txb.transferObjects([coin1Arg, coin2Arg], address);
1305
1356
  }
1306
1357
  else {
@@ -1364,7 +1415,7 @@ const depositBluefinStsuiTxb = async (amountA, amountB, poolName, options, trans
1364
1415
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
1365
1416
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
1366
1417
  txb.object(getConf().BLUEFIN_STSUI_USDC_POOL),
1367
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1418
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
1368
1419
  txb.object(cetusPoolMap["USDC-SUI"]),
1369
1420
  txb.object(bluefinPoolMap["SUI-USDC"]),
1370
1421
  txb.object(getConf().LST_INFO),
@@ -1394,7 +1445,7 @@ const depositBluefinStsuiTxb = async (amountA, amountB, poolName, options, trans
1394
1445
  txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
1395
1446
  txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
1396
1447
  txb.object(getConf().BLUEFIN_ALPHA_STSUI_POOL),
1397
- txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1448
+ txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
1398
1449
  txb.object(cetusPoolMap["ALPHA-SUI"]),
1399
1450
  txb.object(bluefinPoolMap["SUI-ALPHA"]),
1400
1451
  txb.object(getConf().LST_INFO),
@@ -1432,7 +1483,7 @@ export async function getZapAmounts(inputCoinAmount, inputCoinName, poolName, sl
1432
1483
  inAmount: new BN(amount1),
1433
1484
  slippage: slippage,
1434
1485
  };
1435
- const ratioQuote = await zapGetQuote(swapGateway, swapOptions);
1486
+ const ratioQuote = await zapGetQuote(swapGateway, swapOptions, poolName);
1436
1487
  if (ratioQuote) {
1437
1488
  const amount1InCoinType2 = Number(ratioQuote);
1438
1489
  const totalAmount = amount2 + amount1InCoinType2;
@@ -1458,16 +1509,16 @@ export async function getZapAmounts(inputCoinAmount, inputCoinName, poolName, sl
1458
1509
  slippage: slippage,
1459
1510
  };
1460
1511
  if (inputCoinName === coinTypeA) {
1461
- amountB = await zapGetQuote(swapGateway, swapOptionsI2B);
1512
+ amountB = await zapGetQuote(swapGateway, swapOptionsI2B, poolName);
1462
1513
  amountA = inputAmountToType1.toString();
1463
1514
  }
1464
1515
  else if (inputCoinName === coinTypeB) {
1465
- amountA = await zapGetQuote(swapGateway, swapOptionsI2A);
1516
+ amountA = await zapGetQuote(swapGateway, swapOptionsI2A, poolName);
1466
1517
  amountB = inputAmountToType2.toString();
1467
1518
  }
1468
1519
  else {
1469
- amountA = await zapGetQuote(swapGateway, swapOptionsI2A);
1470
- amountB = await zapGetQuote(swapGateway, swapOptionsI2B);
1520
+ amountA = await zapGetQuote(swapGateway, swapOptionsI2A, poolName);
1521
+ amountB = await zapGetQuote(swapGateway, swapOptionsI2B, poolName);
1471
1522
  }
1472
1523
  if (amountA && amountB) {
1473
1524
  const [coin1Price, coin2Price] = await getLatestPrices([