zo-sdk 0.0.4

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/src/api.ts ADDED
@@ -0,0 +1,544 @@
1
+ /* eslint-disable no-param-reassign */
2
+ /* eslint-disable class-methods-use-this */
3
+ import type { SuiClient } from '@mysten/sui/client'
4
+ import { Transaction } from '@mysten/sui/transactions'
5
+ import { SUI_CLOCK_OBJECT_ID } from '@mysten/sui/utils'
6
+
7
+ import type { Network } from './consts'
8
+ import { ALLOW_TRADE_CAN_TRADE, ALLOW_TRADE_MUST_TRADE, ALLOW_TRADE_NO_TRADE } from './consts'
9
+ import type { ICredential } from './data'
10
+ import { DataAPI } from './data'
11
+ import { joinSymbol } from './utils'
12
+
13
+ export class API extends DataAPI {
14
+ private static instance: API
15
+
16
+ // eslint-disable-next-line @typescript-eslint/no-useless-constructor
17
+ constructor(
18
+ network: Network,
19
+ provider: SuiClient | null,
20
+ apiEndpoint: string,
21
+ connectionURL: string,
22
+ ) {
23
+ super(network, provider, apiEndpoint, connectionURL)
24
+ }
25
+
26
+ public static getInstance(
27
+ network: Network,
28
+ provider: SuiClient | null,
29
+ apiEndpoint: string,
30
+ connectionURL: string,
31
+ ): API {
32
+ if (!API.instance) {
33
+ API.instance = new API(network, provider, apiEndpoint, connectionURL)
34
+ }
35
+ return API.instance
36
+ }
37
+
38
+ #processCoins = (tx: Transaction, coin: string, coinObjects: string[]) => {
39
+ if (coin === 'sui') {
40
+ return tx.gas
41
+ }
42
+ if (coinObjects.length > 1) {
43
+ tx.mergeCoins(tx.object(coinObjects[0]), coinObjects.slice(1).map(coinObject => tx.object(coinObject)))
44
+ }
45
+ return tx.object(coinObjects[0])
46
+ }
47
+
48
+ #processSlippage(indexPrice: number, long: boolean, slippage: number) {
49
+ const raw = long ? (indexPrice * (1 + slippage)) : (indexPrice * (1 - slippage))
50
+ return BigInt(Math.round(raw * 1e18))
51
+ }
52
+
53
+ deposit = async (
54
+ coin: string,
55
+ coinObjects: string[],
56
+ amount: number,
57
+ minAmountOut = 0,
58
+ ) => {
59
+ const tx = await this.initOracleTxb(Object.keys(this.consts.pythFeeder.feeder))
60
+ const coinObject = this.#processCoins(tx, coin, coinObjects)
61
+ const [depositObject] = tx.splitCoins(coinObject, [tx.pure.u64(amount)])
62
+
63
+ const {
64
+ vaultsValuation,
65
+ symbolsValuation,
66
+ } = this.valuate(tx)
67
+
68
+ tx.moveCall({
69
+ target: `${this.consts.zoCore.package}::market::deposit`,
70
+ typeArguments: [
71
+ `${this.consts.zoCore.package}::zlp::ZLP`,
72
+ this.consts.coins[coin].module,
73
+ ],
74
+ arguments: [
75
+ tx.object(this.consts.zoCore.market),
76
+ tx.object(this.consts.zoCore.rebaseFeeModel),
77
+ depositObject,
78
+ tx.pure.u64(minAmountOut),
79
+ vaultsValuation,
80
+ symbolsValuation,
81
+ ],
82
+ })
83
+ return tx
84
+ }
85
+
86
+ withdraw = async (
87
+ coin: string,
88
+ zlpCoinObjects: string[],
89
+ amount: number,
90
+ minAmountOut = 0,
91
+ ) => {
92
+ const tx = await this.initOracleTxb(Object.keys(this.consts.pythFeeder.feeder))
93
+ const zlpCoinObject = this.#processCoins(tx, 'zlp', zlpCoinObjects)
94
+ const [withdrawObject] = tx.splitCoins(zlpCoinObject, [tx.pure.u64(amount)])
95
+
96
+ const {
97
+ vaultsValuation,
98
+ symbolsValuation,
99
+ } = this.valuate(tx)
100
+
101
+ tx.moveCall({
102
+ target: `${this.consts.zoCore.package}::market::withdraw`,
103
+ typeArguments: [
104
+ `${this.consts.zoCore.package}::zlp::ZLP`,
105
+ this.consts.coins[coin].module,
106
+ ],
107
+ arguments: [
108
+ tx.object(this.consts.zoCore.market),
109
+ tx.object(this.consts.zoCore.rebaseFeeModel),
110
+ withdrawObject,
111
+ tx.pure.u64(minAmountOut),
112
+ vaultsValuation,
113
+ symbolsValuation,
114
+ ],
115
+ })
116
+ return tx
117
+ }
118
+
119
+ openPosition = async (
120
+ collateralToken: string,
121
+ indexToken: string,
122
+ size: bigint,
123
+ collateralAmount: bigint,
124
+ coinObjects: string[],
125
+ long: boolean,
126
+ reserveAmount: bigint,
127
+ indexPrice: number,
128
+ collateralPrice: number,
129
+ slippage = 0.003,
130
+ isLimitOrder = false,
131
+ isIocOrder = false,
132
+ relayerFee = BigInt(1),
133
+ referralAddress = '',
134
+ sender = '',
135
+ ) => {
136
+ let tx = new Transaction()
137
+ if (referralAddress && !await this.hasReferral(sender || '')) {
138
+ tx = await this.addReferral(referralAddress, tx)
139
+ }
140
+ tx = await this.initOracleTxb([collateralToken, indexToken], tx)
141
+ const coinObject = this.#processCoins(tx, collateralToken, coinObjects)
142
+ const [depositObject] = tx.splitCoins(coinObject, [tx.pure.u64(collateralAmount)])
143
+ const feeObject = tx.splitCoins(tx.gas, [tx.pure.u64(relayerFee)])
144
+
145
+ const symbol = joinSymbol(long ? 'long' : 'short', indexToken)
146
+ const adjustPrice = this.#processSlippage(indexPrice, long, isLimitOrder ? 0 : slippage)
147
+ const adjustCollateralPrice = this.#processSlippage(collateralPrice, false, 0.5)
148
+
149
+ let allowTrade = ALLOW_TRADE_MUST_TRADE
150
+ if (isLimitOrder) {
151
+ allowTrade = isIocOrder ? ALLOW_TRADE_NO_TRADE : ALLOW_TRADE_CAN_TRADE
152
+ }
153
+
154
+ tx.moveCall({
155
+ target: `${this.consts.zoCore.package}::market::open_position`,
156
+ typeArguments: [
157
+ `${this.consts.zoCore.package}::zlp::ZLP`,
158
+ this.consts.coins[collateralToken].module,
159
+ this.consts.coins[indexToken].module,
160
+ `${this.consts.zoCore.package}::market::${long ? 'LONG' : 'SHORT'}`,
161
+ this.consts.coins.sui.module,
162
+ ],
163
+ arguments: [
164
+ tx.object(SUI_CLOCK_OBJECT_ID),
165
+ tx.object(this.consts.zoCore.market),
166
+ tx.object(this.consts.zoCore.vaults[collateralToken].reservingFeeModel),
167
+ tx.object(this.consts.zoCore.symbols[symbol].fundingFeeModel),
168
+ tx.object(this.consts.zoCore.symbols[symbol].positionConfig),
169
+ tx.object(this.consts.pythFeeder.feeder[collateralToken]),
170
+ tx.object(this.consts.pythFeeder.feeder[indexToken]),
171
+ depositObject,
172
+ feeObject,
173
+ tx.pure.u8(allowTrade),
174
+ tx.pure.u64(size),
175
+ tx.pure.u64(reserveAmount),
176
+ tx.pure.u256(adjustCollateralPrice),
177
+ tx.pure.u256(adjustPrice),
178
+ ],
179
+ })
180
+ return tx
181
+ }
182
+
183
+ pledgeInPosition = async (
184
+ pcpId: string,
185
+ collateralToken: string,
186
+ indexToken: string,
187
+ amount: number,
188
+ coinObjects: string[],
189
+ long: boolean,
190
+ ) => {
191
+ const tx = await this.initOracleTxb([collateralToken, indexToken])
192
+ const coinObject = this.#processCoins(tx, collateralToken, coinObjects)
193
+ const [depositObject] = tx.splitCoins(coinObject, [tx.pure.u64(amount)])
194
+
195
+ tx.moveCall({
196
+ target: `${this.consts.zoCore.package}::market::pledge_in_position`,
197
+ typeArguments: [
198
+ `${this.consts.zoCore.package}::zlp::ZLP`,
199
+ this.consts.coins[collateralToken].module,
200
+ this.consts.coins[indexToken].module,
201
+ `${this.consts.zoCore.package}::market::${long ? 'LONG' : 'SHORT'}`,
202
+ ],
203
+ arguments: [
204
+ tx.object(this.consts.zoCore.market),
205
+ tx.object(pcpId),
206
+ depositObject,
207
+ ],
208
+ })
209
+ return tx
210
+ }
211
+
212
+ redeemFromPosition = async (
213
+ pcpId: string,
214
+ collateralToken: string,
215
+ indexToken: string,
216
+ amount: number,
217
+ long: boolean,
218
+ ) => {
219
+ const tx = await this.initOracleTxb([collateralToken, indexToken])
220
+ const symbol = joinSymbol(long ? 'long' : 'short', indexToken)
221
+
222
+ tx.moveCall({
223
+ target: `${this.consts.zoCore.package}::market::redeem_from_position`,
224
+ typeArguments: [
225
+ `${this.consts.zoCore.package}::zlp::ZLP`,
226
+ this.consts.coins[collateralToken].module,
227
+ this.consts.coins[indexToken].module,
228
+ `${this.consts.zoCore.package}::market::${long ? 'LONG' : 'SHORT'}`,
229
+ ],
230
+ arguments: [
231
+ tx.object(SUI_CLOCK_OBJECT_ID),
232
+ tx.object(this.consts.zoCore.market),
233
+ tx.object(pcpId),
234
+ tx.object(this.consts.zoCore.vaults[collateralToken].reservingFeeModel),
235
+ tx.object(this.consts.zoCore.symbols[symbol].fundingFeeModel),
236
+ tx.object(this.consts.pythFeeder.feeder[collateralToken]),
237
+ tx.object(this.consts.pythFeeder.feeder[indexToken]),
238
+ tx.pure.u64(amount),
239
+ ],
240
+ })
241
+
242
+ return tx
243
+ }
244
+
245
+ decreasePosition = async (
246
+ pcpId: string,
247
+ collateralToken: string,
248
+ indexToken: string,
249
+ amount: bigint,
250
+ long: boolean,
251
+ indexPrice: number,
252
+ collateralPrice: number,
253
+ isTriggerOrder = false,
254
+ isTakeProfitOrder = true,
255
+ isIocOrder = false,
256
+ slippage = 0.003,
257
+ relayerFee = BigInt(1),
258
+ ) => {
259
+ const tx = await this.initOracleTxb([collateralToken, indexToken])
260
+ const symbol = joinSymbol(long ? 'long' : 'short', indexToken)
261
+ const feeObject = tx.splitCoins(tx.gas, [tx.pure.u64(relayerFee)])
262
+
263
+ const adjustPrice = this.#processSlippage(indexPrice, !long, isTriggerOrder ? 0 : slippage)
264
+ const adjustCollateralPrice = this.#processSlippage(collateralPrice, false, 0.5)
265
+
266
+ let allowTrade = ALLOW_TRADE_MUST_TRADE
267
+ if (isTriggerOrder) {
268
+ allowTrade = isIocOrder || !isTakeProfitOrder ? ALLOW_TRADE_NO_TRADE : ALLOW_TRADE_CAN_TRADE
269
+ }
270
+ else {
271
+ isTakeProfitOrder = true
272
+ }
273
+
274
+ /* console.log('isTriggerOrder:', isTriggerOrder)
275
+ console.log('isIocOrder:', isIocOrder)
276
+ console.log('isTakeProfitOrder:', isTakeProfitOrder)
277
+ console.log('adjustPrice:', adjustPrice)
278
+ console.log('allowTrade:', allowTrade)
279
+ console.log('isTriggerOrder:', isTriggerOrder)
280
+ console.log('isTakeProfitOrder:', isTakeProfitOrder) */
281
+
282
+ tx.moveCall({
283
+ target: `${this.consts.zoCore.package}::market::decrease_position`,
284
+ typeArguments: [
285
+ `${this.consts.zoCore.package}::zlp::ZLP`,
286
+ this.consts.coins[collateralToken].module,
287
+ this.consts.coins[indexToken].module,
288
+ `${this.consts.zoCore.package}::market::${long ? 'LONG' : 'SHORT'}`,
289
+ this.consts.coins.sui.module,
290
+ ],
291
+ arguments: [
292
+ tx.object(SUI_CLOCK_OBJECT_ID),
293
+ tx.object(this.consts.zoCore.market),
294
+ tx.object(pcpId),
295
+ tx.object(this.consts.zoCore.vaults[collateralToken].reservingFeeModel),
296
+ tx.object(this.consts.zoCore.symbols[symbol].fundingFeeModel),
297
+ tx.object(this.consts.pythFeeder.feeder[collateralToken]),
298
+ tx.object(this.consts.pythFeeder.feeder[indexToken]),
299
+ feeObject,
300
+ tx.pure.u8(allowTrade),
301
+ tx.pure.bool(isTakeProfitOrder),
302
+ tx.pure.u64(amount),
303
+ tx.pure.u256(adjustCollateralPrice),
304
+ tx.pure.u256(adjustPrice),
305
+ ],
306
+ })
307
+
308
+ return tx
309
+ }
310
+
311
+ cancelOrder = (
312
+ orderCapId: string,
313
+ collateralToken: string,
314
+ indexToken: string,
315
+ long: boolean,
316
+ type: string,
317
+ isV11Order = false,
318
+ ) => {
319
+ const tx = new Transaction()
320
+ let functionName = ''
321
+ switch (type) {
322
+ case 'OPEN_POSITION': {
323
+ functionName = isV11Order ? 'clear_open_position_order' : 'clear_open_position_order'
324
+ break
325
+ }
326
+ case 'DECREASE_POSITION': {
327
+ functionName = isV11Order ? 'clear_decrease_position_order' : 'clear_decrease_position_order'
328
+ break
329
+ }
330
+ default: {
331
+ throw new Error('invalid order type')
332
+ }
333
+ }
334
+ tx.moveCall({
335
+ target: `${this.consts.zoCore.package}::market::${functionName}`,
336
+ typeArguments: [
337
+ `${this.consts.zoCore.package}::zlp::ZLP`,
338
+ this.consts.coins[collateralToken].module,
339
+ this.consts.coins[indexToken].module,
340
+ `${this.consts.zoCore.package}::market::${long ? 'LONG' : 'SHORT'}`,
341
+ this.consts.coins.sui.module,
342
+ ],
343
+ arguments: [
344
+ tx.object(this.consts.zoCore.market),
345
+ tx.object(orderCapId),
346
+ ],
347
+ })
348
+ return tx
349
+ }
350
+
351
+ swap = async (
352
+ fromToken: string,
353
+ toToken: string,
354
+ fromAmount: bigint,
355
+ fromCoinObjects: string[],
356
+ ) => {
357
+ const tx = await this.initOracleTxb(Object.keys(this.consts.zoCore.vaults))
358
+ const fromCoinObject = this.#processCoins(tx, fromToken, fromCoinObjects)
359
+ const [fromDepositObject] = tx.splitCoins(fromCoinObject, [tx.pure.u64(fromAmount)])
360
+ const vaultsValuation = this.valuateVaults(tx)
361
+
362
+ tx.moveCall({
363
+ target: `${this.consts.zoCore.package}::market::swap`,
364
+ typeArguments: [
365
+ `${this.consts.zoCore.package}::zlp::ZLP`,
366
+ this.consts.coins[fromToken].module,
367
+ this.consts.coins[toToken].module,
368
+ ],
369
+ arguments: [
370
+ tx.object(this.consts.zoCore.market),
371
+ tx.object(this.consts.zoCore.rebaseFeeModel),
372
+ fromDepositObject,
373
+ // FIXME: minAmountOut
374
+ tx.pure.u64(0),
375
+ vaultsValuation,
376
+ ],
377
+ })
378
+ return tx
379
+ }
380
+
381
+ clearClosedPosition = (
382
+ pcpId: string,
383
+ collateralToken: string,
384
+ indexToken: string,
385
+ long: boolean,
386
+ tx: Transaction,
387
+ ) => {
388
+ tx.moveCall({
389
+ target: `${this.consts.zoCore.package}::market::clear_closed_position`,
390
+ typeArguments: [
391
+ `${this.consts.zoCore.package}::zlp::ZLP`,
392
+ this.consts.coins[collateralToken].module,
393
+ this.consts.coins[indexToken].module,
394
+ `${this.consts.zoCore.package}::market::${long ? 'LONG' : 'SHORT'}`,
395
+ ],
396
+ arguments: [
397
+ tx.object(this.consts.zoCore.market),
398
+ tx.object(pcpId),
399
+ ],
400
+ })
401
+ }
402
+
403
+ clearOpenPositionOrder = (
404
+ orderCapId: string,
405
+ collateralToken: string,
406
+ indexToken: string,
407
+ long: boolean,
408
+ tx: Transaction,
409
+ isV11Order = false,
410
+ ) => {
411
+ const funcName = isV11Order ? 'clear_open_position_order' : 'clear_open_position_order'
412
+ tx.moveCall({
413
+ target: `${this.consts.zoCore.package}::market::${funcName}`,
414
+ typeArguments: [
415
+ `${this.consts.zoCore.package}::zlp::ZLP`,
416
+ this.consts.coins[collateralToken].module,
417
+ this.consts.coins[indexToken].module,
418
+ `${this.consts.zoCore.package}::market::${long ? 'LONG' : 'SHORT'}`,
419
+ this.consts.coins.sui.module,
420
+ ],
421
+ arguments: [
422
+ tx.object(this.consts.zoCore.market),
423
+ tx.object(orderCapId),
424
+ ],
425
+ })
426
+ }
427
+
428
+ clearDecreasePositionOrder = (
429
+ orderCapId: string,
430
+ collateralToken: string,
431
+ indexToken: string,
432
+ long: boolean,
433
+ tx: Transaction,
434
+ isV11Order = false,
435
+ ) => {
436
+ const funcName = isV11Order ? 'clear_decrease_position_order' : 'clear_decrease_position_order'
437
+ tx.moveCall({
438
+ target: `${this.consts.zoCore.package}::market::${funcName}`,
439
+ typeArguments: [
440
+ `${this.consts.zoCore.package}::zlp::ZLP`,
441
+ this.consts.coins[collateralToken].module,
442
+ this.consts.coins[indexToken].module,
443
+ `${this.consts.zoCore.package}::market::${long ? 'LONG' : 'SHORT'}`,
444
+ this.consts.coins.sui.module,
445
+ ],
446
+ arguments: [
447
+ tx.object(this.consts.zoCore.market),
448
+ tx.object(orderCapId),
449
+ ],
450
+ })
451
+ }
452
+
453
+ stake = (
454
+ coinObjects: string[],
455
+ amount: bigint,
456
+ pool: string,
457
+ tx?: Transaction | undefined,
458
+ ) => {
459
+ if (!tx) {
460
+ tx = new Transaction()
461
+ }
462
+ const coinObject = this.#processCoins(tx, 'zlp', coinObjects)
463
+ const [depositObject] = tx.splitCoins(coinObject, [tx.pure.u64(amount)])
464
+
465
+ tx.moveCall({
466
+ target: `${this.consts.zoStaking.package}::pool::deposit`,
467
+ typeArguments: [
468
+ `${this.consts.zoCore.package}::zlp::ZLP`,
469
+ this.consts.coins.sui.module,
470
+ ],
471
+ arguments: [
472
+ tx.object(pool),
473
+ tx.object(SUI_CLOCK_OBJECT_ID),
474
+ depositObject,
475
+ ],
476
+ })
477
+
478
+ return tx
479
+ }
480
+
481
+ unstake = (
482
+ credentials: ICredential[],
483
+ amount: bigint,
484
+ pool: string,
485
+ tx?: Transaction | undefined,
486
+ ) => {
487
+ if (!tx) {
488
+ tx = new Transaction()
489
+ }
490
+ for (const credential of credentials) {
491
+ // eslint-disable-next-line unicorn/prefer-math-min-max
492
+ const withdrawAmount = amount < credential.amount ? amount : credential.amount
493
+ amount -= withdrawAmount
494
+ tx.moveCall({
495
+ target: `0xdb353cb79a88d5ee83b7c0ca0249662a1facab17ba62879080ea3d61b9d21112::pool::withdraw`,
496
+ typeArguments: [
497
+ `${this.consts.zoCore.package}::zlp::ZLP`,
498
+ this.consts.coins.sui.module,
499
+ ],
500
+ arguments: [
501
+ tx.object(pool),
502
+ tx.object(SUI_CLOCK_OBJECT_ID),
503
+ tx.object(credential.id),
504
+ tx.pure.u64(withdrawAmount),
505
+ ],
506
+ })
507
+ if (credential.amount === BigInt(0)) {
508
+ tx.moveCall({
509
+ target: `${this.consts.zoStaking.package}::pool::clear_empty_credential`,
510
+ typeArguments: [
511
+ `${this.consts.zoCore.package}::zlp::ZLP`,
512
+ this.consts.coins.sui.module,
513
+ ],
514
+ arguments: [
515
+ tx.object(credential.id),
516
+ ],
517
+ })
518
+ }
519
+ }
520
+
521
+ return tx
522
+ }
523
+
524
+ addReferral = (
525
+ referrer: string,
526
+ tx?: Transaction | undefined,
527
+ ) => {
528
+ if (!tx) {
529
+ tx = new Transaction()
530
+ }
531
+ tx.moveCall({
532
+ target: `${this.consts.zoCore.package}::market::add_new_referral`,
533
+ typeArguments: [
534
+ `${this.consts.zoCore.package}::zlp::ZLP`,
535
+ ],
536
+ arguments: [
537
+ tx.object(this.consts.zoCore.market),
538
+ tx.object(referrer),
539
+ ],
540
+ })
541
+
542
+ return tx
543
+ }
544
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "zo_core": {
3
+ "package": "",
4
+ "upgrade_cap": "",
5
+ "admin_cap": "",
6
+ "market": "",
7
+ "zlp_metadata": "",
8
+ "rebase_fee_model": "",
9
+ "referrals_parent": "",
10
+ "vaults_parent": "",
11
+ "symbols_parent": "",
12
+ "positions_parent": "",
13
+ "orders_parent": "",
14
+ "vaults": {},
15
+ "symbols": {}
16
+ },
17
+ "pyth_feeder": {
18
+ "package": "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e",
19
+ "package_v2": "0x04e20ddf36af412a4096f9014f4a565af9e812db9a05cc40254846cf6ed0ad91",
20
+ "state": "0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8",
21
+ "wormhole": {
22
+ "package": "0x5306f64e312b581766351c07af79c72fcb1cd25147157fdc2f8ad76de9a3fb6a",
23
+ "state": "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c"
24
+ },
25
+ "feeder": {}
26
+ },
27
+ "coins": {}
28
+ }
@@ -0,0 +1,93 @@
1
+ {
2
+ "zo_core": {
3
+ "package": "0xa7d1d1f3a8346753674223473f6b71d6c8a6ca9475da0501368f57bb6d35cc0b",
4
+ "upgrade_cap": "0x7f6bb9305da4d35576be0ffd3b56c0085db46ba4b7ce8c0022f65b683c5ad5b4",
5
+ "admin_cap": "0x2d2ef02c1fd1ba0baf144e9f7a9d7365d50dff34e6f249be0e23ad01d7a1d700",
6
+ "market": "0xf6fb5acc78a6c85bfca39719088a7ac74ab199a58097bf8fe79df75ec5f535d1",
7
+ "zlp_metadata": "0xeb6eb4bd199cd4c0699855a5337fef75df05e0ee728ed507fed7041ecd8ed910",
8
+ "rebase_fee_model": "0x285d0c1f21858db319481ae35e1d6ad735c3176df7c3eef9b95b8deed24faf7d",
9
+ "referrals_parent": "0xcf63fb9086d2f3ed710d980f48da4443144225f1024f48debeba638072998345",
10
+ "vaults_parent": "0xa1ed162b3b9c545d2cc46224750bf76e22f55a12ddedc8eacd685930f1287da6",
11
+ "symbols_parent": "0xc73cc19cb9df994db7859638373279f678f7e837ba3f29f0e54029bcc9f7f376",
12
+ "positions_parent": "0x70c9c9cb6cfe9da0c730553a22281cb9c44c647d6a0d60a656b73e27eb08497d",
13
+ "orders_parent": "0xc62365fb575103f559c147fcac8379760faf68d91914e4e0ac296fbeb78c2905",
14
+ "vaults": {
15
+ "usdt": {
16
+ "weight": "1000000000000000000",
17
+ "reserving_fee_model": "0x095aa141f72af6045b0691773ca1da621bdd50de048f78226190627521c6bb99"
18
+ }
19
+ },
20
+ "symbols": {
21
+ "long_btc": {
22
+ "supported_collaterals": [
23
+ "usdt"
24
+ ],
25
+ "funding_fee_model": "0x13e2cf849c6bcbec5c2d95897359e956612dbfd9f6eac0f2f46f9954e725118a",
26
+ "position_config": "0x6a02e6e75dba447d7c2f59ac26ce94d33039a45c07b0180e50d0e67bb1ad3f43"
27
+ },
28
+ "short_btc": {
29
+ "supported_collaterals": [
30
+ "usdt"
31
+ ],
32
+ "funding_fee_model": "0x5a5ca35b5c6e997cff46b24137353d2df70365d801cab47f45eab113193a138f",
33
+ "position_config": "0x65b1d0f4f4c4d60e3f4670331f145d70f90cf3558280bc207dc369f38c8b40bb"
34
+ },
35
+ "long_eth": {
36
+ "supported_collaterals": [
37
+ "usdt"
38
+ ],
39
+ "funding_fee_model": "0xffcf6a37a465feff40e2f003dfb9c75875d9c66da520be8ab71a787af4d15fe9",
40
+ "position_config": "0x8fd32f908c4810d51cb088a5b147d5a5e0e463db252dbffc2fed8578077de35c"
41
+ },
42
+ "short_eth": {
43
+ "supported_collaterals": [
44
+ "usdt"
45
+ ],
46
+ "funding_fee_model": "0xe0a3468419ef07a4ec1a564b32971bdd301fb8a5a900b98280074d13914f0ec0",
47
+ "position_config": "0x1f499a262fa1d30c8177b2f887f2f5423ab4c33d9a5954606739743336673dac"
48
+ }
49
+ }
50
+ },
51
+ "pyth_feeder": {
52
+ "package": "0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837",
53
+ "state": "0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c",
54
+ "wormhole": {
55
+ "package": "0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94",
56
+ "state": "0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790"
57
+ },
58
+ "feeder": {
59
+ "btc": "0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba",
60
+ "sui": "0x1ebb295c789cc42b3b2a1606482cd1c7124076a0f5676718501fda8c7fd075a0",
61
+ "eth": "0x4fde30cb8a5dc3cfee1c1c358fc66dc308408827efb217247c7ba54d76ccbee9",
62
+ "sol": "0x33fbce1cad5ca155f2f5051430b23a694bc6e5de6df43e0f8aefe29f4a84336d",
63
+ "usdt": "0x956fdcbf83a26c962319f7742f5728a0a7ce59c7f0cbe13c112b259e7ee953cd"
64
+ }
65
+ },
66
+ "coins": {
67
+ "sui": {
68
+ "decimals": 9,
69
+ "module": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
70
+ "metadata": "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3"
71
+ },
72
+ "btc": {
73
+ "decimals": 6,
74
+ "module": "0x997965ea613857d34f13511fbe27f94728ab079615cd083ed24aef70516ab2e4::btc::BTC",
75
+ "metadata": "0xca50f9e2bae829ee73dc5079d3882298070b7b36451ec35f9455947163b4854e"
76
+ },
77
+ "eth": {
78
+ "decimals": 9,
79
+ "module": "0x0d3dd3ff9950dfbe34c52dbb552c36b618a3263f20f84309c9dfef7e140b6301::eth::ETH",
80
+ "metadata": "0x009c984d2d0c3afac3a598fd1ce77bb93740e8948e9665c7a7fe24046e129313"
81
+ },
82
+ "sol": {
83
+ "decimals": 9,
84
+ "module": "0x7eb2d1737cf4901218956dbd798f461a2606792da2df87b3c670e364ced35ce7::sol::SOL",
85
+ "metadata": "0xf77d6b54b007e45ea17ad9fa41821649e9ee16a9b14d3aabc2bb07b7874a90e9"
86
+ },
87
+ "usdt": {
88
+ "decimals": 6,
89
+ "module": "0x8684c115c57c725a832abe63b5cfa7268b77126a8a7a52883f602e5513c9de2d::usdt::USDT",
90
+ "metadata": "0xac3fcd1e6d7bd32d33afb1a0864b05b0adefeaddb2933ead5d5df1af21b1b741"
91
+ }
92
+ }
93
+ }