@typus/typus-sdk 1.6.11 → 1.6.12
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/src/auto-bid/token-user-entry.js +60 -5
- package/dist/src/constants/token.d.ts +58 -21
- package/dist/src/constants/token.js +165 -275
- package/dist/src/typus-dov-single-v2/history/user-history.d.ts +1 -2
- package/dist/src/typus-dov-single-v2/token-user-entry.d.ts +0 -1
- package/dist/src/typus-dov-single-v2/token-user-entry.js +65 -14
- package/dist/src/typus-dov-single-v2/user-entry.d.ts +1 -1
- package/dist/src/typus-dov-single-v2/user-entry.js +8 -5
- package/dist/src/typus-safu/user-entry.js +1 -1
- package/dist/src/utils/api/sentio/vault-history.js +3 -3
- package/dist/src/utils/pyth/constant.d.ts +50 -7
- package/dist/src/utils/pyth/constant.js +30 -70
- package/dist/src/utils/pyth/pythClient.d.ts +1 -1
- package/dist/src/utils/pyth/pythClient.js +5 -5
- package/dist/src/utils/tools.js +1 -1
- package/dist/src/utils/typusConfig.d.ts +68 -1
- package/package.json +3 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTokenRegistry = getTokenRegistry;
|
|
4
3
|
exports.getTokenRaiseFundTx = getTokenRaiseFundTx;
|
|
5
4
|
exports.getTokenReduceFundTx = getTokenReduceFundTx;
|
|
6
5
|
exports.getTokenNewBidTx = getTokenNewBidTx;
|
|
@@ -8,26 +7,22 @@ exports.getTokenExerciseTx = getTokenExerciseTx;
|
|
|
8
7
|
exports.getTokenRebateTx = getTokenRebateTx;
|
|
9
8
|
exports.getTokenCompoundWithRedeemTx = getTokenCompoundWithRedeemTx;
|
|
10
9
|
var constants_1 = require("../../src/constants");
|
|
11
|
-
function
|
|
10
|
+
function getTokenRaiseFundTx(config, tx, input) {
|
|
12
11
|
var typusTokenRegistry = "";
|
|
13
|
-
switch (typusTokenType.split("::")[1]) {
|
|
12
|
+
switch (input.typusTokenType.split("::")[1]) {
|
|
14
13
|
case "mfud":
|
|
15
|
-
typusTokenRegistry =
|
|
14
|
+
typusTokenRegistry = config.registry.token.mfud;
|
|
16
15
|
break;
|
|
17
16
|
case "mblub":
|
|
18
|
-
typusTokenRegistry =
|
|
17
|
+
typusTokenRegistry = config.registry.token.mblub;
|
|
19
18
|
break;
|
|
20
19
|
case "mliq":
|
|
21
|
-
typusTokenRegistry =
|
|
20
|
+
typusTokenRegistry = config.registry.token.mliq;
|
|
22
21
|
break;
|
|
23
22
|
default:
|
|
24
23
|
console.log("No such token exists!");
|
|
25
24
|
break;
|
|
26
25
|
}
|
|
27
|
-
return typusTokenRegistry;
|
|
28
|
-
}
|
|
29
|
-
function getTokenRaiseFundTx(config, tx, input) {
|
|
30
|
-
var typusTokenRegistry = getTokenRegistry(config, input.typusTokenType);
|
|
31
26
|
var typusTokenBalance = input.raiseCoins.length > 0
|
|
32
27
|
? tx.moveCall({
|
|
33
28
|
target: "0x2::coin::into_balance",
|
|
@@ -71,7 +66,21 @@ function getTokenRaiseFundTx(config, tx, input) {
|
|
|
71
66
|
return tx;
|
|
72
67
|
}
|
|
73
68
|
function getTokenReduceFundTx(config, tx, input) {
|
|
74
|
-
var typusTokenRegistry =
|
|
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
|
+
}
|
|
75
84
|
var result = tx.moveCall({
|
|
76
85
|
target: "".concat(config.package.dovSingle, "::tds_user_entry::public_reduce_fund"),
|
|
77
86
|
typeArguments: input.typeArguments,
|
|
@@ -157,7 +166,21 @@ function getTokenReduceFundTx(config, tx, input) {
|
|
|
157
166
|
return tx;
|
|
158
167
|
}
|
|
159
168
|
function getTokenNewBidTx(config, tx, input) {
|
|
160
|
-
var typusTokenRegistry =
|
|
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
|
+
}
|
|
161
184
|
var mToken = tx.moveCall({
|
|
162
185
|
target: "".concat(input.typusTokenType.split("::")[0], "::").concat(input.typusTokenType.split("::")[1], "::mint"),
|
|
163
186
|
arguments: [
|
|
@@ -190,7 +213,21 @@ function getTokenNewBidTx(config, tx, input) {
|
|
|
190
213
|
return tx;
|
|
191
214
|
}
|
|
192
215
|
function getTokenExerciseTx(config, tx, input) {
|
|
193
|
-
var typusTokenRegistry =
|
|
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
|
+
}
|
|
194
231
|
var result = tx.moveCall({
|
|
195
232
|
target: "".concat(config.package.dovSingle, "::tds_user_entry::exercise"),
|
|
196
233
|
typeArguments: input.typeArguments,
|
|
@@ -216,7 +253,21 @@ function getTokenExerciseTx(config, tx, input) {
|
|
|
216
253
|
return tx;
|
|
217
254
|
}
|
|
218
255
|
function getTokenRebateTx(config, tx, input) {
|
|
219
|
-
var typusTokenRegistry =
|
|
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
|
+
}
|
|
220
271
|
var result = tx.moveCall({
|
|
221
272
|
target: "".concat(config.package.dovSingle, "::tds_user_entry::rebate"),
|
|
222
273
|
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
|
|
127
|
+
share: string;
|
|
128
128
|
recipient: string;
|
|
129
129
|
}): import("@mysten/sui/transactions").TransactionResult;
|
|
130
130
|
export declare function getMultiTransferBidReceiptTx(config: TypusConfig, input: {
|
|
@@ -26,6 +26,7 @@ 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");
|
|
29
30
|
var transactions_1 = require("@mysten/sui/transactions");
|
|
30
31
|
var constants_1 = require("../../src/constants");
|
|
31
32
|
var utils_1 = require("../../src/utils");
|
|
@@ -294,7 +295,8 @@ function getSplitBidReceiptTx(config, tx, input) {
|
|
|
294
295
|
type: "".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt"),
|
|
295
296
|
elements: input.receipts.map(function (receipt) { return tx.object(receipt); }),
|
|
296
297
|
}),
|
|
297
|
-
tx.pure
|
|
298
|
+
// tx.pure([input.share]),
|
|
299
|
+
tx.pure(bcs_1.bcs.vector(bcs_1.bcs.U64).serialize([input.share])),
|
|
298
300
|
],
|
|
299
301
|
});
|
|
300
302
|
var unwrap0 = tx.moveCall({
|
|
@@ -302,11 +304,12 @@ function getSplitBidReceiptTx(config, tx, input) {
|
|
|
302
304
|
typeArguments: ["".concat(config.packageOrigin.framework, "::vault::TypusBidReceipt")],
|
|
303
305
|
arguments: [tx.object(result[0])],
|
|
304
306
|
});
|
|
305
|
-
tx.moveCall({
|
|
306
|
-
target: "
|
|
307
|
-
typeArguments: [],
|
|
308
|
-
arguments: [tx.object(result[1])
|
|
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])],
|
|
309
311
|
});
|
|
312
|
+
tx.transferObjects([unwrap1], input.recipient);
|
|
310
313
|
return unwrap0;
|
|
311
314
|
}
|
|
312
315
|
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.
|
|
82
|
+
tx.object((0, utils_1.splitCoins)(tx, constants_1.tokenType.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
|
|
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 "),
|
|
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 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
|
|
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 "),
|
|
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\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
|
|
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 "),
|
|
131
131
|
size: limit,
|
|
132
132
|
},
|
|
133
133
|
};
|
|
@@ -1,18 +1,61 @@
|
|
|
1
|
-
import { TOKEN } from "../../../src/constants";
|
|
2
1
|
export declare const priceIDs: {
|
|
3
2
|
MAINNET: {
|
|
4
|
-
|
|
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;
|
|
5
31
|
};
|
|
6
32
|
TESTNET: {
|
|
7
|
-
|
|
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;
|
|
8
44
|
};
|
|
9
45
|
};
|
|
10
46
|
export declare const priceInfoObjectIds: {
|
|
11
|
-
MAINNET: {
|
|
12
|
-
[key in TOKEN]?: string;
|
|
13
|
-
};
|
|
14
47
|
TESTNET: {
|
|
15
|
-
|
|
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;
|
|
16
59
|
};
|
|
17
60
|
};
|
|
18
61
|
export declare const wormholeStateId: {
|
|
@@ -34,87 +34,47 @@ exports.priceIDs = {
|
|
|
34
34
|
STSUI: "0x0449948a9a210481464ea7030734fa79f59b751c2f411cfb1ba56b5f69e4a62a",
|
|
35
35
|
NS: "0xbb5ff26e47a3a6cc7ec2fce1db996c2a145300edc5acaabe43bf9ff7c5dd5d32",
|
|
36
36
|
WAL: "0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341",
|
|
37
|
-
LBTC: "0x8f257aab6e7698bb92b15511915e593d6f8eae914452f781874754b03d0c612b",
|
|
38
37
|
},
|
|
39
38
|
TESTNET: {
|
|
40
39
|
// Pyth EVM Beta
|
|
41
|
-
SUI: "0x50c67b3fd225db8912a424dd4baed60ffdde625ed2feaaf283724f9608fea266",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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",
|
|
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
|
|
71
51
|
},
|
|
72
52
|
};
|
|
73
53
|
exports.priceInfoObjectIds = {
|
|
74
|
-
MAINNET: {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
},
|
|
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
|
+
// },
|
|
97
66
|
TESTNET: {
|
|
98
67
|
SUI: "0x1ebb295c789cc42b3b2a1606482cd1c7124076a0f5676718501fda8c7fd075a0",
|
|
99
|
-
CETUS: "0xb0ba78106259b7ceefd288edc5f65b65f8b7bca0816e61dae5136616aac7d3da",
|
|
100
68
|
USDC: "0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81",
|
|
101
69
|
wUSDC: "0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81",
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
wUSDT: "0x956fdcbf83a26c962319f7742f5728a0a7ce59c7f0cbe13c112b259e7ee953cd",
|
|
108
|
-
// DOGE: "0x17b358d730663caa888c8b621b9994a60af422cd83f32237c6b2a8b3230d71b9",
|
|
109
|
-
INJ: "0x459e2e0dd757715449fc1d36925f384446bf192c9f86a4ca02d587c82de51802",
|
|
110
|
-
SEI: "0xb3e7f40e8268fb2539a03b29c1b38366e061c3c8222f7ad4c8db998eb0a02f8d",
|
|
111
|
-
JUP: "0x23817c9edbbfbdef6add3800cd52751eff5bb0f7abd32e54a8f2225d6a6523d3",
|
|
112
|
-
SCA: "0xf96e3c4b7d74efbde9df5b669188421196e6164adf6fbaaa92903c42569807c8",
|
|
113
|
-
AFSUI: "0x6785a8c69da40c9435d41a2585cf92643d2ed2c5cd12938ecff28eaf54efadcd",
|
|
70
|
+
USDT: "0x956fdcbf83a26c962319f7742f5728a0a7ce59c7f0cbe13c112b259e7ee953cd",
|
|
71
|
+
BTC: "0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba",
|
|
72
|
+
ETH: "0x4fde30cb8a5dc3cfee1c1c358fc66dc308408827efb217247c7ba54d76ccbee9",
|
|
73
|
+
SOL: "0x33fbce1cad5ca155f2f5051430b23a694bc6e5de6df43e0f8aefe29f4a84336d",
|
|
74
|
+
CETUS: "0xb0ba78106259b7ceefd288edc5f65b65f8b7bca0816e61dae5136616aac7d3da",
|
|
114
75
|
NAVX: "0x94905bdcaa656b0908aa8a3a42cf72b0e8e2e849f7d0a7e0e39bb9e1dc3c9cf6",
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
BLUB: "0xdcd4cc5f06fac1ca72e8551ab1a2e847298afa6f19e370ad9891199a59d2c22e",
|
|
76
|
+
SCA: "0xf96e3c4b7d74efbde9df5b669188421196e6164adf6fbaaa92903c42569807c8",
|
|
77
|
+
TURBOS: "0xfe38289883c3afed692e5856f4896b3e094d4793e2ccf0a2715b890a718fa5c0",
|
|
118
78
|
},
|
|
119
79
|
};
|
|
120
80
|
// 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
|
|
12
|
+
export declare function updateOracleWithPyth(pythClient: PythClient, tx: Transaction, oraclePackage: string, typusOracle: string, baseToken: TOKEN, quoteToken: TOKEN): void;
|
|
@@ -38,10 +38,9 @@ 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.
|
|
41
|
+
exports.updateOracleWithPyth = updateOracleWithPyth;
|
|
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");
|
|
45
44
|
function createPythClient(provider, network) {
|
|
46
45
|
var client = new pyth_sui_js_1.SuiPythClient(provider, constant_1.pythStateId[network], constant_1.wormholeStateId[network]);
|
|
47
46
|
var connection = network == "MAINNET"
|
|
@@ -68,14 +67,15 @@ function updatePyth(pythClient, tx, tokens) {
|
|
|
68
67
|
});
|
|
69
68
|
});
|
|
70
69
|
}
|
|
71
|
-
function
|
|
70
|
+
function updateOracleWithPyth(pythClient, tx, oraclePackage, typusOracle, baseToken, quoteToken) {
|
|
72
71
|
tx.moveCall({
|
|
73
|
-
target: "".concat(oraclePackage, "::oracle::
|
|
72
|
+
target: "".concat(oraclePackage, "::oracle::update_with_pyth"),
|
|
74
73
|
typeArguments: [],
|
|
75
74
|
arguments: [
|
|
76
|
-
tx.object(
|
|
75
|
+
tx.object(typusOracle),
|
|
77
76
|
tx.object(constant_1.pythStateId[pythClient.network]),
|
|
78
77
|
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
|
});
|
package/dist/src/utils/tools.js
CHANGED
|
@@ -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.
|
|
83
|
+
_b = __read((0, utils_1.normalizeStructTag)(token) == constants_1.tokenType.SUI
|
|
84
84
|
? tx.splitCoins(tx.gas, [tx.pure.u64(amount)])
|
|
85
85
|
: (function () {
|
|
86
86
|
var coin = coins.pop();
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export declare class TypusConfig {
|
|
2
|
-
network: "MAINNET" | "TESTNET";
|
|
3
2
|
rpcEndpoint: string;
|
|
4
3
|
packageOrigin: Package;
|
|
5
4
|
package: Package;
|
|
6
5
|
version: Version;
|
|
7
6
|
registry: Registry;
|
|
8
7
|
object: Object;
|
|
8
|
+
oracle: Oracle;
|
|
9
|
+
token: Token;
|
|
9
10
|
static parse(json: any): TypusConfig;
|
|
10
11
|
static local(path: any): TypusConfig;
|
|
11
12
|
static default(network: "MAINNET" | "TESTNET", customRpcEndpoint: string | null, branch?: string): Promise<TypusConfig>;
|
|
@@ -66,6 +67,13 @@ export interface Registry {
|
|
|
66
67
|
safu: {
|
|
67
68
|
safu: string;
|
|
68
69
|
};
|
|
70
|
+
token: {
|
|
71
|
+
inj: string;
|
|
72
|
+
mfud: string;
|
|
73
|
+
sei: string;
|
|
74
|
+
mblub: string;
|
|
75
|
+
mliq: string;
|
|
76
|
+
};
|
|
69
77
|
typus: {
|
|
70
78
|
airdrop: string;
|
|
71
79
|
leaderboard: string;
|
|
@@ -89,3 +97,62 @@ export interface Object {
|
|
|
89
97
|
launchAuction: string;
|
|
90
98
|
launchSnapshot: string;
|
|
91
99
|
}
|
|
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.
|
|
5
|
+
"version": "1.6.12",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@mysten/bcs": "^0.11.1",
|
|
8
8
|
"@mysten/kiosk": "0.9.34",
|
|
@@ -15,7 +15,8 @@
|
|
|
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"
|
|
18
|
+
"moment": "^2.30.1",
|
|
19
|
+
"slack": "^11.0.2"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"@types/bs58": "^4.0.1",
|