@alphafi/alphafi-sdk 0.0.99 → 0.0.101
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/dist/cjs/common/coins.d.ts.map +1 -1
- package/dist/cjs/common/coins.js +6 -0
- package/dist/cjs/common/coins.js.map +1 -1
- package/dist/cjs/common/pyth.d.ts +1 -1
- package/dist/cjs/common/pyth.d.ts.map +1 -1
- package/dist/cjs/common/pyth.js.map +1 -1
- package/dist/cjs/common/types.d.ts +2 -2
- package/dist/cjs/common/types.d.ts.map +1 -1
- package/dist/cjs/common/types.js.map +1 -1
- package/dist/cjs/transactions/collect_rewards.js +1 -1
- package/dist/cjs/transactions/collect_rewards.js.map +1 -1
- package/dist/cjs/transactions/zapDeposit.d.ts +2 -1
- package/dist/cjs/transactions/zapDeposit.d.ts.map +1 -1
- package/dist/cjs/transactions/zapDeposit.js +75 -316
- package/dist/cjs/transactions/zapDeposit.js.map +1 -1
- package/dist/esm/common/coins.d.ts.map +1 -1
- package/dist/esm/common/coins.js +6 -0
- package/dist/esm/common/coins.js.map +1 -1
- package/dist/esm/common/pyth.d.ts +1 -1
- package/dist/esm/common/pyth.d.ts.map +1 -1
- package/dist/esm/common/pyth.js.map +1 -1
- package/dist/esm/common/types.d.ts +2 -2
- package/dist/esm/common/types.d.ts.map +1 -1
- package/dist/esm/common/types.js.map +1 -1
- package/dist/esm/transactions/collect_rewards.js +1 -1
- package/dist/esm/transactions/collect_rewards.js.map +1 -1
- package/dist/esm/transactions/zapDeposit.d.ts +2 -1
- package/dist/esm/transactions/zapDeposit.d.ts.map +1 -1
- package/dist/esm/transactions/zapDeposit.js +74 -317
- package/dist/esm/transactions/zapDeposit.js.map +1 -1
- package/docs/functions/alphaLpBreakdown.html +1 -1
- package/docs/functions/cetusLpBreakdown.html +1 -1
- package/docs/functions/claimRewardTxb.html +1 -1
- package/docs/functions/claimRewardsTxb.html +1 -1
- package/docs/functions/coinAmountToXTokensDoubleAsset.html +1 -1
- package/docs/functions/coinAmountToXTokensSingleAsset.html +1 -1
- package/docs/functions/coinsInPool.html +1 -1
- package/docs/functions/collectAndSwapRewardsLyf.html +1 -1
- package/docs/functions/collectAndSwapRewardsSingleLoop.html +1 -1
- package/docs/functions/collectRewardTxb.html +1 -1
- package/docs/functions/collectRewards.html +1 -1
- package/docs/functions/deposit.html +1 -1
- package/docs/functions/depositDoubleAssetTxb.html +1 -1
- package/docs/functions/depositSingleAssetTxb.html +1 -1
- package/docs/functions/fetchAfterTransactionEvents.html +1 -1
- package/docs/functions/fetchAirdropClaimEvents.html +1 -1
- package/docs/functions/fetchAutoCompoundingEvents.html +1 -1
- package/docs/functions/fetchAutoCompoundingEventsGql.html +1 -1
- package/docs/functions/fetchCetusPools.html +1 -1
- package/docs/functions/fetchChainIdentifier.html +1 -1
- package/docs/functions/fetchCheckRatioEvents.html +1 -1
- package/docs/functions/fetchEvents.html +1 -1
- package/docs/functions/fetchLiquidityChangeEvents.html +1 -1
- package/docs/functions/fetchMultiCategoryEvents.html +1 -1
- package/docs/functions/fetchMultiReceipts.html +1 -1
- package/docs/functions/fetchNftHolders.html +1 -1
- package/docs/functions/fetchPools.html +1 -1
- package/docs/functions/fetchPortfolioData.html +1 -1
- package/docs/functions/fetchProtocolData.html +1 -1
- package/docs/functions/fetchRequiredPrices.html +1 -1
- package/docs/functions/fetchTVL.html +1 -1
- package/docs/functions/fetchTransactions.html +1 -1
- package/docs/functions/fetchUserVaultBalances.html +1 -1
- package/docs/functions/fetchUserVaults.html +1 -1
- package/docs/functions/fetchUserWalletData.html +1 -1
- package/docs/functions/fetchVoloExchangeRate.html +1 -1
- package/docs/functions/fetchWithdrawV2Events.html +1 -1
- package/docs/functions/getAirdropShare.html +1 -1
- package/docs/functions/getAllDoubleAssetVaults.html +1 -1
- package/docs/functions/getAllSingleAssetVaults.html +1 -1
- package/docs/functions/getAllVaultBalances.html +1 -1
- package/docs/functions/getAllVaults.html +1 -1
- package/docs/functions/getAlphaUnlocks.html +1 -1
- package/docs/functions/getAlphaVaultBalance.html +1 -1
- package/docs/functions/getAmounts.html +1 -1
- package/docs/functions/getApr.html +1 -1
- package/docs/functions/getAprs.html +1 -1
- package/docs/functions/getApy.html +1 -1
- package/docs/functions/getApys.html +1 -1
- package/docs/functions/getCetusInvestorTicksMap.html +1 -1
- package/docs/functions/getCetusPool.html +1 -1
- package/docs/functions/getCetusSqrtPriceMap.html +1 -1
- package/docs/functions/getCoinAmountsFromLiquidity.html +1 -1
- package/docs/functions/getConf.html +1 -1
- package/docs/functions/getCurrentTick.html +1 -1
- package/docs/functions/getDistributor.html +1 -1
- package/docs/functions/getDoubleAssetVaultBalance.html +1 -1
- package/docs/functions/getDoubleAssetVaults.html +1 -1
- package/docs/functions/getInvestor.html +1 -1
- package/docs/functions/getInvestorPoolMap.html +1 -1
- package/docs/functions/getLastAutoCompoundTime.html +1 -1
- package/docs/functions/getLatestPrices.html +1 -1
- package/docs/functions/getLiquidity.html +1 -1
- package/docs/functions/getMultiCetusPool.html +1 -1
- package/docs/functions/getMultiInvestor.html +1 -1
- package/docs/functions/getMultiLatestPrices.html +1 -1
- package/docs/functions/getMultiParentPool.html +1 -1
- package/docs/functions/getMultiPool.html +1 -1
- package/docs/functions/getMultiReceipts.html +1 -1
- package/docs/functions/getParentPool.html +1 -1
- package/docs/functions/getPool.html +1 -1
- package/docs/functions/getPoolExchangeRate.html +1 -1
- package/docs/functions/getPoolExchangeRateMap.html +1 -1
- package/docs/functions/getPoolsWeightDistribution.html +1 -1
- package/docs/functions/getPositionRange.html +1 -1
- package/docs/functions/getPositionRanges.html +1 -1
- package/docs/functions/getPositionTicks.html +1 -1
- package/docs/functions/getPriceToTick.html +1 -1
- package/docs/functions/getRebalanceHistories.html +1 -1
- package/docs/functions/getRebalanceHistory.html +1 -1
- package/docs/functions/getReceipts.html +1 -1
- package/docs/functions/getSingleAssetVaultBalance.html +1 -1
- package/docs/functions/getSingleAssetVaults.html +1 -1
- package/docs/functions/getSuiClient.html +2 -2
- package/docs/functions/getSuiNodeUrl.html +2 -2
- package/docs/functions/getTVLs-1.html +1 -1
- package/docs/functions/getTickSpacing.html +1 -1
- package/docs/functions/getTickToPrice.html +1 -1
- package/docs/functions/getTvls.html +1 -1
- package/docs/functions/getVaultBalance.html +1 -1
- package/docs/functions/getVaults.html +1 -1
- package/docs/functions/lastAutocompoundTime.html +1 -1
- package/docs/functions/liquidityToTokens.html +1 -1
- package/docs/functions/migrateBoostedToLoop.html +1 -1
- package/docs/functions/multiLiquidityToTokens.html +1 -1
- package/docs/functions/multiTokensToUsd.html +1 -1
- package/docs/functions/multiXTokensToLiquidity.html +1 -1
- package/docs/functions/parseUserWalletData.html +1 -1
- package/docs/functions/pendingRewardAmount.html +1 -1
- package/docs/functions/setCustomSuiClient.html +2 -2
- package/docs/functions/setSuiClient.html +2 -2
- package/docs/functions/setSuiNodeUrl.html +2 -2
- package/docs/functions/setWeights.html +1 -1
- package/docs/functions/withdraw.html +1 -1
- package/docs/functions/withdrawAlphaTxb.html +1 -1
- package/docs/functions/withdrawTxb.html +1 -1
- package/docs/functions/zapDepositQuoteTxb.html +1 -1
- package/docs/functions/zapDepositTxb.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +2 -2
- package/docs/interfaces/Coin.html +6 -6
- package/docs/interfaces/CoinPair.html +2 -2
- package/docs/interfaces/CommonEventAttributes.html +2 -2
- package/docs/interfaces/NaviVoloData.html +2 -2
- package/docs/interfaces/PoolData.html +2 -2
- package/docs/interfaces/PoolWeightDistribution.html +2 -2
- package/docs/interfaces/RebalanceHistoryType.html +2 -2
- package/docs/modules.html +1 -1
- package/docs/types/AfterTransactionEventNode.html +1 -1
- package/docs/types/AirdropClaimEventNode.html +1 -1
- package/docs/types/Allocator.html +2 -2
- package/docs/types/AlphaFiDoubleAssetVault.html +2 -2
- package/docs/types/AlphaFiMultiVaultBalance.html +1 -1
- package/docs/types/AlphaFiSingleAssetVault.html +2 -2
- package/docs/types/AlphaFiVault.html +1 -1
- package/docs/types/AlphaFiVaultBalance.html +1 -1
- package/docs/types/AlphaLendInvestor.html +1 -1
- package/docs/types/AlphaPoolType.html +2 -2
- package/docs/types/AlphaReceipt.html +2 -2
- package/docs/types/AlphaReceiptFields.html +2 -2
- package/docs/types/AlphaVaultBalance.html +2 -2
- package/docs/types/AutoBalancePoolNames.html +1 -1
- package/docs/types/AutoCompoundingEventNode.html +1 -1
- package/docs/types/BluefinInvestor.html +1 -1
- package/docs/types/BluefinLyfInvestor.html +1 -1
- package/docs/types/BluefinPoolType.html +2 -2
- package/docs/types/BucketInvestor.html +2 -2
- package/docs/types/CetusInvestor.html +2 -2
- package/docs/types/CetusPoolType.html +2 -2
- package/docs/types/CetusSwapOptions.html +1 -1
- package/docs/types/CoinAmounts.html +2 -2
- package/docs/types/CoinName.html +1 -1
- package/docs/types/CoinType.html +1 -1
- package/docs/types/CommonInvestorFields.html +2 -2
- package/docs/types/CreatePoolOptions.html +2 -2
- package/docs/types/Distributor.html +2 -2
- package/docs/types/DoubleAssetMultiVaultBalance.html +2 -2
- package/docs/types/DoubleAssetPoolNames.html +1 -1
- package/docs/types/DoubleAssetTokenHoldings.html +2 -2
- package/docs/types/DoubleAssetVaultBalance.html +2 -2
- package/docs/types/EventCategory.html +1 -1
- package/docs/types/EventNode.html +1 -1
- package/docs/types/GetHoldersParams.html +2 -2
- package/docs/types/GetTokenHoldingsParams.html +2 -2
- package/docs/types/GetUserTokensFromTransactionsParams.html +2 -2
- package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +2 -2
- package/docs/types/GetVaultBalanceParams.html +1 -1
- package/docs/types/HoldingsObj.html +2 -2
- package/docs/types/Icon.html +1 -1
- package/docs/types/Investor.html +1 -1
- package/docs/types/LiquidityChangeEventNode.html +1 -1
- package/docs/types/LiquidityToTokensParams.html +2 -2
- package/docs/types/LiquidityToUsdParams.html +2 -2
- package/docs/types/LoopingDebt.html +2 -2
- package/docs/types/LoopingPoolNames.html +1 -1
- package/docs/types/LpBreakdownType.html +2 -2
- package/docs/types/MemberPoolDataType.html +2 -2
- package/docs/types/MemberType.html +2 -2
- package/docs/types/MultiGetVaultBalancesParams.html +2 -2
- package/docs/types/NaviInvestor.html +2 -2
- package/docs/types/OtherReceiptFields.html +2 -2
- package/docs/types/PoolName.html +1 -1
- package/docs/types/PoolReceipt.html +1 -1
- package/docs/types/PoolType.html +2 -2
- package/docs/types/Receipt.html +2 -2
- package/docs/types/ReceiptGQL.html +2 -2
- package/docs/types/SingleAssetMultiVaultBalance.html +2 -2
- package/docs/types/SingleAssetPoolNames.html +1 -1
- package/docs/types/SingleAssetTokenHoldings.html +2 -2
- package/docs/types/SingleAssetVaultBalance.html +2 -2
- package/docs/types/SingleGetVaultBalancesParams.html +2 -2
- package/docs/types/StrategyType.html +1 -1
- package/docs/types/SuiNetwork.html +1 -1
- package/docs/types/SwapOptions.html +1 -1
- package/docs/types/TickSpacing.html +1 -1
- package/docs/types/TotalWeightType.html +2 -2
- package/docs/types/TransactionBlockType.html +2 -2
- package/docs/types/UserPoolLiquidity.html +2 -2
- package/docs/types/UserPoolTokenHoldings.html +1 -1
- package/docs/types/UserUsdHoldings.html +2 -2
- package/docs/types/VaultBalance.html +1 -1
- package/docs/types/VoteCastEvent.html +1 -1
- package/docs/types/WithdrawV2EventNode.html +1 -1
- package/docs/variables/AUTOBALANCE_SUI_FIRST_POOLS.html +1 -1
- package/docs/variables/AUTOBALANCE_SUI_SECOND_POOLS.html +1 -1
- package/docs/variables/AUTOBALANCE_TYPE_1_POOLS.html +1 -1
- package/docs/variables/alphalendMarketIdMap.html +1 -1
- package/docs/variables/bluefinPoolMap.html +1 -1
- package/docs/variables/cetusPoolMap.html +1 -1
- package/docs/variables/coinsList.html +1 -1
- package/docs/variables/defunctPoolsSet.html +1 -1
- package/docs/variables/doubleAssetPoolCoinMap.html +1 -1
- package/docs/variables/eventCategories.html +1 -1
- package/docs/variables/ignoredWalletsForDailyRevenue.html +1 -1
- package/docs/variables/loopingAccountAddresses.html +1 -1
- package/docs/variables/loopingPoolCoinMap.html +1 -1
- package/docs/variables/naviAssetMap.html +1 -1
- package/docs/variables/poolIdPoolNameMap.html +1 -1
- package/docs/variables/poolInfo.html +1 -1
- package/docs/variables/singleAssetPoolCoinMap.html +1 -1
- package/docs/variables/stableCoins.html +1 -1
- package/package.json +1 -1
- package/scripts/testRun.ts +1 -4
- package/#package.json# +0 -98
- package/FETCH_OVERRIDE_FIX.md +0 -222
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.depositBluefinFungibleTxb = void 0;
|
|
3
4
|
exports.zapDepositTxb = zapDepositTxb;
|
|
4
5
|
exports.zapDepositQuoteTxb = zapDepositQuoteTxb;
|
|
5
6
|
const transactions_1 = require("@mysten/sui/transactions");
|
|
@@ -11,6 +12,9 @@ const decimal_js_1 = require("decimal.js");
|
|
|
11
12
|
const client_js_1 = require("../sui-sdk/client.js");
|
|
12
13
|
const constants_js_1 = require("../common/constants.js");
|
|
13
14
|
const getReceipts_js_1 = require("../sui-sdk/functions/getReceipts.js");
|
|
15
|
+
const blueRewards_js_1 = require("./blueRewards.js");
|
|
16
|
+
const alphalend_js_1 = require("./alphalend.js");
|
|
17
|
+
const index_js_1 = require("../index.js");
|
|
14
18
|
async function zapDepositTxb(inputCoinAmount, isInputA, poolName, slippage, // 1% --> 0.01
|
|
15
19
|
address) {
|
|
16
20
|
const tx = new transactions_1.Transaction();
|
|
@@ -18,8 +22,8 @@ address) {
|
|
|
18
22
|
const swapGateway = new _7k_js_1.SevenKGateway();
|
|
19
23
|
const [coinTypeA, coinTypeB] = maps_js_1.poolInfo[poolName].assetTypes;
|
|
20
24
|
const coinObject = await getCoinObject(isInputA ? coinTypeA : coinTypeB, tx, suiClient, address);
|
|
21
|
-
const investor = (await (0, getReceipts_js_1.getInvestor)(poolName,
|
|
22
|
-
const parentPool = await (0, getReceipts_js_1.getParentPool)(poolName,
|
|
25
|
+
const investor = (await (0, getReceipts_js_1.getInvestor)(poolName, true));
|
|
26
|
+
const parentPool = await (0, getReceipts_js_1.getParentPool)(poolName, true);
|
|
23
27
|
// get lower_tick, upper_tick, current_tick_index without 2's complement
|
|
24
28
|
const upper_bound = 443636;
|
|
25
29
|
let lower_tick = Number(investor.content.fields.lower_tick);
|
|
@@ -159,8 +163,8 @@ address) {
|
|
|
159
163
|
async function zapDepositQuoteTxb(inputCoinAmount, isInputA, poolName, slippage) {
|
|
160
164
|
const swapGateway = new _7k_js_1.SevenKGateway();
|
|
161
165
|
const [coinTypeA, coinTypeB] = maps_js_1.poolInfo[poolName].assetTypes;
|
|
162
|
-
const investor = (await (0, getReceipts_js_1.getInvestor)(poolName,
|
|
163
|
-
const parentPool = await (0, getReceipts_js_1.getParentPool)(poolName,
|
|
166
|
+
const investor = (await (0, getReceipts_js_1.getInvestor)(poolName, true));
|
|
167
|
+
const parentPool = await (0, getReceipts_js_1.getParentPool)(poolName, true);
|
|
164
168
|
// get lower_tick, upper_tick, current_tick_index without 2's complement
|
|
165
169
|
const upper_bound = 443636;
|
|
166
170
|
let lower_tick = Number(investor.content.fields.lower_tick);
|
|
@@ -419,7 +423,7 @@ async function deposit(params) {
|
|
|
419
423
|
}
|
|
420
424
|
const pool1 = maps_js_1.doubleAssetPoolCoinMap[params.poolName].coin1;
|
|
421
425
|
const pool2 = maps_js_1.doubleAssetPoolCoinMap[params.poolName].coin2;
|
|
422
|
-
const receipt = await (0, getReceipts_js_1.getReceipts)(params.poolName, params.address,
|
|
426
|
+
const receipt = await (0, getReceipts_js_1.getReceipts)(params.poolName, params.address, true);
|
|
423
427
|
let depositCoinA;
|
|
424
428
|
let depositCoinB;
|
|
425
429
|
if (!params.amountA.eq(0) && !params.amountB.eq(0)) {
|
|
@@ -463,7 +467,10 @@ async function deposit(params) {
|
|
|
463
467
|
}
|
|
464
468
|
}
|
|
465
469
|
else if (maps_js_1.poolInfo[params.poolName].parentProtocolName === "BLUEFIN") {
|
|
466
|
-
if (params.poolName === "BLUEFIN-
|
|
470
|
+
if (params.poolName === "BLUEFIN-FUNGIBLE-STSUI-SUI") {
|
|
471
|
+
params.tx = await (0, exports.depositBluefinFungibleTxb)(params.tx, params.poolName, depositCoinA, depositCoinB);
|
|
472
|
+
}
|
|
473
|
+
else if (params.poolName === "BLUEFIN-NAVX-VSUI" ||
|
|
467
474
|
params.poolName === "BLUEFIN-ALPHA-USDC" ||
|
|
468
475
|
params.poolName === "BLUEFIN-BLUE-USDC") {
|
|
469
476
|
params.tx = await depositBluefinType2Txb(params.tx, someReceipt, params.poolName, depositCoinA, depositCoinB);
|
|
@@ -585,6 +592,9 @@ const depositBluefinSuiFirstTxb = async (txb, someReceipt, poolName, depositCoin
|
|
|
585
592
|
const poolinfo = maps_js_1.poolInfo[poolName];
|
|
586
593
|
const pool1 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
|
|
587
594
|
const pool2 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
|
|
595
|
+
if (poolinfo.strategyType === "AUTOBALANCE-LIQUIDITY-POOL") {
|
|
596
|
+
await (0, blueRewards_js_1.collectRewardTxb)(poolName, true, txb);
|
|
597
|
+
}
|
|
588
598
|
if (poolName === "BLUEFIN-SUI-USDC") {
|
|
589
599
|
txb.moveCall({
|
|
590
600
|
target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::user_deposit_v2`,
|
|
@@ -672,41 +682,7 @@ const depositBluefinSuiFirstTxb = async (txb, someReceipt, poolName, depositCoin
|
|
|
672
682
|
],
|
|
673
683
|
});
|
|
674
684
|
}
|
|
675
|
-
else if (poolName
|
|
676
|
-
txb.moveCall({
|
|
677
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::collect_reward`,
|
|
678
|
-
typeArguments: [
|
|
679
|
-
coins_js_1.coinsList[pool1].type,
|
|
680
|
-
coins_js_1.coinsList[pool2].type,
|
|
681
|
-
coins_js_1.coinsList["BLUE"].type,
|
|
682
|
-
],
|
|
683
|
-
arguments: [
|
|
684
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
685
|
-
txb.object(poolinfo.poolId),
|
|
686
|
-
txb.object(poolinfo.investorId),
|
|
687
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
688
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
689
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
690
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
691
|
-
],
|
|
692
|
-
});
|
|
693
|
-
txb.moveCall({
|
|
694
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::collect_reward`,
|
|
695
|
-
typeArguments: [
|
|
696
|
-
coins_js_1.coinsList[pool1].type,
|
|
697
|
-
coins_js_1.coinsList[pool2].type,
|
|
698
|
-
coins_js_1.coinsList["STSUI"].type,
|
|
699
|
-
],
|
|
700
|
-
arguments: [
|
|
701
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
702
|
-
txb.object(poolinfo.poolId),
|
|
703
|
-
txb.object(poolinfo.investorId),
|
|
704
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
705
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
706
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
707
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
708
|
-
],
|
|
709
|
-
});
|
|
685
|
+
else if (maps_js_1.AUTOBALANCE_SUI_FIRST_POOLS.includes(poolName)) {
|
|
710
686
|
txb.moveCall({
|
|
711
687
|
target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::user_deposit_v4`,
|
|
712
688
|
typeArguments: [coins_js_1.coinsList[pool1].type, coins_js_1.coinsList[pool2].type],
|
|
@@ -719,59 +695,7 @@ const depositBluefinSuiFirstTxb = async (txb, someReceipt, poolName, depositCoin
|
|
|
719
695
|
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
720
696
|
txb.object(poolinfo.investorId),
|
|
721
697
|
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
722
|
-
txb.object(
|
|
723
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
724
|
-
],
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
else if (poolName === "BLUEFIN-AUTOBALANCE-SUI-LBTC") {
|
|
728
|
-
txb.moveCall({
|
|
729
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::collect_reward`,
|
|
730
|
-
typeArguments: [
|
|
731
|
-
coins_js_1.coinsList[pool1].type,
|
|
732
|
-
coins_js_1.coinsList[pool2].type,
|
|
733
|
-
coins_js_1.coinsList["BLUE"].type,
|
|
734
|
-
],
|
|
735
|
-
arguments: [
|
|
736
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
737
|
-
txb.object(poolinfo.poolId),
|
|
738
|
-
txb.object(poolinfo.investorId),
|
|
739
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
740
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
741
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
742
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
743
|
-
],
|
|
744
|
-
});
|
|
745
|
-
txb.moveCall({
|
|
746
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::collect_reward`,
|
|
747
|
-
typeArguments: [
|
|
748
|
-
coins_js_1.coinsList[pool1].type,
|
|
749
|
-
coins_js_1.coinsList[pool2].type,
|
|
750
|
-
coins_js_1.coinsList["STSUI"].type,
|
|
751
|
-
],
|
|
752
|
-
arguments: [
|
|
753
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
754
|
-
txb.object(poolinfo.poolId),
|
|
755
|
-
txb.object(poolinfo.investorId),
|
|
756
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
757
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
758
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
759
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
760
|
-
],
|
|
761
|
-
});
|
|
762
|
-
txb.moveCall({
|
|
763
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::user_deposit_v4`,
|
|
764
|
-
typeArguments: [coins_js_1.coinsList[pool1].type, coins_js_1.coinsList[pool2].type],
|
|
765
|
-
arguments: [
|
|
766
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
767
|
-
someReceipt,
|
|
768
|
-
txb.object(poolinfo.poolId),
|
|
769
|
-
depositCoinA,
|
|
770
|
-
depositCoinB,
|
|
771
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
772
|
-
txb.object(poolinfo.investorId),
|
|
773
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
774
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_LBTC_POOL),
|
|
698
|
+
txb.object(poolinfo.parentPoolId),
|
|
775
699
|
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
776
700
|
],
|
|
777
701
|
});
|
|
@@ -782,6 +706,9 @@ const depositBluefinType1Txb = async (txb, someReceipt, poolName, depositCoinA,
|
|
|
782
706
|
const poolinfo = maps_js_1.poolInfo[poolName];
|
|
783
707
|
const pool1 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
|
|
784
708
|
const pool2 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
|
|
709
|
+
if (poolinfo.strategyType === "AUTOBALANCE-LIQUIDITY-POOL") {
|
|
710
|
+
await (0, blueRewards_js_1.collectRewardTxb)(poolName, true, txb);
|
|
711
|
+
}
|
|
785
712
|
if (poolName === "BLUEFIN-USDT-USDC") {
|
|
786
713
|
txb.moveCall({
|
|
787
714
|
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_investor::collect_and_swap_rewards_to_token_b_bluefin`,
|
|
@@ -1010,31 +937,10 @@ const depositBluefinType1Txb = async (txb, someReceipt, poolName, depositCoinA,
|
|
|
1010
937
|
],
|
|
1011
938
|
});
|
|
1012
939
|
}
|
|
1013
|
-
else if (poolName
|
|
1014
|
-
txb.moveCall({
|
|
1015
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::collect_and_swap_trade_fee`,
|
|
1016
|
-
typeArguments: [
|
|
1017
|
-
coins_js_1.coinsList[pool1].type,
|
|
1018
|
-
coins_js_1.coinsList[pool2].type,
|
|
1019
|
-
coins_js_1.coinsList["SUI"].type,
|
|
1020
|
-
],
|
|
1021
|
-
arguments: [
|
|
1022
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
1023
|
-
txb.object(poolinfo.investorId),
|
|
1024
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1025
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_USDT_USDC_POOL),
|
|
1026
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
1027
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1028
|
-
],
|
|
1029
|
-
});
|
|
940
|
+
else if (index_js_1.AUTOBALANCE_TYPE_1_POOLS.includes(poolName)) {
|
|
1030
941
|
txb.moveCall({
|
|
1031
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::
|
|
1032
|
-
typeArguments: [
|
|
1033
|
-
coins_js_1.coinsList["USDT"].type,
|
|
1034
|
-
coins_js_1.coinsList["USDC"].type,
|
|
1035
|
-
coins_js_1.coinsList["BLUE"].type,
|
|
1036
|
-
coins_js_1.coinsList["SUI"].type,
|
|
1037
|
-
],
|
|
942
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::user_deposit_v3`,
|
|
943
|
+
typeArguments: [coins_js_1.coinsList[pool1].type, coins_js_1.coinsList[pool2].type],
|
|
1038
944
|
arguments: [
|
|
1039
945
|
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
1040
946
|
someReceipt,
|
|
@@ -1044,13 +950,7 @@ const depositBluefinType1Txb = async (txb, someReceipt, poolName, depositCoinA,
|
|
|
1044
950
|
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
1045
951
|
txb.object(poolinfo.investorId),
|
|
1046
952
|
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1047
|
-
txb.object(
|
|
1048
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_USDT_USDC_POOL),
|
|
1049
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
|
|
1050
|
-
txb.object(maps_js_1.cetusPoolMap["USDC-USDT"]),
|
|
1051
|
-
txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
|
|
1052
|
-
txb.object((0, constants_js_1.getConf)().LST_INFO),
|
|
1053
|
-
txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
|
|
953
|
+
txb.object(poolinfo.parentPoolId),
|
|
1054
954
|
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1055
955
|
],
|
|
1056
956
|
});
|
|
@@ -1105,125 +1005,6 @@ const depositBluefinType1Txb = async (txb, someReceipt, poolName, depositCoinA,
|
|
|
1105
1005
|
],
|
|
1106
1006
|
});
|
|
1107
1007
|
}
|
|
1108
|
-
else if (poolName === "BLUEFIN-AUTOBALANCE-SUIUSDT-USDC") {
|
|
1109
|
-
txb.moveCall({
|
|
1110
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::collect_and_swap_trade_fee`,
|
|
1111
|
-
typeArguments: [
|
|
1112
|
-
coins_js_1.coinsList[pool1].type,
|
|
1113
|
-
coins_js_1.coinsList[pool2].type,
|
|
1114
|
-
coins_js_1.coinsList["SUI"].type,
|
|
1115
|
-
],
|
|
1116
|
-
arguments: [
|
|
1117
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
1118
|
-
txb.object(poolinfo.investorId),
|
|
1119
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1120
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUIUSDT_USDC_POOL),
|
|
1121
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
1122
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1123
|
-
],
|
|
1124
|
-
});
|
|
1125
|
-
txb.moveCall({
|
|
1126
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::user_deposit_v2`,
|
|
1127
|
-
typeArguments: [
|
|
1128
|
-
coins_js_1.coinsList["SUIUSDT"].type,
|
|
1129
|
-
coins_js_1.coinsList["USDC"].type,
|
|
1130
|
-
coins_js_1.coinsList["BLUE"].type,
|
|
1131
|
-
coins_js_1.coinsList["SUI"].type,
|
|
1132
|
-
],
|
|
1133
|
-
arguments: [
|
|
1134
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
1135
|
-
someReceipt,
|
|
1136
|
-
txb.object(poolinfo.poolId),
|
|
1137
|
-
depositCoinA,
|
|
1138
|
-
depositCoinB,
|
|
1139
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
1140
|
-
txb.object(poolinfo.investorId),
|
|
1141
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1142
|
-
txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
|
|
1143
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUIUSDT_USDC_POOL),
|
|
1144
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
|
|
1145
|
-
txb.object(maps_js_1.cetusPoolMap["USDC-SUIUSDT"]),
|
|
1146
|
-
txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
|
|
1147
|
-
txb.object((0, constants_js_1.getConf)().LST_INFO),
|
|
1148
|
-
txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
|
|
1149
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1150
|
-
],
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
1153
|
-
else if (poolName === "BLUEFIN-AUTOBALANCE-DEEP-BLUE") {
|
|
1154
|
-
txb.moveCall({
|
|
1155
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::user_deposit_v2`,
|
|
1156
|
-
typeArguments: [
|
|
1157
|
-
coins_js_1.coinsList["DEEP"].type,
|
|
1158
|
-
coins_js_1.coinsList["BLUE"].type,
|
|
1159
|
-
coins_js_1.coinsList["BLUE"].type,
|
|
1160
|
-
coins_js_1.coinsList["SUI"].type,
|
|
1161
|
-
],
|
|
1162
|
-
arguments: [
|
|
1163
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
1164
|
-
someReceipt,
|
|
1165
|
-
txb.object(poolinfo.poolId),
|
|
1166
|
-
depositCoinA,
|
|
1167
|
-
depositCoinB,
|
|
1168
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
1169
|
-
txb.object(poolinfo.investorId),
|
|
1170
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1171
|
-
txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
|
|
1172
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_BLUE_POOL),
|
|
1173
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
|
|
1174
|
-
txb.object(maps_js_1.cetusPoolMap["BLUE-DEEP"]),
|
|
1175
|
-
txb.object(maps_js_1.cetusPoolMap["BLUE-SUI"]),
|
|
1176
|
-
txb.object((0, constants_js_1.getConf)().LST_INFO),
|
|
1177
|
-
txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
|
|
1178
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1179
|
-
],
|
|
1180
|
-
});
|
|
1181
|
-
}
|
|
1182
|
-
else if (poolName === "BLUEFIN-AUTOBALANCE-WAL-USDC") {
|
|
1183
|
-
txb.moveCall({
|
|
1184
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::collect_and_swap_trade_fee`,
|
|
1185
|
-
typeArguments: [
|
|
1186
|
-
coins_js_1.coinsList[pool1].type,
|
|
1187
|
-
coins_js_1.coinsList[pool2].type,
|
|
1188
|
-
coins_js_1.coinsList["SUI"].type,
|
|
1189
|
-
],
|
|
1190
|
-
arguments: [
|
|
1191
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
1192
|
-
txb.object(poolinfo.investorId),
|
|
1193
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1194
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_WAL_USDC_POOL),
|
|
1195
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
1196
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1197
|
-
],
|
|
1198
|
-
});
|
|
1199
|
-
txb.moveCall({
|
|
1200
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::user_deposit_v2`,
|
|
1201
|
-
typeArguments: [
|
|
1202
|
-
coins_js_1.coinsList["WAL"].type,
|
|
1203
|
-
coins_js_1.coinsList["USDC"].type,
|
|
1204
|
-
coins_js_1.coinsList["BLUE"].type,
|
|
1205
|
-
coins_js_1.coinsList["SUI"].type,
|
|
1206
|
-
],
|
|
1207
|
-
arguments: [
|
|
1208
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
1209
|
-
someReceipt,
|
|
1210
|
-
txb.object(poolinfo.poolId),
|
|
1211
|
-
depositCoinA,
|
|
1212
|
-
depositCoinB,
|
|
1213
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
1214
|
-
txb.object(poolinfo.investorId),
|
|
1215
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1216
|
-
txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
|
|
1217
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_WAL_USDC_POOL),
|
|
1218
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
|
|
1219
|
-
txb.object(maps_js_1.cetusPoolMap["USDC-WAL"]),
|
|
1220
|
-
txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
|
|
1221
|
-
txb.object((0, constants_js_1.getConf)().LST_INFO),
|
|
1222
|
-
txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
|
|
1223
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1224
|
-
],
|
|
1225
|
-
});
|
|
1226
|
-
}
|
|
1227
1008
|
else if (poolName === "BLUEFIN-SUIBTC-USDC") {
|
|
1228
1009
|
txb.moveCall({
|
|
1229
1010
|
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_investor::collect_and_swap_rewards_to_token_b_bluefin`,
|
|
@@ -1382,51 +1163,6 @@ const depositBluefinType1Txb = async (txb, someReceipt, poolName, depositCoinA,
|
|
|
1382
1163
|
],
|
|
1383
1164
|
});
|
|
1384
1165
|
}
|
|
1385
|
-
else if (poolName === "BLUEFIN-AUTOBALANCE-SUIUSDT-USDC-ZERO-ZERO") {
|
|
1386
|
-
txb.moveCall({
|
|
1387
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::collect_and_swap_trade_fee`,
|
|
1388
|
-
typeArguments: [
|
|
1389
|
-
coins_js_1.coinsList[pool1].type,
|
|
1390
|
-
coins_js_1.coinsList[pool2].type,
|
|
1391
|
-
coins_js_1.coinsList["SUI"].type,
|
|
1392
|
-
],
|
|
1393
|
-
arguments: [
|
|
1394
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
1395
|
-
txb.object(poolinfo.investorId),
|
|
1396
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1397
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUIUSDT_USDC_ZERO_ZERO_POOL),
|
|
1398
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
1399
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1400
|
-
],
|
|
1401
|
-
});
|
|
1402
|
-
txb.moveCall({
|
|
1403
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::user_deposit_v2`,
|
|
1404
|
-
typeArguments: [
|
|
1405
|
-
coins_js_1.coinsList["SUIUSDT"].type,
|
|
1406
|
-
coins_js_1.coinsList["USDC"].type,
|
|
1407
|
-
coins_js_1.coinsList["BLUE"].type,
|
|
1408
|
-
coins_js_1.coinsList["SUI"].type,
|
|
1409
|
-
],
|
|
1410
|
-
arguments: [
|
|
1411
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
1412
|
-
someReceipt,
|
|
1413
|
-
txb.object(poolinfo.poolId),
|
|
1414
|
-
depositCoinA,
|
|
1415
|
-
depositCoinB,
|
|
1416
|
-
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
1417
|
-
txb.object(poolinfo.investorId),
|
|
1418
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1419
|
-
txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
|
|
1420
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_SUIUSDT_USDC_ZERO_ZERO_POOL),
|
|
1421
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
1422
|
-
txb.object(maps_js_1.cetusPoolMap["USDC-SUIUSDT"]),
|
|
1423
|
-
txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
|
|
1424
|
-
txb.object((0, constants_js_1.getConf)().LST_INFO),
|
|
1425
|
-
txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
|
|
1426
|
-
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1427
|
-
],
|
|
1428
|
-
});
|
|
1429
|
-
}
|
|
1430
1166
|
return txb;
|
|
1431
1167
|
};
|
|
1432
1168
|
const depositBluefinType2Txb = async (txb, someReceipt, poolName, depositCoinA, depositCoinB) => {
|
|
@@ -1585,6 +1321,9 @@ const depositBluefinSuiSecondTxb = async (txb, someReceipt, poolName, depositCoi
|
|
|
1585
1321
|
const poolinfo = maps_js_1.poolInfo[poolName];
|
|
1586
1322
|
const pool1 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
|
|
1587
1323
|
const pool2 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
|
|
1324
|
+
if (poolinfo.strategyType === "AUTOBALANCE-LIQUIDITY-POOL") {
|
|
1325
|
+
await (0, blueRewards_js_1.collectRewardTxb)(poolName, true, txb);
|
|
1326
|
+
}
|
|
1588
1327
|
if (poolName === "BLUEFIN-BLUE-SUI") {
|
|
1589
1328
|
txb.moveCall({
|
|
1590
1329
|
target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit_v2`,
|
|
@@ -1698,14 +1437,10 @@ const depositBluefinSuiSecondTxb = async (txb, someReceipt, poolName, depositCoi
|
|
|
1698
1437
|
],
|
|
1699
1438
|
});
|
|
1700
1439
|
}
|
|
1701
|
-
else if (poolName
|
|
1440
|
+
else if (maps_js_1.AUTOBALANCE_SUI_SECOND_POOLS.includes(poolName)) {
|
|
1702
1441
|
txb.moveCall({
|
|
1703
|
-
target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::
|
|
1704
|
-
typeArguments: [
|
|
1705
|
-
coins_js_1.coinsList[pool1].type,
|
|
1706
|
-
coins_js_1.coinsList[pool2].type,
|
|
1707
|
-
coins_js_1.coinsList["BLUE"].type,
|
|
1708
|
-
],
|
|
1442
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit_v3`,
|
|
1443
|
+
typeArguments: [coins_js_1.coinsList[pool1].type, coins_js_1.coinsList[pool2].type],
|
|
1709
1444
|
arguments: [
|
|
1710
1445
|
txb.object((0, constants_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
1711
1446
|
someReceipt,
|
|
@@ -1715,38 +1450,30 @@ const depositBluefinSuiSecondTxb = async (txb, someReceipt, poolName, depositCoi
|
|
|
1715
1450
|
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
1716
1451
|
txb.object(poolinfo.investorId),
|
|
1717
1452
|
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1718
|
-
txb.object(
|
|
1719
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
|
|
1720
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
|
|
1721
|
-
txb.object(maps_js_1.cetusPoolMap["DEEP-SUI"]),
|
|
1722
|
-
txb.object((0, constants_js_1.getConf)().LST_INFO),
|
|
1723
|
-
txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
|
|
1453
|
+
txb.object(poolinfo.parentPoolId),
|
|
1724
1454
|
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1725
1455
|
],
|
|
1726
1456
|
});
|
|
1727
1457
|
}
|
|
1728
|
-
else if (
|
|
1458
|
+
else if (poolinfo.strategyType === "LEVERAGE-YIELD-FARMING") {
|
|
1459
|
+
const coinAType = pool1 === "SUI" ? "0x2::sui::SUI" : coins_js_1.coinsList[pool1].type;
|
|
1460
|
+
const coinBType = pool2 === "SUI" ? "0x2::sui::SUI" : coins_js_1.coinsList[pool2].type;
|
|
1461
|
+
await alphalend_js_1.alphalendClient.updatePrices(txb, [coinAType, coinBType]);
|
|
1462
|
+
await (0, index_js_1.collectAndSwapRewardsLyf)(poolName, txb);
|
|
1729
1463
|
txb.moveCall({
|
|
1730
|
-
target: `${poolinfo.packageId}::
|
|
1731
|
-
typeArguments: [
|
|
1732
|
-
coins_js_1.coinsList[pool1].type,
|
|
1733
|
-
coins_js_1.coinsList[pool2].type,
|
|
1734
|
-
coins_js_1.coinsList["DEEP"].type,
|
|
1735
|
-
],
|
|
1464
|
+
target: `${poolinfo.packageId}::alphafi_lyf_pool::user_deposit`,
|
|
1465
|
+
typeArguments: [coins_js_1.coinsList[pool1].type, coins_js_1.coinsList[pool2].type],
|
|
1736
1466
|
arguments: [
|
|
1737
|
-
txb.object((0, constants_js_1.getConf)().
|
|
1467
|
+
txb.object((0, constants_js_1.getConf)().ALPHA_LYF_VERSION),
|
|
1468
|
+
txb.object((0, constants_js_1.getConf)().VERSION),
|
|
1738
1469
|
someReceipt,
|
|
1739
1470
|
txb.object(poolinfo.poolId),
|
|
1740
1471
|
depositCoinA,
|
|
1741
1472
|
depositCoinB,
|
|
1742
1473
|
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
1743
|
-
txb.object(
|
|
1474
|
+
txb.object((0, constants_js_1.getConf)().LENDING_PROTOCOL_ID),
|
|
1744
1475
|
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1745
|
-
txb.object(
|
|
1746
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
|
|
1747
|
-
txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
|
|
1748
|
-
txb.object(maps_js_1.cetusPoolMap["BLUE-SUI"]),
|
|
1749
|
-
txb.object((0, constants_js_1.getConf)().LST_INFO),
|
|
1476
|
+
txb.object(poolinfo.parentPoolId),
|
|
1750
1477
|
txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
|
|
1751
1478
|
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1752
1479
|
],
|
|
@@ -1970,4 +1697,36 @@ const depositBluefinStsuiTxb = async (txb, someReceipt, poolName, depositCoinA,
|
|
|
1970
1697
|
}
|
|
1971
1698
|
return txb;
|
|
1972
1699
|
};
|
|
1700
|
+
const depositBluefinFungibleTxb = async (txb, poolName, depositCoinA, depositCoinB) => {
|
|
1701
|
+
const poolinfo = maps_js_1.poolInfo[poolName];
|
|
1702
|
+
const pool1 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
|
|
1703
|
+
const pool2 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
|
|
1704
|
+
if (poolName === "BLUEFIN-FUNGIBLE-STSUI-SUI") {
|
|
1705
|
+
txb.moveCall({
|
|
1706
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_stsui_sui_ft_pool::user_deposit`,
|
|
1707
|
+
typeArguments: [
|
|
1708
|
+
coins_js_1.coinsList[pool1].type,
|
|
1709
|
+
coins_js_1.coinsList[pool2].type,
|
|
1710
|
+
poolinfo.receiptType,
|
|
1711
|
+
coins_js_1.coinsList["BLUE"].type,
|
|
1712
|
+
],
|
|
1713
|
+
arguments: [
|
|
1714
|
+
txb.object((0, constants_js_1.getConf)().ALPHA_FUNGIBLE_VERSION),
|
|
1715
|
+
txb.object(poolinfo.poolId),
|
|
1716
|
+
depositCoinA,
|
|
1717
|
+
depositCoinB,
|
|
1718
|
+
txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
1719
|
+
txb.object(poolinfo.investorId),
|
|
1720
|
+
txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
1721
|
+
txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_SUI_POOL),
|
|
1722
|
+
txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
|
|
1723
|
+
txb.object((0, constants_js_1.getConf)().LST_INFO),
|
|
1724
|
+
txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
|
|
1725
|
+
txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
1726
|
+
],
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
return txb;
|
|
1730
|
+
};
|
|
1731
|
+
exports.depositBluefinFungibleTxb = depositBluefinFungibleTxb;
|
|
1973
1732
|
//# sourceMappingURL=zapDeposit.js.map
|