@typus/typus-sdk 1.6.12 → 1.6.14

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.
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTokenRegistry = getTokenRegistry;
3
4
  exports.getTokenRaiseFundTx = getTokenRaiseFundTx;
4
5
  exports.getTokenReduceFundTx = getTokenReduceFundTx;
5
6
  exports.getTokenNewBidTx = getTokenNewBidTx;
@@ -7,22 +8,26 @@ exports.getTokenExerciseTx = getTokenExerciseTx;
7
8
  exports.getTokenRebateTx = getTokenRebateTx;
8
9
  exports.getTokenCompoundWithRedeemTx = getTokenCompoundWithRedeemTx;
9
10
  var constants_1 = require("../../src/constants");
10
- function getTokenRaiseFundTx(config, tx, input) {
11
+ function getTokenRegistry(config, typusTokenType) {
11
12
  var typusTokenRegistry = "";
12
- switch (input.typusTokenType.split("::")[1]) {
13
+ switch (typusTokenType.split("::")[1]) {
13
14
  case "mfud":
14
- typusTokenRegistry = config.registry.token.mfud;
15
+ typusTokenRegistry = constants_1.tokenRegistry[config.network].MFUD;
15
16
  break;
16
17
  case "mblub":
17
- typusTokenRegistry = config.registry.token.mblub;
18
+ typusTokenRegistry = constants_1.tokenRegistry[config.network].MBLUB;
18
19
  break;
19
20
  case "mliq":
20
- typusTokenRegistry = config.registry.token.mliq;
21
+ typusTokenRegistry = constants_1.tokenRegistry[config.network].MLIQ;
21
22
  break;
22
23
  default:
23
24
  console.log("No such token exists!");
24
25
  break;
25
26
  }
27
+ return typusTokenRegistry;
28
+ }
29
+ function getTokenRaiseFundTx(config, tx, input) {
30
+ var typusTokenRegistry = getTokenRegistry(config, input.typusTokenType);
26
31
  var typusTokenBalance = input.raiseCoins.length > 0
27
32
  ? tx.moveCall({
28
33
  target: "0x2::coin::into_balance",
@@ -66,21 +71,7 @@ function getTokenRaiseFundTx(config, tx, input) {
66
71
  return tx;
67
72
  }
68
73
  function getTokenReduceFundTx(config, tx, input) {
69
- var typusTokenRegistry = "";
70
- switch (input.typusTokenType.split("::")[1]) {
71
- case "mfud":
72
- typusTokenRegistry = config.registry.token.mfud;
73
- break;
74
- case "mblub":
75
- typusTokenRegistry = config.registry.token.mblub;
76
- break;
77
- case "mliq":
78
- typusTokenRegistry = config.registry.token.mliq;
79
- break;
80
- default:
81
- console.log("No such token exists!");
82
- break;
83
- }
74
+ var typusTokenRegistry = getTokenRegistry(config, input.typusTokenType);
84
75
  var result = tx.moveCall({
85
76
  target: "".concat(config.package.dovSingle, "::tds_user_entry::public_reduce_fund"),
86
77
  typeArguments: input.typeArguments,
@@ -166,21 +157,7 @@ function getTokenReduceFundTx(config, tx, input) {
166
157
  return tx;
167
158
  }
168
159
  function getTokenNewBidTx(config, tx, input) {
169
- var typusTokenRegistry = "";
170
- switch (input.typusTokenType.split("::")[1]) {
171
- case "mfud":
172
- typusTokenRegistry = config.registry.token.mfud;
173
- break;
174
- case "mblub":
175
- typusTokenRegistry = config.registry.token.mblub;
176
- break;
177
- case "mliq":
178
- typusTokenRegistry = config.registry.token.mliq;
179
- break;
180
- default:
181
- console.log("No such token exists!");
182
- break;
183
- }
160
+ var typusTokenRegistry = getTokenRegistry(config, input.typusTokenType);
184
161
  var mToken = tx.moveCall({
185
162
  target: "".concat(input.typusTokenType.split("::")[0], "::").concat(input.typusTokenType.split("::")[1], "::mint"),
186
163
  arguments: [
@@ -213,21 +190,7 @@ function getTokenNewBidTx(config, tx, input) {
213
190
  return tx;
214
191
  }
215
192
  function getTokenExerciseTx(config, tx, input) {
216
- var typusTokenRegistry = "";
217
- switch (input.typusTokenType.split("::")[1]) {
218
- case "mfud":
219
- typusTokenRegistry = config.registry.token.mfud;
220
- break;
221
- case "mblub":
222
- typusTokenRegistry = config.registry.token.mblub;
223
- break;
224
- case "mliq":
225
- typusTokenRegistry = config.registry.token.mliq;
226
- break;
227
- default:
228
- console.log("No such token exists!");
229
- break;
230
- }
193
+ var typusTokenRegistry = getTokenRegistry(config, input.typusTokenType);
231
194
  var result = tx.moveCall({
232
195
  target: "".concat(config.package.dovSingle, "::tds_user_entry::exercise"),
233
196
  typeArguments: input.typeArguments,
@@ -253,21 +216,7 @@ function getTokenExerciseTx(config, tx, input) {
253
216
  return tx;
254
217
  }
255
218
  function getTokenRebateTx(config, tx, input) {
256
- var typusTokenRegistry = "";
257
- switch (input.typusTokenType.split("::")[1]) {
258
- case "mfud":
259
- typusTokenRegistry = config.registry.token.mfud;
260
- break;
261
- case "mblub":
262
- typusTokenRegistry = config.registry.token.mblub;
263
- break;
264
- case "mliq":
265
- typusTokenRegistry = config.registry.token.mliq;
266
- break;
267
- default:
268
- console.log("No such token exists!");
269
- break;
270
- }
219
+ var typusTokenRegistry = getTokenRegistry(config, input.typusTokenType);
271
220
  var result = tx.moveCall({
272
221
  target: "".concat(config.package.dovSingle, "::tds_user_entry::rebate"),
273
222
  typeArguments: [input.typeArgument],
@@ -124,7 +124,7 @@ export declare function getTransferBidReceiptTx(config: TypusConfig, tx: Transac
124
124
  export declare function getSplitBidReceiptTx(config: TypusConfig, tx: Transaction, input: {
125
125
  index: string;
126
126
  receipts: string[];
127
- share: string;
127
+ share?: string;
128
128
  recipient: string;
129
129
  }): import("@mysten/sui/transactions").TransactionResult;
130
130
  export declare function getMultiTransferBidReceiptTx(config: TypusConfig, input: {
@@ -26,7 +26,6 @@ exports.getSplitBidReceiptTx = getSplitBidReceiptTx;
26
26
  exports.getMultiTransferBidReceiptTx = getMultiTransferBidReceiptTx;
27
27
  exports.getRebateTx = getRebateTx;
28
28
  exports.getCompoundWithRedeemTx = getCompoundWithRedeemTx;
29
- var bcs_1 = require("@mysten/sui/bcs");
30
29
  var transactions_1 = require("@mysten/sui/transactions");
31
30
  var constants_1 = require("../../src/constants");
32
31
  var utils_1 = require("../../src/utils");
@@ -295,8 +294,7 @@ function getSplitBidReceiptTx(config, tx, input) {
295
294
  type: "".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt"),
296
295
  elements: input.receipts.map(function (receipt) { return tx.object(receipt); }),
297
296
  }),
298
- // tx.pure([input.share]),
299
- tx.pure(bcs_1.bcs.vector(bcs_1.bcs.U64).serialize([input.share])),
297
+ tx.pure.option("u64", input.share),
300
298
  ],
301
299
  });
302
300
  var unwrap0 = tx.moveCall({
@@ -304,12 +302,11 @@ function getSplitBidReceiptTx(config, tx, input) {
304
302
  typeArguments: ["".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt")],
305
303
  arguments: [tx.object(result[0])],
306
304
  });
307
- var unwrap1 = tx.moveCall({
308
- target: "0x1::option::destroy_some",
309
- typeArguments: ["".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt")],
310
- arguments: [tx.object(result[1])],
305
+ tx.moveCall({
306
+ target: "".concat(config.package.framework, "::vault::transfer_bid_receipt"),
307
+ typeArguments: [],
308
+ arguments: [tx.object(result[1]), tx.pure.address(input.recipient)],
311
309
  });
312
- tx.transferObjects([unwrap1], input.recipient);
313
310
  return unwrap0;
314
311
  }
315
312
  function getMultiTransferBidReceiptTx(config, input) {
@@ -79,7 +79,7 @@ function getReduceFundTx(config, tx, input) {
79
79
  tx.pure.u64(input.reduceFromWarmup),
80
80
  tx.pure.u64(input.reduceFromActive),
81
81
  tx.pure.u64(input.reduceFromInactive),
82
- tx.object((0, utils_1.splitCoins)(tx, constants_1.tokenType.SUI, [], input.feeAmount)),
82
+ tx.object((0, utils_1.splitCoins)(tx, constants_1.tokenType.MAINNET.SUI, [], input.feeAmount)),
83
83
  tx.object(constants_1.CLOCK),
84
84
  ],
85
85
  });
@@ -58,7 +58,7 @@ function getVaultHistorySummary(startTimestamp) {
58
58
  }
59
59
  requestData = {
60
60
  sqlQuery: {
61
- sql: "\n WITH hourly_price_table AS (\n SELECT\n symbol,\n toStartOfHour(time) AS hour,\n argMax(price, time) AS hourly_price\n FROM\n token.prices\n GROUP BY\n symbol, hour\n ),\n safu_otc_aggregated AS (\n SELECT\n index,\n round,\n AVG(delivery_price) AS delivery_price,\n SUM(delivery_size) AS delivery_size,\n SUM(bidder_bid_value) AS bidder_bid_value\n FROM SafuOtc\n GROUP BY index, round\n ),\n vault_history AS (\n SELECT\n Settle.timestamp as timestamp,\n Settle.index as Index,\n Settle.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n COALESCE(NULLIF(UpdateStrike.strikes, ''), NewAuction.strikes) AS Strikes, -- \u5982\u679C UpdateStrike.strikes \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5C31\u4F7F\u7528 NewAuction.strikes\n Settle.oracle_price as SettlePrice,\n -- Settle.share_price as share_price,\n -- Settle.settle_balance as SettleBalance,\n CAST(Activate.deposit_balance as Float64) as DepositAmount,\n DepositAmount * Settle.price_d_token as DepositAmountUSD,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled,\n Delivery.delivery_size as DeliverySize,\n Delivery.delivery_price as DeliveryPrice,\n safu_otc_aggregated.delivery_size as OtcSize,\n safu_otc_aggregated.delivery_price as OtcPrice,\n Delivery.bidder_bid_value as BidderPremium,\n BidderPremium * Delivery.price_b_token as BidderPremiumUSD,\n Delivery.incentive_bid_value as IncentivePremium,\n safu_otc_aggregated.bidder_bid_value as OtcPremium,\n (Delivery.bidder_bid_value + Delivery.incentive_bid_value + safu_otc_aggregated.bidder_bid_value) AS Premium, -- Total Premium b_token\n Premium * Delivery.price_b_token AS PremiumUSD,\n Delivery.depositor_incentive_value as BpIncentive, -- SUI or SCA based on o_token\n BpIncentive * Delivery.price_o_token as BpIncentiveUSD,\n Delivery.fixed_incentive_amount as FixedIncentive, -- SUI\n FixedIncentive * hourly_price_table.hourly_price as FixedIncentiveUSD,\n (1 - Settle.share_price) as LossPecentage,\n CAST((Settle.settle_balance - Settle.settled_balance) AS Float64) as OptionProfit, -- d_token\n OptionProfit * Settle.price_d_token as OptionProfitUSD,\n PremiumUSD + BpIncentiveUSD + FixedIncentiveUSD - OptionProfitUSD as DepositorPNL,\n -- CASE WHEN DepositAmountUSD != 0 THEN DepositorPNL / DepositAmountUSD ELSE 0 END AS DepositorROI,\n OptionProfitUSD - BidderPremiumUSD as BidderPNL,\n CASE WHEN BidderPremiumUSD != 0 THEN BidderPNL / BidderPremiumUSD ELSE 0 END AS BidderROI,\n Settle.d_token as d_token,\n Delivery.b_token as b_token,\n Delivery.o_token as o_token\n FROM Settle\n JOIN Activate ON Settle.index = Activate.index AND Settle.round = Activate.round\n JOIN NewAuction ON Settle.index = NewAuction.index AND Settle.round = NewAuction.round\n LEFT JOIN UpdateStrike ON Settle.index = UpdateStrike.index AND Settle.round = UpdateStrike.round\n JOIN Delivery ON Settle.index = Delivery.index AND Settle.round = Delivery.round\n LEFT JOIN safu_otc_aggregated ON Settle.index = safu_otc_aggregated.index AND Settle.round = safu_otc_aggregated.round\n LEFT JOIN hourly_price_table ON 'sui' = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n ".concat(timeFilter, "\n ORDER BY ActivationDate DESC\n )\n\n SELECT\n vault_history.Index AS Index,\n SUM(vault_history.TotalSell) AS TotalSell, -- Total Sell Size\n AVG(vault_history.Filled) AS AverageFilled, -- Average Filled Rate\n AVG(vault_history.OptionProfit) AS AverageLoss, -- Average Option Profit\n SUM(vault_history.OptionProfit) AS TotalOptionProfit, -- Total Option Profit\n AVG(CASE -- Calculating Average Drawdown, ignoring DepositAmount == 0\n WHEN vault_history.DepositAmount > 0 THEN vault_history.OptionProfit / vault_history.DepositAmount ELSE NULL\n END) AS AverageDrawdown, -- Average Drawdown (based on Option Profit and TVL)\n SUM(CASE WHEN vault_history.BidderPNL > 0 THEN 1 ELSE 0 END) / COUNT(*) AS BidderWinRate, -- Calculating Bidder Win Rate (probability BidderPNL > 0)\n SUM(CASE WHEN vault_history.DepositorPNL > 0 THEN 1 ELSE 0 END) / COUNT(*) AS DepositorWinRate -- Calculating Depositor Win Rate (probability DepositorPNL > 0)\n FROM vault_history\n GROUP BY vault_history.Index\n ORDER BY Index ASC\n "),
61
+ sql: "\n WITH hourly_price_table AS (\n SELECT\n symbol,\n toStartOfHour(time) AS hour,\n argMax(price, time) AS hourly_price\n FROM\n token.prices\n GROUP BY\n symbol, hour\n ),\n safu_otc_aggregated AS (\n SELECT\n index,\n round,\n AVG(delivery_price) AS delivery_price,\n SUM(delivery_size) AS delivery_size,\n SUM(bidder_bid_value) AS bidder_bid_value,\n SUM(bidder_fee) AS bidder_fee\n FROM SafuOtc\n GROUP BY index, round\n ),\n vault_history AS (\n SELECT\n Settle.timestamp as timestamp,\n Settle.index as Index,\n Settle.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n COALESCE(NULLIF(UpdateStrike.strikes, ''), NewAuction.strikes) AS Strikes, -- \u5982\u679C UpdateStrike.strikes \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5C31\u4F7F\u7528 NewAuction.strikes\n Settle.oracle_price as SettlePrice,\n -- Settle.share_price as share_price,\n -- Settle.settle_balance as SettleBalance,\n CAST(Activate.deposit_balance as Float64) as DepositAmount,\n DepositAmount * Settle.price_d_token as DepositAmountUSD,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled,\n Delivery.delivery_size as DeliverySize,\n Delivery.delivery_price as DeliveryPrice,\n safu_otc_aggregated.delivery_size as OtcSize,\n safu_otc_aggregated.delivery_price as OtcPrice,\n (Delivery.bidder_bid_value + Delivery.bidder_fee) as BidderPremium,\n (Delivery.incentive_bid_value + Delivery.incentive_fee) as IncentivePremium,\n (safu_otc_aggregated.bidder_bid_value + safu_otc_aggregated.bidder_fee) as OtcPremium,\n (BidderPremium + IncentivePremium + OtcPremium) AS Premium, -- Total Premium b_token\n Premium * Delivery.price_b_token AS PremiumUSD,\n (Delivery.bidder_fee + Delivery.incentive_fee + safu_otc_aggregated.bidder_fee) * Delivery.price_b_token AS PremiumFeeUSD,\n Delivery.depositor_incentive_value as BpIncentive, -- SUI or SCA based on o_token\n BpIncentive * Delivery.price_o_token as BpIncentiveUSD,\n Delivery.fixed_incentive_amount as FixedIncentive, -- SUI\n FixedIncentive * hourly_price_table.hourly_price as FixedIncentiveUSD,\n (1 - Settle.share_price) as LossPecentage,\n CAST((Settle.settle_balance - Settle.settled_balance) AS Float64) as OptionProfit, -- d_token\n OptionProfit * Settle.price_d_token as OptionProfitUSD,\n PremiumUSD - PremiumFeeUSD + BpIncentiveUSD + FixedIncentiveUSD - OptionProfitUSD as DepositorPNL,\n -- CASE WHEN DepositAmountUSD != 0 THEN DepositorPNL / DepositAmountUSD ELSE 0 END AS DepositorROI,\n OptionProfitUSD - PremiumUSD as BidderPNL,\n CASE WHEN PremiumUSD != 0 THEN BidderPNL / PremiumUSD ELSE 0 END AS BidderROI,\n Settle.d_token as d_token,\n Delivery.b_token as b_token,\n Delivery.o_token as o_token\n FROM Settle\n JOIN Activate ON Settle.index = Activate.index AND Settle.round = Activate.round\n JOIN NewAuction ON Settle.index = NewAuction.index AND Settle.round = NewAuction.round\n LEFT JOIN UpdateStrike ON Settle.index = UpdateStrike.index AND Settle.round = UpdateStrike.round\n JOIN Delivery ON Settle.index = Delivery.index AND Settle.round = Delivery.round\n LEFT JOIN safu_otc_aggregated ON Settle.index = safu_otc_aggregated.index AND Settle.round = safu_otc_aggregated.round\n LEFT JOIN hourly_price_table ON 'sui' = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n ".concat(timeFilter, "\n ORDER BY ActivationDate DESC\n )\n\n SELECT\n vault_history.Index AS Index,\n SUM(vault_history.TotalSell) AS TotalSell, -- Total Sell Size\n AVG(vault_history.Filled) AS AverageFilled, -- Average Filled Rate\n AVG(vault_history.OptionProfit) AS AverageLoss, -- Average Option Profit\n SUM(vault_history.OptionProfit) AS TotalOptionProfit, -- Total Option Profit\n AVG(CASE -- Calculating Average Drawdown, ignoring DepositAmount == 0\n WHEN vault_history.DepositAmount > 0 THEN vault_history.OptionProfit / vault_history.DepositAmount ELSE NULL\n END) AS AverageDrawdown, -- Average Drawdown (based on Option Profit and TVL)\n SUM(CASE WHEN vault_history.BidderPNL > 0 THEN 1 ELSE 0 END) / COUNT(*) AS BidderWinRate, -- Calculating Bidder Win Rate (probability BidderPNL > 0)\n SUM(CASE WHEN vault_history.DepositorPNL > 0 THEN 1 ELSE 0 END) / COUNT(*) AS DepositorWinRate -- Calculating Depositor Win Rate (probability DepositorPNL > 0)\n FROM vault_history\n GROUP BY vault_history.Index\n ORDER BY Index ASC\n "),
62
62
  size: 1000,
63
63
  },
64
64
  };
@@ -95,7 +95,7 @@ function getFilledSummary(startTimestamp) {
95
95
  }
96
96
  requestData = {
97
97
  sqlQuery: {
98
- sql: "\n WITH hourly_price_table AS (\n SELECT\n symbol,\n toStartOfHour(time) AS hour,\n argMax(price, time) AS hourly_price -- Get the most recent price before or at the hour\n FROM\n sui.coin_prices\n GROUP BY\n symbol, hour\n ),\n safu_otc_aggregated AS (\n SELECT\n index,\n round,\n AVG(delivery_price) AS delivery_price,\n SUM(delivery_size) AS delivery_size,\n SUM(bidder_bid_value) AS bidder_bid_value\n FROM SafuOtc\n GROUP BY index, round\n ),\n vault_history AS (\n SELECT\n Delivery.timestamp as timestamp,\n Delivery.index as Index,\n Delivery.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n COALESCE(NULLIF(UpdateStrike.strikes, ''), NewAuction.strikes) AS Strikes, -- \u5982\u679C UpdateStrike.strikes \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5C31\u4F7F\u7528 NewAuction.strikes\n Activate.deposit_balance as DepositAmount,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled,\n Delivery.delivery_size as DeliverySize,\n Delivery.delivery_price as DeliveryPrice,\n safu_otc_aggregated.delivery_size as OtcSize,\n safu_otc_aggregated.delivery_price as OtcPrice,\n Delivery.bidder_bid_value as BidderPremium,\n BidderPremium * Delivery.price_b_token as BidderPremiumUSD,\n Delivery.incentive_bid_value as IncentivePremium,\n safu_otc_aggregated.bidder_bid_value as OtcPremium,\n (Delivery.bidder_bid_value + Delivery.incentive_bid_value + safu_otc_aggregated.bidder_bid_value) AS Premium, -- Total Premium b_token\n Premium * Delivery.price_b_token AS PremiumUSD,\n Delivery.depositor_incentive_value as BpIncentive, -- SUI or SCA based on o_token\n BpIncentive * Delivery.price_o_token as BpIncentiveUSD,\n Delivery.fixed_incentive_amount as FixedIncentive, -- SUI\n FixedIncentive * hourly_price_table.hourly_price as FixedIncentiveUSD,\n VaultInfo.d_token as d_token,\n Delivery.b_token as b_token,\n Delivery.o_token as o_token\n FROM Delivery\n JOIN Activate ON Delivery.index = Activate.index AND Delivery.round = Activate.round\n JOIN NewAuction ON Delivery.index = NewAuction.index AND Delivery.round = NewAuction.round\n JOIN VaultInfo ON Delivery.index = CAST(VaultInfo.id AS Decimal(76, 12))\n LEFT JOIN UpdateStrike ON Delivery.index = UpdateStrike.index AND Delivery.round = UpdateStrike.round\n LEFT JOIN safu_otc_aggregated ON Delivery.index = safu_otc_aggregated.index AND Delivery.round = safu_otc_aggregated.round\n LEFT JOIN hourly_price_table ON 'sui' = hourly_price_table.symbol AND toStartOfHour(Delivery.timestamp) = hourly_price_table.hour\n ".concat(timeFilter, "\n ORDER BY ActivationDate DESC\n )\n\n SELECT\n vault_history.Index AS Index,\n SUM(vault_history.BidderPremiumUSD) * 0.2 AS FeeUSD,\n SUM(vault_history.TotalSell) AS TotalSell, -- Total Sell Size\n AVG(vault_history.Filled) AS AverageFilled -- Average Filled Rate\n FROM vault_history\n GROUP BY vault_history.Index\n ORDER BY FeeUSD DESC\n "),
98
+ sql: "\n WITH safu_otc_aggregated AS (\n SELECT\n index,\n round,\n SUM(delivery_size) AS delivery_size\n FROM SafuOtc\n GROUP BY index, round\n ),\n vault_history AS (\n SELECT\n Delivery.timestamp as timestamp,\n Delivery.index as Index,\n Delivery.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled\n FROM Delivery\n JOIN Activate ON Delivery.index = Activate.index AND Delivery.round = Activate.round\n JOIN NewAuction ON Delivery.index = NewAuction.index AND Delivery.round = NewAuction.round\n LEFT JOIN safu_otc_aggregated ON Delivery.index = safu_otc_aggregated.index AND Delivery.round = safu_otc_aggregated.round\n ".concat(timeFilter, "\n ORDER BY ActivationDate DESC\n )\n SELECT\n vault_history.Index AS Index,\n AVG(vault_history.Filled) AS AverageFilled -- Average Filled Rate\n FROM vault_history\n GROUP BY Index\n ORDER BY Index DESC\n "),
99
99
  size: 1000,
100
100
  },
101
101
  };
@@ -127,7 +127,7 @@ function getVaultHistory(indices_1) {
127
127
  apiUrl = "https://app.sentio.xyz/api/v1/analytics/typus/typus_v2/sql/execute";
128
128
  requestData = {
129
129
  sqlQuery: {
130
- sql: "\n WITH hourly_price_table AS (\n SELECT\n symbol,\n toStartOfHour(time) AS hour,\n argMax(price, time) AS hourly_price -- Get the most recent price before or at the hour\n FROM\n token.prices\n GROUP BY\n symbol, hour\n ),\n safu_otc_aggregated AS (\n SELECT\n index,\n round,\n AVG(delivery_price) AS delivery_price,\n SUM(delivery_size) AS delivery_size,\n SUM(bidder_bid_value) AS bidder_bid_value\n FROM SafuOtc\n GROUP BY index, round\n )\n SELECT\n Settle.timestamp as timestamp,\n Settle.index as Index,\n Settle.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n COALESCE(NULLIF(UpdateStrike.strikes, ''), NewAuction.strikes) AS Strikes, -- \u5982\u679C UpdateStrike.strikes \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5C31\u4F7F\u7528 NewAuction.strikes\n Settle.oracle_price as SettlePrice,\n -- Settle.share_price as share_price,\n -- Settle.settle_balance as SettleBalance,\n Activate.deposit_balance as DepositAmount,\n DepositAmount * Settle.price_d_token as DepositAmountUSD,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled,\n Delivery.delivery_size as DeliverySize,\n Delivery.delivery_price as DeliveryPrice,\n safu_otc_aggregated.delivery_size as OtcSize,\n safu_otc_aggregated.delivery_price as OtcPrice,\n Delivery.bidder_bid_value as BidderPremium,\n BidderPremium * Delivery.price_b_token as BidderPremiumUSD,\n Delivery.incentive_bid_value as IncentivePremium,\n safu_otc_aggregated.bidder_bid_value as OtcPremium,\n (Delivery.bidder_bid_value + Delivery.incentive_bid_value + safu_otc_aggregated.bidder_bid_value) AS Premium, -- Total Premium b_token\n Premium * Delivery.price_b_token AS PremiumUSD,\n Delivery.depositor_incentive_value as BpIncentive, -- SUI or SCA based on o_token\n BpIncentive * Delivery.price_o_token as BpIncentiveUSD,\n Delivery.fixed_incentive_amount as FixedIncentive, -- SUI\n FixedIncentive * hourly_price_table.hourly_price as FixedIncentiveUSD,\n (1 - Settle.share_price) as LossPecentage,\n (Settle.settle_balance - Settle.settled_balance) as OptionProfit, -- d_token\n OptionProfit * Settle.price_d_token as OptionProfitUSD,\n PremiumUSD + BpIncentiveUSD + FixedIncentiveUSD - OptionProfitUSD as DepositorPNL,\n -- CASE WHEN DepositAmountUSD != 0 THEN DepositorPNL / DepositAmountUSD ELSE 0 END AS DepositorROI,\n OptionProfitUSD - BidderPremiumUSD as BidderPNL,\n CASE WHEN BidderPremiumUSD != 0 THEN BidderPNL / BidderPremiumUSD ELSE 0 END AS BidderROI,\n Settle.d_token as d_token,\n Delivery.b_token as b_token,\n Delivery.o_token as o_token\n FROM Settle\n JOIN Activate ON Settle.index = Activate.index AND Settle.round = Activate.round\n JOIN NewAuction ON Settle.index = NewAuction.index AND Settle.round = NewAuction.round\n LEFT JOIN UpdateStrike ON Settle.index = UpdateStrike.index AND Settle.round = UpdateStrike.round\n JOIN Delivery ON Settle.index = Delivery.index AND Settle.round = Delivery.round\n LEFT JOIN safu_otc_aggregated ON Settle.index = safu_otc_aggregated.index AND Settle.round = safu_otc_aggregated.round\n -- LEFT JOIN hourly_price_table ON LOWER(Settle.d_token) = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n LEFT JOIN hourly_price_table ON 'sui' = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n WHERE Settle.index IN (".concat(indices.join(","), ")\n ORDER BY ActivationDate DESC;\n "),
130
+ sql: "\n WITH hourly_price_table AS (\n SELECT\n symbol,\n toStartOfHour(time) AS hour,\n argMax(price, time) AS hourly_price\n FROM\n token.prices\n GROUP BY\n symbol, hour\n ),\n safu_otc_aggregated AS (\n SELECT\n index,\n round,\n AVG(delivery_price) AS delivery_price,\n SUM(delivery_size) AS delivery_size,\n SUM(bidder_bid_value) AS bidder_bid_value,\n SUM(bidder_fee) AS bidder_fee\n FROM SafuOtc\n GROUP BY index, round\n )\n SELECT\n Settle.timestamp as timestamp,\n Settle.index as Index,\n Settle.round as Round,\n NewAuction.start_ts_ms as ActivationDate,\n COALESCE(NULLIF(UpdateStrike.strikes, ''), NewAuction.strikes) AS Strikes, -- \u5982\u679C UpdateStrike.strikes \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5C31\u4F7F\u7528 NewAuction.strikes\n Settle.oracle_price as SettlePrice,\n -- Settle.share_price as share_price,\n -- Settle.settle_balance as SettleBalance,\n CAST(Activate.deposit_balance as Float64) as DepositAmount,\n DepositAmount * Settle.price_d_token as DepositAmountUSD,\n Delivery.max_size as MaxSize,\n (safu_otc_aggregated.delivery_size + Delivery.delivery_size) as TotalSell,\n CASE WHEN MaxSize != 0 THEN TotalSell / MaxSize ELSE 0 END AS Filled,\n Delivery.delivery_size as DeliverySize,\n Delivery.delivery_price as DeliveryPrice,\n safu_otc_aggregated.delivery_size as OtcSize,\n safu_otc_aggregated.delivery_price as OtcPrice,\n (Delivery.bidder_bid_value + Delivery.bidder_fee) as BidderPremium,\n (Delivery.incentive_bid_value + Delivery.incentive_fee) as IncentivePremium,\n (safu_otc_aggregated.bidder_bid_value + safu_otc_aggregated.bidder_fee) as OtcPremium,\n (BidderPremium + IncentivePremium + OtcPremium) AS Premium, -- Total Premium b_token\n Premium * Delivery.price_b_token AS PremiumUSD,\n IncentivePremium * Delivery.price_b_token AS IncentivePremiumUSD,\n (Delivery.bidder_fee + Delivery.incentive_fee + safu_otc_aggregated.bidder_fee) * Delivery.price_b_token AS PremiumFeeUSD,\n Delivery.depositor_incentive_value as BpIncentive, -- SUI or SCA based on o_token\n BpIncentive * Delivery.price_o_token as BpIncentiveUSD,\n Delivery.fixed_incentive_amount as FixedIncentive, -- SUI\n FixedIncentive * hourly_price_table.hourly_price as FixedIncentiveUSD,\n (1 - Settle.share_price) as LossPecentage,\n CAST((Settle.settle_balance - Settle.settled_balance) AS Float64) as OptionProfit, -- d_token\n OptionProfit * Settle.price_d_token as OptionProfitUSD,\n PremiumUSD - PremiumFeeUSD + BpIncentiveUSD + FixedIncentiveUSD - OptionProfitUSD as DepositorPNL,\n -- CASE WHEN DepositAmountUSD != 0 THEN DepositorPNL / DepositAmountUSD ELSE 0 END AS DepositorROI,\n OptionProfitUSD - (PremiumUSD - IncentivePremiumUSD) as BidderPNL,\n CASE WHEN (PremiumUSD - IncentivePremiumUSD) != 0 THEN BidderPNL / (PremiumUSD - IncentivePremiumUSD) ELSE 0 END AS BidderROI,\n Settle.d_token as d_token,\n Delivery.b_token as b_token,\n Delivery.o_token as o_token\n FROM Settle\n JOIN Activate ON Settle.index = Activate.index AND Settle.round = Activate.round\n JOIN NewAuction ON Settle.index = NewAuction.index AND Settle.round = NewAuction.round\n LEFT JOIN UpdateStrike ON Settle.index = UpdateStrike.index AND Settle.round = UpdateStrike.round\n JOIN Delivery ON Settle.index = Delivery.index AND Settle.round = Delivery.round\n LEFT JOIN safu_otc_aggregated ON Settle.index = safu_otc_aggregated.index AND Settle.round = safu_otc_aggregated.round\n -- LEFT JOIN hourly_price_table ON LOWER(Settle.d_token) = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n LEFT JOIN hourly_price_table ON 'sui' = hourly_price_table.symbol AND toStartOfHour(Settle.timestamp) = hourly_price_table.hour\n WHERE Settle.index IN (".concat(indices.join(","), ")\n ORDER BY ActivationDate DESC;\n "),
131
131
  size: limit,
132
132
  },
133
133
  };
@@ -1,61 +1,18 @@
1
+ import { TOKEN } from "../../../src/constants";
1
2
  export declare const priceIDs: {
2
3
  MAINNET: {
3
- SUI: string;
4
- CETUS: string;
5
- USDC: string;
6
- wBTC: string;
7
- wETH: string;
8
- wSOL: string;
9
- TURBOS: string;
10
- wAPT: string;
11
- wUSDT: string;
12
- INJ: string;
13
- SEI: string;
14
- JUP: string;
15
- SCA: string;
16
- AFSUI: string;
17
- NAVX: string;
18
- USDY: string;
19
- BUCK: string;
20
- VSUI: string;
21
- HASUI: string;
22
- AUSD: string;
23
- FUD: string;
24
- DEEP: string;
25
- BLUE: string;
26
- BLUB: string;
27
- HIPPO: string;
28
- STSUI: string;
29
- NS: string;
30
- WAL: string;
4
+ [key in TOKEN]?: string;
31
5
  };
32
6
  TESTNET: {
33
- SUI: string;
34
- USDC: string;
35
- wUSDC: string;
36
- USDT: string;
37
- BTC: string;
38
- ETH: string;
39
- SOL: string;
40
- CETUS: string;
41
- NAVX: string;
42
- SCA: string;
43
- TURBOS: string;
7
+ [key in TOKEN]?: string;
44
8
  };
45
9
  };
46
10
  export declare const priceInfoObjectIds: {
11
+ MAINNET: {
12
+ [key in TOKEN]?: string;
13
+ };
47
14
  TESTNET: {
48
- SUI: string;
49
- USDC: string;
50
- wUSDC: string;
51
- USDT: string;
52
- BTC: string;
53
- ETH: string;
54
- SOL: string;
55
- CETUS: string;
56
- NAVX: string;
57
- SCA: string;
58
- TURBOS: string;
15
+ [key in TOKEN]?: string;
59
16
  };
60
17
  };
61
18
  export declare const wormholeStateId: {
@@ -34,47 +34,87 @@ exports.priceIDs = {
34
34
  STSUI: "0x0449948a9a210481464ea7030734fa79f59b751c2f411cfb1ba56b5f69e4a62a",
35
35
  NS: "0xbb5ff26e47a3a6cc7ec2fce1db996c2a145300edc5acaabe43bf9ff7c5dd5d32",
36
36
  WAL: "0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341",
37
+ LBTC: "0x8f257aab6e7698bb92b15511915e593d6f8eae914452f781874754b03d0c612b",
37
38
  },
38
39
  TESTNET: {
39
40
  // Pyth EVM Beta
40
- SUI: "0x50c67b3fd225db8912a424dd4baed60ffdde625ed2feaaf283724f9608fea266", // SUI/USD price ID
41
- USDC: "0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722", // USDC/USD price ID
42
- wUSDC: "0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722", // USDC/USD price ID
43
- USDT: "0x1fc18861232290221461220bd4e2acd1dcdfbc89c84092c93c18bdc7756c1588", // USDT/USD price ID
44
- BTC: "0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b", // BTC/USD price ID
45
- ETH: "0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6", // ETH/USD price ID
46
- SOL: "0xfe650f0367d4a7ef9815a593ea15d36593f0643aaaf0149bb04be67ab851decd", // SOL/USD price ID
47
- CETUS: "0xcb324dafd531712dd31c39969ae0246ee4c6ae167257bcf8ac27e28ca35e6a0c", // CETUS/USD price ID
48
- NAVX: "0x946292ad3f481f36f5e558726cf4974e2a7a34598bf15d2abe3619e7b6a8db91", // NAVX/USD price ID
49
- SCA: "0xeacabc6304d11fc10a757f63286ef44415d8e91b7a1a525ae94a7ec9398b73f3", // SCA/USD price ID
50
- TURBOS: "0x3f545e3f4ec9fd8eb3b9d9d6071a1da361f6729fa1b93d1d1baca3379551d99e", // TURBOS/USD price ID
41
+ SUI: "0x50c67b3fd225db8912a424dd4baed60ffdde625ed2feaaf283724f9608fea266",
42
+ CETUS: "0xcb324dafd531712dd31c39969ae0246ee4c6ae167257bcf8ac27e28ca35e6a0c",
43
+ USDC: "0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722",
44
+ wBTC: "0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b",
45
+ wETH: "0xca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6",
46
+ wSOL: "0xfe650f0367d4a7ef9815a593ea15d36593f0643aaaf0149bb04be67ab851decd",
47
+ TURBOS: "0x3f545e3f4ec9fd8eb3b9d9d6071a1da361f6729fa1b93d1d1baca3379551d99e",
48
+ wAPT: "0x44a93dddd8effa54ea51076c4e851b6cbbfd938e82eb90197de38fe8876bb66e",
49
+ wUSDT: "0x1fc18861232290221461220bd4e2acd1dcdfbc89c84092c93c18bdc7756c1588",
50
+ // DOGE: "0x31775e1d6897129e8a84eeba975778fb50015b88039e9bc140bbd839694ac0ae",
51
+ INJ: "0x2d9315a88f3019f8efa88dfe9c0f0843712da0bac814461e27733f6b83eb51b3",
52
+ SEI: "0x95f1aef92c74670d40f1f37ee6fb158ffd6a0f8913b07b9e61087f9b7273b11c",
53
+ JUP: "0xe92860f24d56f9ba9894658202633062744556e98fb3e924b4a2694d82f05737",
54
+ SCA: "0xeacabc6304d11fc10a757f63286ef44415d8e91b7a1a525ae94a7ec9398b73f3",
55
+ AFSUI: "0xd213e2929116af56c3ce71a1acee874f1dd03f42567b552085fa9d8ce8ce7134",
56
+ NAVX: "0x946292ad3f481f36f5e558726cf4974e2a7a34598bf15d2abe3619e7b6a8db91",
57
+ USDY: "0xc222a1d2b89218c034b515e738b19ee268c105d8ede44d95b279f1c8bfbb68af",
58
+ BUCK: "0xed0899e3a021f1e59031ad365bb3014d78f9ba5556e263692d3508b9272daabf",
59
+ VSUI: "0xabb2661c87ecac9f93eade3dd089dbb6e9eb4083eba3b35371ee6f8fa1133752",
60
+ HASUI: "0xb675212df51f05b159e31e3047895778df9df1c870587102a06fc96100853361",
61
+ AUSD: "0xf1882d28af56a63960f0c313e6c76eab8f802f15e801ebfca223412b55375fe3",
62
+ FUD: "0x15f63843dcccf30510f48ff6e363f9ead3b0b05d7f7dde6e3890a7e9e4d83e4a",
63
+ DEEP: "0xe18bf5fa857d5ca8af1f6a458b26e853ecdc78fc2f3dc17f4821374ad94d8327",
64
+ BLUE: "0x64559fcff99ed360543d7f4778f4712d2dc5c303ec1ac98f084c88c647ff7689",
65
+ BLUB: "0xc171055a63e9b4c09e29cc018129379e0a8581512f6726f5bfe5429985773312",
66
+ HIPPO: "0x082736b80698caf1379f0ad10a637668ccd531a96133d1f5053df97bffd2933b",
67
+ STSUI: "0xda703fbee4d7ee09aba630ef809efd79d162202bdf976ae8258875207ebd5557",
68
+ NS: "0x65aca56071505735c09091deb8733fdeba265bd9723dd4fb326b5ffd6843b3a3",
69
+ WAL: "0xa6ba0195b5364be116059e401fb71484ed3400d4d9bfbdf46bd11eab4f9b7cea",
70
+ LBTC: "0x29448db25efe8c72afe3a3c0c0631337408bd3cbc5f09d3dab0754460a965dae",
51
71
  },
52
72
  };
53
73
  exports.priceInfoObjectIds = {
54
- // MAINNET: {
55
- // // Pyth EVM Stable
56
- // SUI: "0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744", // SUI/USD price ID
57
- // USDC: "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a", // USDC/USD price ID
58
- // USDT: "0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b", // USDT/USD price ID
59
- // BTC: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", // BTC/USD price ID
60
- // ETH: "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", // ETH/USD price ID
61
- // SOL: "0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d", // SOL/USD price ID
62
- // CETUS: "0xe5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef", // CETUS/USD price ID
63
- // NAVX: "0x88250f854c019ef4f88a5c073d52a18bb1c6ac437033f5932cd017d24917ab46", // NAVX/USD price ID
64
- // SCA: "0x7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc", // SCA/USD price ID
65
- // },
74
+ MAINNET: {
75
+ SUI: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37",
76
+ USDC: "0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab",
77
+ wUSDT: "0x985e3db9f93f76ee8bace7c3dd5cc676a096accd5d9e09e9ae0fb6e492b14572",
78
+ wBTC: "0x9a62b4863bdeaabdc9500fce769cf7e72d5585eeb28a6d26e4cafadc13f76ab2",
79
+ wETH: "0x9193fd47f9a0ab99b6e365a464c8a9ae30e6150fc37ed2a89c1586631f6fc4ab",
80
+ wSOL: "0x9d0d275efbd37d8a8855f6f2c761fa5983293dd8ce202ee5196626de8fcd4469",
81
+ CETUS: "0x24c0247fb22457a719efac7f670cdc79be321b521460bd6bd2ccfa9f80713b14",
82
+ TURBOS: "0x442e52f04392b0dcb48c6aaf7940568acd510281021be9f9b3a449c559c79613",
83
+ SCA: "0xf6de1d3279a269a597d813cbaca59aa906543ab9a8c64e84a4722f1a20863985",
84
+ SEI: "0xde2dd2684b3ff808cebdfb23afbf8b6ac3822832029dae744f81d9eb44b5c9b8",
85
+ INJ: "0x353a36a5b3d6809b4cc349dca627e2775e1d19b6b9c86f0eabe138fd3d772023",
86
+ AFSUI: "0xd779885c5246357e24cbde7348f2d81f756d9650975c02d81346b15d8b557ebf",
87
+ NAVX: "0x5b117a6a2de70796bffe36495bad576b788a34c33ca0648bd57852ead3f41e32",
88
+ HASUI: "0x4c1d831576b60fec657e0c310943eff8c1f28197c552e57d1fefdc55edddb263",
89
+ VSUI: "0xf3bc79117acc3636d57778d9d0f83a871df1b7a53eb61fe893ff108d9664ec8b",
90
+ DEEP: "0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed",
91
+ BLUE: "0x5515a34fc610bba6b601575ed1d2535b2f9df1f339fd0d435fef487c1ee3df9c",
92
+ NS: "0xc6352e1ea55d7b5acc3ed690cc3cdf8007978071d7bfd6a189445018cfb366e0",
93
+ JUP: "0xb804ada6f77feb30a73fbed7fc53dc66ff25133dee0815109d4267e43b2e6bdd",
94
+ WAL: "'0xeb7e669f74d976c0b99b6ef9801e3a77716a95f1a15754e0f1399ce3fb60973d'",
95
+ LBTC: "0xeba15840ddf425dacb5ff0990334fc03d034487f4ad416280859b96bf2af89f8",
96
+ },
66
97
  TESTNET: {
67
98
  SUI: "0x1ebb295c789cc42b3b2a1606482cd1c7124076a0f5676718501fda8c7fd075a0",
99
+ CETUS: "0xb0ba78106259b7ceefd288edc5f65b65f8b7bca0816e61dae5136616aac7d3da",
68
100
  USDC: "0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81",
69
101
  wUSDC: "0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81",
70
- USDT: "0x956fdcbf83a26c962319f7742f5728a0a7ce59c7f0cbe13c112b259e7ee953cd",
71
- BTC: "0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba",
72
- ETH: "0x4fde30cb8a5dc3cfee1c1c358fc66dc308408827efb217247c7ba54d76ccbee9",
73
- SOL: "0x33fbce1cad5ca155f2f5051430b23a694bc6e5de6df43e0f8aefe29f4a84336d",
74
- CETUS: "0xb0ba78106259b7ceefd288edc5f65b65f8b7bca0816e61dae5136616aac7d3da",
75
- NAVX: "0x94905bdcaa656b0908aa8a3a42cf72b0e8e2e849f7d0a7e0e39bb9e1dc3c9cf6",
76
- SCA: "0xf96e3c4b7d74efbde9df5b669188421196e6164adf6fbaaa92903c42569807c8",
102
+ wBTC: "0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba",
103
+ wETH: "0x4fde30cb8a5dc3cfee1c1c358fc66dc308408827efb217247c7ba54d76ccbee9",
104
+ wSOL: "0x33fbce1cad5ca155f2f5051430b23a694bc6e5de6df43e0f8aefe29f4a84336d",
77
105
  TURBOS: "0xfe38289883c3afed692e5856f4896b3e094d4793e2ccf0a2715b890a718fa5c0",
106
+ wAPT: "0x9eeb8cb349d8e89fa9e6c94a97d6d30096f5b3c16bd50d9de96608f67a278c18",
107
+ wUSDT: "0x956fdcbf83a26c962319f7742f5728a0a7ce59c7f0cbe13c112b259e7ee953cd",
108
+ // DOGE: "0x17b358d730663caa888c8b621b9994a60af422cd83f32237c6b2a8b3230d71b9",
109
+ INJ: "0x459e2e0dd757715449fc1d36925f384446bf192c9f86a4ca02d587c82de51802",
110
+ SEI: "0xb3e7f40e8268fb2539a03b29c1b38366e061c3c8222f7ad4c8db998eb0a02f8d",
111
+ JUP: "0x23817c9edbbfbdef6add3800cd52751eff5bb0f7abd32e54a8f2225d6a6523d3",
112
+ SCA: "0xf96e3c4b7d74efbde9df5b669188421196e6164adf6fbaaa92903c42569807c8",
113
+ AFSUI: "0x6785a8c69da40c9435d41a2585cf92643d2ed2c5cd12938ecff28eaf54efadcd",
114
+ NAVX: "0x94905bdcaa656b0908aa8a3a42cf72b0e8e2e849f7d0a7e0e39bb9e1dc3c9cf6",
115
+ USDY: "0x1fec4ed70f870911948d93eb2abe6fa4a3a4b1e4633cf36c7e91adfb4af1733f",
116
+ BLUE: "0xcc9016bcfaf1839f1dd63b0929a0d62dfb93e84442fd5b4598552605e365b3ec",
117
+ BLUB: "0xdcd4cc5f06fac1ca72e8551ab1a2e847298afa6f19e370ad9891199a59d2c22e",
78
118
  },
79
119
  };
80
120
  // Get the state IDs of the Pyth and Wormhole contracts from
@@ -9,4 +9,4 @@ export declare class PythClient {
9
9
  }
10
10
  export declare function createPythClient(provider: any, network: "MAINNET" | "TESTNET"): PythClient;
11
11
  export declare function updatePyth(pythClient: PythClient, tx: Transaction, tokens: string[]): Promise<ObjectId[]>;
12
- export declare function updateOracleWithPyth(pythClient: PythClient, tx: Transaction, oraclePackage: string, typusOracle: string, baseToken: TOKEN, quoteToken: TOKEN): void;
12
+ export declare function updateOracleWithPythUsd(pythClient: PythClient, tx: Transaction, oraclePackage: string, baseToken: TOKEN): void;
@@ -38,9 +38,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.createPythClient = createPythClient;
40
40
  exports.updatePyth = updatePyth;
41
- exports.updateOracleWithPyth = updateOracleWithPyth;
41
+ exports.updateOracleWithPythUsd = updateOracleWithPythUsd;
42
42
  var pyth_sui_js_1 = require("@pythnetwork/pyth-sui-js");
43
43
  var constant_1 = require("./constant");
44
+ var constants_1 = require("../../../src/constants");
44
45
  function createPythClient(provider, network) {
45
46
  var client = new pyth_sui_js_1.SuiPythClient(provider, constant_1.pythStateId[network], constant_1.wormholeStateId[network]);
46
47
  var connection = network == "MAINNET"
@@ -67,15 +68,14 @@ function updatePyth(pythClient, tx, tokens) {
67
68
  });
68
69
  });
69
70
  }
70
- function updateOracleWithPyth(pythClient, tx, oraclePackage, typusOracle, baseToken, quoteToken) {
71
+ function updateOracleWithPythUsd(pythClient, tx, oraclePackage, baseToken) {
71
72
  tx.moveCall({
72
- target: "".concat(oraclePackage, "::oracle::update_with_pyth"),
73
+ target: "".concat(oraclePackage, "::oracle::update_with_pyth_usd"),
73
74
  typeArguments: [],
74
75
  arguments: [
75
- tx.object(typusOracle),
76
+ tx.object(constants_1.oracle[pythClient.network][baseToken]),
76
77
  tx.object(constant_1.pythStateId[pythClient.network]),
77
78
  tx.object(constant_1.priceInfoObjectIds[pythClient.network][baseToken]),
78
- tx.object(constant_1.priceInfoObjectIds[pythClient.network][quoteToken]),
79
79
  tx.object("0x6"),
80
80
  ],
81
81
  });
@@ -80,7 +80,7 @@ function splitCoins(tx, token, coins, amount) {
80
80
  }), 1), coin = _a[0];
81
81
  }
82
82
  else {
83
- _b = __read((0, utils_1.normalizeStructTag)(token) == constants_1.tokenType.SUI
83
+ _b = __read((0, utils_1.normalizeStructTag)(token) == constants_1.tokenType.MAINNET.SUI
84
84
  ? tx.splitCoins(tx.gas, [tx.pure.u64(amount)])
85
85
  : (function () {
86
86
  var coin = coins.pop();
@@ -1,12 +1,11 @@
1
1
  export declare class TypusConfig {
2
+ network: "MAINNET" | "TESTNET";
2
3
  rpcEndpoint: string;
3
4
  packageOrigin: Package;
4
5
  package: Package;
5
6
  version: Version;
6
7
  registry: Registry;
7
8
  object: Object;
8
- oracle: Oracle;
9
- token: Token;
10
9
  static parse(json: any): TypusConfig;
11
10
  static local(path: any): TypusConfig;
12
11
  static default(network: "MAINNET" | "TESTNET", customRpcEndpoint: string | null, branch?: string): Promise<TypusConfig>;
@@ -67,13 +66,6 @@ export interface Registry {
67
66
  safu: {
68
67
  safu: string;
69
68
  };
70
- token: {
71
- inj: string;
72
- mfud: string;
73
- sei: string;
74
- mblub: string;
75
- mliq: string;
76
- };
77
69
  typus: {
78
70
  airdrop: string;
79
71
  leaderboard: string;
@@ -97,62 +89,3 @@ export interface Object {
97
89
  launchAuction: string;
98
90
  launchSnapshot: string;
99
91
  }
100
- export interface Oracle {
101
- afsui: string;
102
- apt: string;
103
- buck: string;
104
- cetus: string;
105
- inj: string;
106
- jup: string;
107
- navx: string;
108
- sca: string;
109
- sei: string;
110
- sol: string;
111
- sui: string;
112
- turbos: string;
113
- usdy: string;
114
- btc: string;
115
- eth: string;
116
- mliq: string;
117
- hippo: string;
118
- deep: string;
119
- stsui: string;
120
- wal: string;
121
- }
122
- export interface Token {
123
- afsui: string;
124
- apt: string;
125
- ausd: string;
126
- blub: string;
127
- btc: string;
128
- buck: string;
129
- cetus: string;
130
- eth: string;
131
- fud: string;
132
- hasui: string;
133
- inj: string;
134
- jup: string;
135
- mblub: string;
136
- mfud: string;
137
- navx: string;
138
- sca: string;
139
- sei: string;
140
- sol: string;
141
- sui: string;
142
- texp: string;
143
- tgld: string;
144
- tlp: string;
145
- turbos: string;
146
- usd: string;
147
- usdc: string;
148
- usdt: string;
149
- usdy: string;
150
- vsui: string;
151
- wusdc: string;
152
- mliq: string;
153
- hippo: string;
154
- deep: string;
155
- typus: string;
156
- stsui: string;
157
- wal: string;
158
- }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typus/typus-sdk",
3
3
  "author": "Typus",
4
4
  "description": "typus sdk",
5
- "version": "1.6.12",
5
+ "version": "1.6.14",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.11.1",
8
8
  "@mysten/kiosk": "0.9.34",
@@ -15,8 +15,7 @@
15
15
  "camelcase-keys-deep": "^0.1.0",
16
16
  "dotenv": "^16.4.7",
17
17
  "lodash": "^4.17.21",
18
- "moment": "^2.30.1",
19
- "slack": "^11.0.2"
18
+ "moment": "^2.30.1"
20
19
  },
21
20
  "devDependencies": {
22
21
  "@types/bs58": "^4.0.1",