@alphafi/alphafi-sdk 0.0.54 → 0.0.57

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 +98 -0
  5. package/dist/cjs/common/constants.d.ts.map +1 -1
  6. package/dist/cjs/common/constants.js +76 -18
  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 +127 -40
  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 +5 -5
  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 +62 -4
  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 +502 -132
  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 +98 -0
  53. package/dist/esm/common/constants.d.ts.map +1 -1
  54. package/dist/esm/common/constants.js +76 -18
  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 +127 -40
  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 +5 -5
  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 +62 -4
  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 +502 -132
  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
@@ -56,7 +56,7 @@ options) {
56
56
  inAmount: new bn_js_1.default(inputCoinAmount),
57
57
  slippage: slippage,
58
58
  };
59
- const result = await zapSwap(swapOptionsI2B, txb);
59
+ const result = await zapSwap(swapOptionsI2B, txb, poolName);
60
60
  if (result) {
61
61
  amountB = result.amountOut;
62
62
  txb = result.tx;
@@ -89,7 +89,7 @@ options) {
89
89
  inAmount: new bn_js_1.default(inputCoinAmount),
90
90
  slippage: slippage,
91
91
  };
92
- const result = await zapSwap(swapOptionsI2A, txb);
92
+ const result = await zapSwap(swapOptionsI2A, txb, poolName);
93
93
  if (result) {
94
94
  amountA = result.amountOut;
95
95
  txb = result.tx;
@@ -111,7 +111,7 @@ options) {
111
111
  inAmount: new bn_js_1.default(amount1),
112
112
  slippage: slippage,
113
113
  };
114
- const ratioQuote = await zapGetQuote(swapGateway, swapOptions);
114
+ const ratioQuote = await zapGetQuote(swapGateway, swapOptions, poolName);
115
115
  if (ratioQuote === undefined) {
116
116
  console.error("Error fetching ratioQuote for zap");
117
117
  return undefined;
@@ -139,7 +139,7 @@ options) {
139
139
  slippage: slippage,
140
140
  };
141
141
  if (inputCoinName === coinTypeA) {
142
- const result = await zapSwap(swapOptionsI2B, txb);
142
+ const result = await zapSwap(swapOptionsI2B, txb, poolName);
143
143
  if (result) {
144
144
  amountB = result.amountOut;
145
145
  txb = result.tx;
@@ -158,7 +158,7 @@ options) {
158
158
  }
159
159
  }
160
160
  else if (inputCoinName === coinTypeB) {
161
- const result = await zapSwap(swapOptionsI2A, txb);
161
+ const result = await zapSwap(swapOptionsI2A, txb, poolName);
162
162
  if (result) {
163
163
  amountA = result.amountOut;
164
164
  txb = result.tx;
@@ -177,7 +177,7 @@ options) {
177
177
  }
178
178
  }
179
179
  else {
180
- let result = await zapSwap(swapOptionsI2A, txb);
180
+ let result = await zapSwap(swapOptionsI2A, txb, poolName);
181
181
  if (result) {
182
182
  amountA = result.amountOut;
183
183
  txb = result.tx;
@@ -185,7 +185,7 @@ options) {
185
185
  coin1 = result.coinOut;
186
186
  }
187
187
  }
188
- result = await zapSwap(swapOptionsI2B, txb);
188
+ result = await zapSwap(swapOptionsI2B, txb, poolName);
189
189
  if (result) {
190
190
  amountB = result.amountOut;
191
191
  txb = result.tx;
@@ -206,8 +206,8 @@ options) {
206
206
  txb.transferObjects([feeCoinA, feeCoinB], fee_address);
207
207
  const pool1 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
208
208
  const pool2 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
209
- amountA = (Number(amountA) * 0.999).toString();
210
- amountB = (Number(amountB) * 0.999).toString();
209
+ amountA = (Number(amountA) * 0.995).toString();
210
+ amountB = (Number(amountB) * 0.995).toString();
211
211
  if (maps_js_1.poolInfo[poolName].parentProtocolName === "CETUS") {
212
212
  if (pool1 === "CETUS" && pool2 === "SUI") {
213
213
  txb = await depositCetusSuiTxb(amountA, amountB, poolName, { address }, txb, coin1, coin2);
@@ -242,7 +242,7 @@ options) {
242
242
  txb.setGasBudget(100000000);
243
243
  return txb;
244
244
  }
245
- async function zapGetQuote(swapGateway, swapOptions) {
245
+ async function zapGetQuote(swapGateway, swapOptions, poolName) {
246
246
  if (swapOptions.pair.coinA.name === "SUI" &&
247
247
  swapOptions.pair.coinB.name === "STSUI") {
248
248
  const exchangeRate = new decimal_js_1.Decimal(await (0, stsui_sdk_1.stSuiExchangeRate)());
@@ -256,7 +256,9 @@ async function zapGetQuote(swapGateway, swapOptions) {
256
256
  return amount.mul(exchangeRate).toString();
257
257
  }
258
258
  else {
259
- const quoteResponse = await swapGateway.getQuote(swapOptions);
259
+ const quoteResponse = await swapGateway.getQuote(swapOptions, [
260
+ maps_js_1.poolInfo[poolName].parentPoolId,
261
+ ]);
260
262
  if (quoteResponse) {
261
263
  return quoteResponse.returnAmountWithDecimal
262
264
  ? quoteResponse.returnAmountWithDecimal
@@ -264,10 +266,9 @@ async function zapGetQuote(swapGateway, swapOptions) {
264
266
  }
265
267
  }
266
268
  }
267
- async function zapSwap(swapOptions, txb) {
269
+ async function zapSwap(swapOptions, txb, poolName) {
268
270
  if (swapOptions.pair.coinA.name === "SUI" &&
269
271
  swapOptions.pair.coinB.name === "STSUI") {
270
- console.log("mintTx called");
271
272
  const result = await (0, stsui_sdk_1.mintTx)(swapOptions.inAmount ? swapOptions.inAmount.toString() : "0", txb);
272
273
  return {
273
274
  tx: result.tx,
@@ -278,14 +279,14 @@ async function zapSwap(swapOptions, txb) {
278
279
  }
279
280
  else if (swapOptions.pair.coinA.name === "STSUI" &&
280
281
  swapOptions.pair.coinB.name === "SUI") {
281
- console.log("redeemTx called");
282
282
  const result = await (0, stsui_sdk_1.redeemTx)(swapOptions.inAmount ? swapOptions.inAmount.toString() : "0", txb, { address: swapOptions.senderAddress });
283
283
  return result;
284
284
  }
285
285
  else {
286
- console.log("7k swap", swapOptions);
287
286
  const swapGateway = new _7k_js_1.SevenKGateway();
288
- const quoteResponse = await swapGateway.getQuote(swapOptions);
287
+ const quoteResponse = await swapGateway.getQuote(swapOptions, [
288
+ maps_js_1.poolInfo[poolName].parentPoolId,
289
+ ]);
289
290
  if (quoteResponse) {
290
291
  const result = await swapGateway.getTransactionBlock(swapOptions, quoteResponse, txb);
291
292
  return {
@@ -595,7 +596,7 @@ const depositBluefinSuiFirstTxb = async (amountA, amountB, poolName, options, tr
595
596
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
596
597
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
597
598
  txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
598
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
599
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
599
600
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
600
601
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
601
602
  ],
@@ -622,7 +623,7 @@ const depositBluefinSuiFirstTxb = async (amountA, amountB, poolName, options, tr
622
623
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
623
624
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
624
625
  txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_BUCK_POOL),
625
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
626
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
626
627
  txb.object(maps_js_1.cetusPoolMap["BUCK-SUI"]),
627
628
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
628
629
  ],
@@ -649,7 +650,7 @@ const depositBluefinSuiFirstTxb = async (amountA, amountB, poolName, options, tr
649
650
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
650
651
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
651
652
  txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_AUSD_POOL),
652
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
653
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
653
654
  txb.object(maps_js_1.cetusPoolMap["AUSD-SUI"]),
654
655
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
655
656
  ],
@@ -675,7 +676,7 @@ const depositBluefinSuiFirstTxb = async (amountA, amountB, poolName, options, tr
675
676
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
676
677
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
677
678
  txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
678
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
679
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
679
680
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
680
681
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
681
682
  ],
@@ -745,7 +746,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
745
746
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
746
747
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
747
748
  txb.object((0, constants_js_1.getConf)().BLUEFIN_USDT_USDC_POOL),
748
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
749
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
749
750
  txb.object(maps_js_1.cetusPoolMap["USDC-USDT"]),
750
751
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
751
752
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -773,7 +774,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
773
774
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
774
775
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
775
776
  txb.object((0, constants_js_1.getConf)().BLUEFIN_AUSD_USDC_POOL),
776
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
777
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
777
778
  txb.object(maps_js_1.cetusPoolMap["USDC-AUSD"]),
778
779
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
779
780
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -801,7 +802,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
801
802
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
802
803
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
803
804
  txb.object((0, constants_js_1.getConf)().BLUEFIN_WBTC_USDC_POOL),
804
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
805
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
805
806
  txb.object(maps_js_1.cetusPoolMap["USDC-WBTC"]),
806
807
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
807
808
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -829,7 +830,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
829
830
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
830
831
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
831
832
  txb.object((0, constants_js_1.getConf)().BLUEFIN_SEND_USDC_POOL),
832
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
833
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
833
834
  txb.object(maps_js_1.cetusPoolMap["USDC-SEND"]),
834
835
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
835
836
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -857,7 +858,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
857
858
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
858
859
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
859
860
  txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_USDC_POOL),
860
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
861
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
861
862
  txb.object(maps_js_1.cetusPoolMap["USDC-STSUI"]),
862
863
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
863
864
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -884,7 +885,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
884
885
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
885
886
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
886
887
  txb.object((0, constants_js_1.getConf)().BLUEFIN_USDT_USDC_POOL),
887
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
888
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
888
889
  txb.object(maps_js_1.cetusPoolMap["USDC-USDT"]),
889
890
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
890
891
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -912,7 +913,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
912
913
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
913
914
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
914
915
  txb.object((0, constants_js_1.getConf)().BLUEFIN_SUIUSDT_USDC_POOL),
915
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
916
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
916
917
  txb.object(maps_js_1.cetusPoolMap["USDC-SUIUSDT"]),
917
918
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
918
919
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -939,7 +940,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
939
940
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
940
941
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
941
942
  txb.object((0, constants_js_1.getConf)().BLUEFIN_SUIUSDT_USDC_POOL),
942
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
943
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
943
944
  txb.object(maps_js_1.cetusPoolMap["USDC-SUIUSDT"]),
944
945
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
945
946
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -966,7 +967,7 @@ const depositBluefinType1Txb = async (amountA, amountB, poolName, options, trans
966
967
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
967
968
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
968
969
  txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_BLUE_POOL),
969
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
970
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
970
971
  txb.object(maps_js_1.cetusPoolMap["BLUE-DEEP"]),
971
972
  txb.object(maps_js_1.cetusPoolMap["BLUE-SUI"]),
972
973
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -1037,7 +1038,7 @@ const depositBluefinType2Txb = async (amountA, amountB, poolName, options, trans
1037
1038
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1038
1039
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1039
1040
  txb.object((0, constants_js_1.getConf)().BLUEFIN_ALPHA_USDC_POOL),
1040
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1041
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
1041
1042
  txb.object(maps_js_1.cetusPoolMap["ALPHA-USDC"]),
1042
1043
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
1043
1044
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -1065,7 +1066,7 @@ const depositBluefinType2Txb = async (amountA, amountB, poolName, options, trans
1065
1066
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1066
1067
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1067
1068
  txb.object((0, constants_js_1.getConf)().BLUEFIN_NAVX_VSUI_POOL),
1068
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1069
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
1069
1070
  txb.object(maps_js_1.cetusPoolMap["NAVX-VSUI"]),
1070
1071
  txb.object(maps_js_1.cetusPoolMap["VSUI-SUI"]),
1071
1072
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -1306,6 +1307,56 @@ const depositBluefinSuiSecondTxb = async (amountA, amountB, poolName, options, t
1306
1307
  ],
1307
1308
  });
1308
1309
  }
1310
+ else if (poolName === "BLUEFIN-AUTOBALANCE-DEEP-SUI") {
1311
+ txb.moveCall({
1312
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit`,
1313
+ typeArguments: [
1314
+ coins_js_1.coinsList[pool1].type,
1315
+ coins_js_1.coinsList[pool2].type,
1316
+ coins_js_1.coinsList["BLUE"].type,
1317
+ ],
1318
+ arguments: [
1319
+ txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
1320
+ someReceipt,
1321
+ txb.object(poolinfo.poolId),
1322
+ depositCoinA,
1323
+ depositCoinB,
1324
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1325
+ txb.object(poolinfo.investorId),
1326
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1327
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1328
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
1329
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
1330
+ txb.object(maps_js_1.cetusPoolMap["DEEP-SUI"]),
1331
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1332
+ ],
1333
+ });
1334
+ }
1335
+ else if (poolName === "BLUEFIN-AUTOBALANCE-BLUE-SUI") {
1336
+ txb.moveCall({
1337
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit`,
1338
+ typeArguments: [
1339
+ coins_js_1.coinsList[pool1].type,
1340
+ coins_js_1.coinsList[pool2].type,
1341
+ coins_js_1.coinsList["DEEP"].type,
1342
+ ],
1343
+ arguments: [
1344
+ txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
1345
+ someReceipt,
1346
+ txb.object(poolinfo.poolId),
1347
+ depositCoinA,
1348
+ depositCoinB,
1349
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1350
+ txb.object(poolinfo.investorId),
1351
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1352
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1353
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
1354
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
1355
+ txb.object(maps_js_1.cetusPoolMap["BLUE-SUI"]),
1356
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1357
+ ],
1358
+ });
1359
+ }
1309
1360
  txb.transferObjects([coin1Arg, coin2Arg], address);
1310
1361
  }
1311
1362
  else {
@@ -1369,7 +1420,7 @@ const depositBluefinStsuiTxb = async (amountA, amountB, poolName, options, trans
1369
1420
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1370
1421
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1371
1422
  txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_USDC_POOL),
1372
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1423
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
1373
1424
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
1374
1425
  txb.object(maps_js_1.bluefinPoolMap["SUI-USDC"]),
1375
1426
  txb.object((0, constants_js_1.getConf)().LST_INFO),
@@ -1399,7 +1450,7 @@ const depositBluefinStsuiTxb = async (amountA, amountB, poolName, options, trans
1399
1450
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1400
1451
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1401
1452
  txb.object((0, constants_js_1.getConf)().BLUEFIN_ALPHA_STSUI_POOL),
1402
- txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1453
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
1403
1454
  txb.object(maps_js_1.cetusPoolMap["ALPHA-SUI"]),
1404
1455
  txb.object(maps_js_1.bluefinPoolMap["SUI-ALPHA"]),
1405
1456
  txb.object((0, constants_js_1.getConf)().LST_INFO),
@@ -1437,7 +1488,7 @@ async function getZapAmounts(inputCoinAmount, inputCoinName, poolName, slippage,
1437
1488
  inAmount: new bn_js_1.default(amount1),
1438
1489
  slippage: slippage,
1439
1490
  };
1440
- const ratioQuote = await zapGetQuote(swapGateway, swapOptions);
1491
+ const ratioQuote = await zapGetQuote(swapGateway, swapOptions, poolName);
1441
1492
  if (ratioQuote) {
1442
1493
  const amount1InCoinType2 = Number(ratioQuote);
1443
1494
  const totalAmount = amount2 + amount1InCoinType2;
@@ -1463,16 +1514,16 @@ async function getZapAmounts(inputCoinAmount, inputCoinName, poolName, slippage,
1463
1514
  slippage: slippage,
1464
1515
  };
1465
1516
  if (inputCoinName === coinTypeA) {
1466
- amountB = await zapGetQuote(swapGateway, swapOptionsI2B);
1517
+ amountB = await zapGetQuote(swapGateway, swapOptionsI2B, poolName);
1467
1518
  amountA = inputAmountToType1.toString();
1468
1519
  }
1469
1520
  else if (inputCoinName === coinTypeB) {
1470
- amountA = await zapGetQuote(swapGateway, swapOptionsI2A);
1521
+ amountA = await zapGetQuote(swapGateway, swapOptionsI2A, poolName);
1471
1522
  amountB = inputAmountToType2.toString();
1472
1523
  }
1473
1524
  else {
1474
- amountA = await zapGetQuote(swapGateway, swapOptionsI2A);
1475
- amountB = await zapGetQuote(swapGateway, swapOptionsI2B);
1525
+ amountA = await zapGetQuote(swapGateway, swapOptionsI2A, poolName);
1526
+ amountB = await zapGetQuote(swapGateway, swapOptionsI2B, poolName);
1476
1527
  }
1477
1528
  if (amountA && amountB) {
1478
1529
  const [coin1Price, coin2Price] = await (0, prices_js_1.getLatestPrices)([