@typus/typus-sdk 1.4.49-wusdc → 1.4.50

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.
@@ -6,7 +6,7 @@ export declare const tokenType: {
6
6
  SUI: string;
7
7
  BTC: string;
8
8
  ETH: string;
9
- wUSDC: string;
9
+ USDC: string;
10
10
  USDT: string;
11
11
  CETUS: string;
12
12
  BUCK: string;
@@ -44,10 +44,10 @@ export declare const tokenType: {
44
44
  SCA: string;
45
45
  BTC: string;
46
46
  ETH: string;
47
- wUSDC: string;
47
+ USDC: string;
48
48
  BLUB: string;
49
49
  MBLUB: string;
50
50
  };
51
51
  };
52
- export type TOKEN = "SUI" | "CETUS" | "BUCK" | "SOL" | "TURBOS" | "APT" | "FUD" | "MFUD" | "BLUB" | "MBLUB" | "USDT" | "AFSUI" | "INJ" | "SEI" | "USDY" | "TEXP" | "SCA" | "BTC" | "ETH" | "USDC" | "wUSDC";
52
+ export type TOKEN = "SUI" | "CETUS" | "BUCK" | "SOL" | "TURBOS" | "APT" | "FUD" | "MFUD" | "BLUB" | "MBLUB" | "USDT" | "AFSUI" | "INJ" | "SEI" | "USDY" | "TEXP" | "SCA" | "BTC" | "ETH" | "USDC";
53
53
  export declare function typeArgToToken(typeArg: string): string;
@@ -22,7 +22,7 @@ function typeArgToAsset(typeArg) {
22
22
  case "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8":
23
23
  return "WSOL";
24
24
  case "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf":
25
- return "wUSDC";
25
+ return "USDC";
26
26
  case "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c":
27
27
  return "USDT";
28
28
  case "0x5d1f47ea69bb0de31c313d7acf89b890dbb8991ea8e03c6c355171f84bb1ba4a":
@@ -68,8 +68,6 @@ function assetToDecimal(asset) {
68
68
  return 8;
69
69
  case "USDC":
70
70
  return 6;
71
- case "wUSDC":
72
- return 6;
73
71
  case "USDT":
74
72
  return 6;
75
73
  case "USDY":
@@ -113,7 +111,7 @@ exports.tokenType = {
113
111
  SUI: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
114
112
  BTC: "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",
115
113
  ETH: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",
116
- wUSDC: "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",
114
+ USDC: "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",
117
115
  USDT: "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",
118
116
  CETUS: "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS",
119
117
  BUCK: "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK",
@@ -151,7 +149,7 @@ exports.tokenType = {
151
149
  SCA: "0xd33ea459d9e667c112f5168464a885a654d7bc3fd6903720aaa8cf495a32a77e::sca::SCA",
152
150
  BTC: "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::btc::BTC",
153
151
  ETH: "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::eth::ETH",
154
- wUSDC: "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::usdc::USDC",
152
+ USDC: "0x949572061c09bbedef3ac4ffc42e58632291616f0605117cec86d840e09bf519::usdc::USDC",
155
153
  BLUB: "0x94b8f6dcceeb2be160f6837089cc7502458f4f070fa0814380737acb0c41fd5b::blub::BLUB",
156
154
  MBLUB: "0x4b5d0a097ee8a309a89bb2bc589403a4a9a39de639d576495b697be2a60f69bb::mblub::MBLUB",
157
155
  },
@@ -167,7 +165,7 @@ function typeArgToToken(typeArg) {
167
165
  case "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8":
168
166
  return "SOL";
169
167
  case "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf":
170
- return "wUSDC";
168
+ return "USDC";
171
169
  case "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c":
172
170
  return "USDT";
173
171
  case "0x5d1f47ea69bb0de31c313d7acf89b890dbb8991ea8e03c6c355171f84bb1ba4a":
@@ -25,7 +25,7 @@ export declare const ASSET_INFO: {
25
25
  product: PublicKey;
26
26
  price: PublicKey;
27
27
  };
28
- wUSDC: {
28
+ USDC: {
29
29
  product: PublicKey;
30
30
  price: PublicKey;
31
31
  };
@@ -61,6 +61,18 @@ export declare const ASSET_INFO: {
61
61
  product: PublicKey;
62
62
  price: PublicKey;
63
63
  };
64
+ AUSD: {
65
+ product: PublicKey;
66
+ price: PublicKey;
67
+ };
68
+ FUD: {
69
+ product: PublicKey;
70
+ price: PublicKey;
71
+ };
72
+ USDY: {
73
+ product: PublicKey;
74
+ price: PublicKey;
75
+ };
64
76
  };
65
77
  export declare const tokenOrder: {
66
78
  [key: string]: number;
@@ -121,7 +121,7 @@ exports.ASSET_INFO = {
121
121
  product: new web3_js_1.PublicKey("24bB1mRGsrrDVawJTCVYXrxbEz6ozztukPUKvcZCDcPz"),
122
122
  price: new web3_js_1.PublicKey("6cUuAyAX3eXoiWkjFF77RQBEUF15AAMQ7d1hm4EPd3tv"),
123
123
  },
124
- wUSDC: {
124
+ USDC: {
125
125
  product: new web3_js_1.PublicKey("8GWTTbNiXdmyZREXbjsZBmCRuzdPrW55dnZGDkTRjWvb"),
126
126
  price: new web3_js_1.PublicKey("Gnt27xtC473ZT2Mw5u8wZ68Z3gULkSTb5DuxJy7eJotD"),
127
127
  },
@@ -157,6 +157,18 @@ exports.ASSET_INFO = {
157
157
  product: new web3_js_1.PublicKey("9L4zWUnRWEqHT9fvH5WkmQgXf7qrr97SGV4pofTSdK5k"),
158
158
  price: new web3_js_1.PublicKey("6vWPEigSDaAi6m6HuX24aK4fJGJxvQZ8TLQKADC65S2S"),
159
159
  },
160
+ AUSD: {
161
+ product: new web3_js_1.PublicKey("GHXtvZLRq3WGm7DWUke5UdB8P6Jb4MuSwWjd72gGFPc8"),
162
+ price: new web3_js_1.PublicKey("FeHsLbpPsJ7JTBPGKqhBTzvNuX5bjrm4Q6HdgXWgKW8Z"),
163
+ },
164
+ FUD: {
165
+ product: new web3_js_1.PublicKey("2fcvX3is1N5vy17xeqi2x5t7ShFKPaBx91UTH73DvTH3"),
166
+ price: new web3_js_1.PublicKey("89mKNz2WRvoPXy1mbRdaptLPYHsaYBpqmh5oxk2xD4Da"),
167
+ },
168
+ USDY: {
169
+ product: new web3_js_1.PublicKey("555ugWQAae89KU9t9SBWAZTHZtQNkQ18XumbzgxDXQmZ"),
170
+ price: new web3_js_1.PublicKey("GKMnwKMJS97DZHQS9mBquF15cEbgNKHvoayz8uamBp1T"),
171
+ },
160
172
  };
161
173
  exports.tokenOrder = {
162
174
  // Basically it's a to z but put SUI at first
@@ -179,7 +191,6 @@ exports.tokenOrder = {
179
191
  SOL: 14,
180
192
  TURBOS: 15,
181
193
  USDC: 16,
182
- wUSDC: 16,
183
194
  USDT: 17,
184
195
  USDY: 18,
185
196
  VSUI: 20,
@@ -208,7 +219,6 @@ var DefaultOracleDecimal = {
208
219
  APT: "8",
209
220
  SOL: "8",
210
221
  USDC: "8",
211
- wUSDC: "8",
212
222
  USDT: "8",
213
223
  CETUS: "8",
214
224
  TURBOS: "8",
@@ -258,58 +268,23 @@ var parsePythOracleData = function (data, decimals) {
258
268
  };
259
269
  exports.parsePythOracleData = parsePythOracleData;
260
270
  var fetchPrices = function (provider, config) { return __awaiter(void 0, void 0, void 0, function () {
261
- var coinObjects, oracleDecimal, PYTHNET_CLUSTER_NAME, connection, pythPublicKey, pythClient, priceData, prices, suiusd, suifud, fudusd, suiafsui, afsuiusd, suinavx, navxusd, suibuck, buckusd, usdyusdc, usdyusdcWithDecimal, scasui, scausd;
262
- var _a, _b;
263
- return __generator(this, function (_c) {
264
- switch (_c.label) {
265
- case 0: return [4 /*yield*/, provider.multiGetObjects({
266
- ids: Object.values(config.oracle),
267
- options: { showContent: true },
268
- })];
269
- case 1:
270
- coinObjects = _c.sent();
271
+ var oracleDecimal, PYTHNET_CLUSTER_NAME, connection, pythPublicKey, pythClient, priceData, prices, mblub;
272
+ return __generator(this, function (_a) {
273
+ switch (_a.label) {
274
+ case 0:
271
275
  oracleDecimal = __assign({}, DefaultOracleDecimal);
272
- coinObjects.forEach(function (c) {
273
- var _a, _b;
274
- // @ts-ignore
275
- oracleDecimal[(_a = c.data) === null || _a === void 0 ? void 0 : _a.content.fields.base_token] =
276
- // @ts-ignore
277
- (_b = c.data) === null || _b === void 0 ? void 0 : _b.content.fields.decimal;
278
- });
279
276
  PYTHNET_CLUSTER_NAME = "pythnet";
280
277
  connection = new web3_js_1.Connection((0, client_1.getPythClusterApiUrl)(PYTHNET_CLUSTER_NAME));
281
278
  pythPublicKey = (0, client_1.getPythProgramKeyForCluster)(PYTHNET_CLUSTER_NAME);
282
279
  pythClient = new client_1.PythHttpClient(connection, pythPublicKey);
283
280
  return [4 /*yield*/, pythClient.getAssetPricesFromAccounts(Object.values(exports.ASSET_INFO).map(function (a) { return a.price; }))];
284
- case 2:
285
- priceData = _c.sent();
281
+ case 1:
282
+ priceData = _a.sent();
286
283
  prices = (0, exports.parsePythOracleData)(priceData, oracleDecimal);
287
- suiusd = (0, bignumber_js_1.default)((_b = (_a = prices["sui"]) === null || _a === void 0 ? void 0 : _a.price) !== null && _b !== void 0 ? _b : 0);
288
- return [4 /*yield*/, (0, utils_1.getLatestPrice)("SUIFUD")];
289
- case 3:
290
- suifud = _c.sent();
291
- fudusd = suifud == "0" ? (0, bignumber_js_1.default)(0) : suiusd.div(suifud);
292
- return [4 /*yield*/, (0, utils_1.getLatestPrice)("SUIAFSUI")];
293
- case 4:
294
- suiafsui = _c.sent();
295
- afsuiusd = suiafsui == "0" ? (0, bignumber_js_1.default)(0) : suiusd.div(suiafsui);
296
- return [4 /*yield*/, (0, utils_1.getLatestPrice)("SUINAVX")];
297
- case 5:
298
- suinavx = _c.sent();
299
- navxusd = suiusd.div(suinavx);
300
- return [4 /*yield*/, (0, utils_1.getLatestPrice)("SUIBUCK")];
301
- case 6:
302
- suibuck = _c.sent();
303
- buckusd = (0, bignumber_js_1.default)(suibuck).lte(0) ? "0" : suiusd.div(suibuck);
304
- return [4 /*yield*/, (0, utils_1.getLatestPrice)("USDYUSDC")];
305
- case 7:
306
- usdyusdc = _c.sent();
307
- usdyusdcWithDecimal = (0, bignumber_js_1.default)(usdyusdc).multipliedBy((0, bignumber_js_1.default)(10).pow(8));
308
- return [4 /*yield*/, (0, utils_1.getLatestPrice)("SCASUI")];
309
- case 8:
310
- scasui = _c.sent();
311
- scausd = suiusd.eq(0) ? (0, bignumber_js_1.default)(0) : (0, bignumber_js_1.default)(scasui).multipliedBy(suiusd);
312
- return [2 /*return*/, __assign({ fud: { price: fudusd.toString(), decimal: "8", quote: "usd" }, mfud: { price: fudusd.multipliedBy(1000000).toString(), decimal: "8", quote: "usd" }, afsui: { price: afsuiusd.toString(), decimal: "8", quote: "usd" }, navx: { price: navxusd.toString(), decimal: "8", quote: "usd" }, buck: { price: buckusd.toString(), decimal: "8", quote: "usd" }, usdy: { price: usdyusdcWithDecimal.toString(), decimal: "8", quote: "usd" }, sca: { price: scausd.toString(), decimal: "8", quote: "usd" } }, prices)];
284
+ return [4 /*yield*/, (0, utils_1.getLatestPrice)("MBLUBUSDC")];
285
+ case 2:
286
+ mblub = _a.sent();
287
+ return [2 /*return*/, __assign({ mblub: { price: mblub.toString(), decimal: "8", quote: "usd" } }, prices)];
313
288
  }
314
289
  });
315
290
  }); };
@@ -24,7 +24,7 @@ exports.LST = {
24
24
  HASUI: "SUI",
25
25
  VSUI: "SUI",
26
26
  };
27
- exports.StableCoin = ["USDC", "USDT", "BUCK", "USDY", "wUSDC"];
27
+ exports.StableCoin = ["USDC", "USDT", "BUCK", "USDY"];
28
28
  var getTokenName = function (_a) {
29
29
  var _b, _c, _d, _e;
30
30
  var token = _a.token, wrapped = _a.wrapped, million = _a.million;
@@ -403,3 +403,33 @@ function parseBidEvents(datas, end_ts_ms) {
403
403
  });
404
404
  });
405
405
  }
406
+ // SELECT
407
+ // Settle.index as Index,
408
+ // Settle.round as Round,
409
+ // NewAuction.start_ts_ms as ActivationDate,
410
+ // COALESCE(NULLIF(UpdateStrike.strikes, ''), NewAuction.strikes) AS Strikes, -- 如果 UpdateStrike.strikes 是空字符串,就使用 NewAuction.strikes
411
+ // Settle.oracle_price as SettlePrice,
412
+ // -- Settle.share_price as share_price,
413
+ // Delivery.max_size as TotalAuctioned,
414
+ // SafuOtc.delivery_size as OtcSize,
415
+ // Delivery.delivery_size as DeliverySize,
416
+ // ((SafuOtc.delivery_size + Delivery.delivery_size) / TotalAuctioned) as Filled,
417
+ // Delivery.delivery_price as DeliveryPrice,
418
+ // SafuOtc.delivery_price as OtcPrice,
419
+ // Delivery.bidder_bid_value as BidderPremium,
420
+ // Delivery.incentive_bid_value as IncentivePremium,
421
+ // SafuOtc.bidder_bid_value as OtcPremium,
422
+ // (Delivery.bidder_bid_value + Delivery.incentive_bid_value + SafuOtc.bidder_bid_value) AS Premium, -- 三個加在一起的 Premium
423
+ // Delivery.depositor_incentive_value as BpIncentive, -- SUI or SCA
424
+ // Delivery.fixed_incentive_amount as FiexedIncentive, -- SUI
425
+ // (Settle.settle_balance - Settle.settled_balance) as OptionProfit,
426
+ // Settle.d_token as d_token,
427
+ // Delivery.b_token as b_token,
428
+ // Delivery.o_token as o_token
429
+ // FROM Settle
430
+ // JOIN NewAuction ON Settle.index = NewAuction.index AND Settle.round = NewAuction.round
431
+ // LEFT JOIN UpdateStrike ON Settle.index = UpdateStrike.index AND Settle.round = UpdateStrike.round
432
+ // JOIN Delivery ON Settle.index = Delivery.index AND Settle.round = Delivery.round
433
+ // LEFT JOIN SafuOtc ON Settle.index = SafuOtc.index AND Settle.round = SafuOtc.round
434
+ // WHERE Settle.timestamp >= 1725170000
435
+ // ORDER BY Index ASC;
@@ -85,6 +85,8 @@ export interface Oracle {
85
85
  export interface Token {
86
86
  afsui: string;
87
87
  apt: string;
88
+ ausd: string;
89
+ blub: string;
88
90
  btc: string;
89
91
  buck: string;
90
92
  cetus: string;
@@ -93,6 +95,7 @@ export interface Token {
93
95
  hasui: string;
94
96
  inj: string;
95
97
  jup: string;
98
+ mblub: string;
96
99
  mfud: string;
97
100
  navx: string;
98
101
  sca: string;
@@ -105,11 +108,8 @@ export interface Token {
105
108
  turbos: string;
106
109
  usd: string;
107
110
  usdc: string;
108
- wusdc: string;
109
111
  usdt: string;
110
112
  usdy: string;
111
113
  vsui: string;
112
- blub: string;
113
- mblub: string;
114
- ausd: string;
114
+ wusdc: string;
115
115
  }
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.4.49-wusdc",
5
+ "version": "1.4.50",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.11.1",
8
8
  "@mysten/kiosk": "0.8.10",