@triadxyz/triad-protocol 0.6.8-beta.devnet → 0.7.0-beta.devnet

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,5 @@
1
1
  {
2
- "address": "7nGGR51pBSUrpMPYVf9LWnNwaApz7N9VaJfDAJrihXts",
2
+ "address": "D6CzYj9FxGa8HeQeF1JYu9hDakEuEeMJkSG2awGPuCXG",
3
3
  "metadata": {
4
4
  "name": "triad_protocol",
5
5
  "version": "0.1.4",
@@ -125,19 +125,7 @@
125
125
  },
126
126
  {
127
127
  "name": "user_trade",
128
- "writable": true,
129
- "pda": {
130
- "seeds": [
131
- {
132
- "kind": "const",
133
- "value": [117, 115, 101, 114, 95, 116, 114, 97, 100, 101]
134
- },
135
- {
136
- "kind": "account",
137
- "path": "signer"
138
- }
139
- ]
140
- }
128
+ "writable": true
141
129
  },
142
130
  {
143
131
  "name": "market",
@@ -232,11 +220,6 @@
232
220
  "writable": true,
233
221
  "signer": true
234
222
  },
235
- {
236
- "name": "payer",
237
- "writable": true,
238
- "signer": true
239
- },
240
223
  {
241
224
  "name": "referral",
242
225
  "writable": true
@@ -257,6 +240,22 @@
257
240
  ]
258
241
  }
259
242
  },
243
+ {
244
+ "name": "user_trade",
245
+ "writable": true,
246
+ "pda": {
247
+ "seeds": [
248
+ {
249
+ "kind": "const",
250
+ "value": [117, 115, 101, 114, 95, 116, 114, 97, 100, 101]
251
+ },
252
+ {
253
+ "kind": "account",
254
+ "path": "signer"
255
+ }
256
+ ]
257
+ }
258
+ },
260
259
  {
261
260
  "name": "system_program",
262
261
  "address": "11111111111111111111111111111111"
@@ -282,6 +281,10 @@
282
281
  "writable": true,
283
282
  "signer": true
284
283
  },
284
+ {
285
+ "name": "user",
286
+ "writable": true
287
+ },
285
288
  {
286
289
  "name": "user_trade",
287
290
  "writable": true,
@@ -330,6 +333,10 @@
330
333
  ]
331
334
  }
332
335
  },
336
+ {
337
+ "name": "mint",
338
+ "writable": true
339
+ },
333
340
  {
334
341
  "name": "fee_vault",
335
342
  "writable": true,
@@ -340,52 +347,16 @@
340
347
  "value": [102, 101, 101, 95, 118, 97, 117, 108, 116]
341
348
  },
342
349
  {
343
- "kind": "account",
344
- "path": "market"
350
+ "kind": "arg",
351
+ "path": "args.market_id"
345
352
  }
346
353
  ]
347
354
  }
348
355
  },
349
- {
350
- "name": "fee_vault_ata",
351
- "writable": true,
352
- "pda": {
353
- "seeds": [
354
- {
355
- "kind": "account",
356
- "path": "fee_vault"
357
- },
358
- {
359
- "kind": "account",
360
- "path": "token_program"
361
- },
362
- {
363
- "kind": "account",
364
- "path": "mint"
365
- }
366
- ],
367
- "program": {
368
- "kind": "const",
369
- "value": [
370
- 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
371
- 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
372
- 219, 233, 248, 89
373
- ]
374
- }
375
- }
376
- },
377
- {
378
- "name": "mint",
379
- "writable": true
380
- },
381
356
  {
382
357
  "name": "token_program",
383
358
  "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
384
359
  },
385
- {
386
- "name": "associated_token_program",
387
- "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
388
- },
389
360
  {
390
361
  "name": "system_program",
391
362
  "address": "11111111111111111111111111111111"
@@ -413,19 +384,7 @@
413
384
  },
414
385
  {
415
386
  "name": "user_trade",
416
- "writable": true,
417
- "pda": {
418
- "seeds": [
419
- {
420
- "kind": "const",
421
- "value": [117, 115, 101, 114, 95, 116, 114, 97, 100, 101]
422
- },
423
- {
424
- "kind": "account",
425
- "path": "signer"
426
- }
427
- ]
428
- }
387
+ "writable": true
429
388
  },
430
389
  {
431
390
  "name": "market",
@@ -433,19 +392,7 @@
433
392
  },
434
393
  {
435
394
  "name": "fee_vault",
436
- "writable": true,
437
- "pda": {
438
- "seeds": [
439
- {
440
- "kind": "const",
441
- "value": [102, 101, 101, 95, 118, 97, 117, 108, 116]
442
- },
443
- {
444
- "kind": "account",
445
- "path": "market"
446
- }
447
- ]
448
- }
395
+ "writable": true
449
396
  },
450
397
  {
451
398
  "name": "mint",
@@ -453,31 +400,7 @@
453
400
  },
454
401
  {
455
402
  "name": "user_from_ata",
456
- "writable": true,
457
- "pda": {
458
- "seeds": [
459
- {
460
- "kind": "account",
461
- "path": "signer"
462
- },
463
- {
464
- "kind": "account",
465
- "path": "token_program"
466
- },
467
- {
468
- "kind": "account",
469
- "path": "mint"
470
- }
471
- ],
472
- "program": {
473
- "kind": "const",
474
- "value": [
475
- 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
476
- 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
477
- 219, 233, 248, 89
478
- ]
479
- }
480
- }
403
+ "writable": true
481
404
  },
482
405
  {
483
406
  "name": "market_to_ata",
@@ -1467,7 +1390,7 @@
1467
1390
  },
1468
1391
  {
1469
1392
  "name": "total_volume",
1470
- "docs": ["Total trading volume (in TRD)"],
1393
+ "docs": ["Total trading volume (in TRD) for all resolutions"],
1471
1394
  "type": "u64"
1472
1395
  },
1473
1396
  {
@@ -1497,7 +1420,7 @@
1497
1420
  {
1498
1421
  "name": "fee_bps",
1499
1422
  "docs": [
1500
- "Fees applied to trades (in basis points, e.g., 300 = 3%) but 2.869 for the protocol; 0.1 NFT Holders; 0.031 Market"
1423
+ "Fees applied to trades (in basis points, e.g., 1.131% fee)"
1501
1424
  ],
1502
1425
  "type": "u16"
1503
1426
  },
@@ -1515,6 +1438,48 @@
1515
1438
  "name": "is_official",
1516
1439
  "type": "bool"
1517
1440
  },
1441
+ {
1442
+ "name": "market_price",
1443
+ "type": "u64"
1444
+ },
1445
+ {
1446
+ "name": "resolved_questions",
1447
+ "type": {
1448
+ "array": [
1449
+ {
1450
+ "defined": {
1451
+ "name": "ResolvedQuestion"
1452
+ }
1453
+ },
1454
+ 4
1455
+ ]
1456
+ }
1457
+ },
1458
+ {
1459
+ "name": "current_question_id",
1460
+ "docs": [
1461
+ "Index of the current week in the weekly_results array initialized with default values"
1462
+ ],
1463
+ "type": "u64"
1464
+ },
1465
+ {
1466
+ "name": "current_question_start",
1467
+ "docs": [
1468
+ "Start timestamp of the current week if 7 days have passed since the start of the week"
1469
+ ],
1470
+ "type": "i64"
1471
+ },
1472
+ {
1473
+ "name": "current_question_end",
1474
+ "type": "i64"
1475
+ },
1476
+ {
1477
+ "name": "current_question",
1478
+ "docs": ["The question or prediction topic for the current week"],
1479
+ "type": {
1480
+ "array": ["u8", 120]
1481
+ }
1482
+ },
1518
1483
  {
1519
1484
  "name": "padding",
1520
1485
  "type": {
@@ -1541,20 +1506,6 @@
1541
1506
  }
1542
1507
  }
1543
1508
  },
1544
- {
1545
- "name": "order_type",
1546
- "type": {
1547
- "defined": {
1548
- "name": "OrderType"
1549
- }
1550
- }
1551
- },
1552
- {
1553
- "name": "limit_price",
1554
- "type": {
1555
- "option": "u64"
1556
- }
1557
- },
1558
1509
  {
1559
1510
  "name": "comment",
1560
1511
  "type": {
@@ -1579,6 +1530,10 @@
1579
1530
  "name": "order_id",
1580
1531
  "type": "u64"
1581
1532
  },
1533
+ {
1534
+ "name": "question_id",
1535
+ "type": "u64"
1536
+ },
1582
1537
  {
1583
1538
  "name": "market_id",
1584
1539
  "type": "u64"
@@ -1601,10 +1556,7 @@
1601
1556
  },
1602
1557
  {
1603
1558
  "name": "total_amount",
1604
- "docs": [
1605
- "The total amount of TRD committed to this order",
1606
- "precision: QUOTE_PRECISION"
1607
- ],
1559
+ "docs": ["The total amount of TRD committed to this order"],
1608
1560
  "type": "u64"
1609
1561
  },
1610
1562
  {
@@ -1612,19 +1564,6 @@
1612
1564
  "docs": ["The total number of shares to be purchased"],
1613
1565
  "type": "u64"
1614
1566
  },
1615
- {
1616
- "name": "filled_amount",
1617
- "docs": [
1618
- "The amount of TRD that has been filled",
1619
- "precision: QUOTE_PRECISION"
1620
- ],
1621
- "type": "u64"
1622
- },
1623
- {
1624
- "name": "filled_shares",
1625
- "docs": ["The number of shares that have been filled"],
1626
- "type": "u64"
1627
- },
1628
1567
  {
1629
1568
  "name": "order_type",
1630
1569
  "type": {
@@ -1642,17 +1581,16 @@
1642
1581
  }
1643
1582
  },
1644
1583
  {
1645
- "name": "settled_pnl",
1584
+ "name": "pnl",
1646
1585
  "docs": [
1647
- "The amount of pnl settled in this market since opening the position (in TRD)",
1648
- "precision: QUOTE_PRECISION"
1586
+ "The amount of pnl settled in this market since opening the position (in TRD)"
1649
1587
  ],
1650
1588
  "type": "i64"
1651
1589
  },
1652
1590
  {
1653
1591
  "name": "padding",
1654
1592
  "type": {
1655
- "array": ["u8", 16]
1593
+ "array": ["u8", 32]
1656
1594
  }
1657
1595
  }
1658
1596
  ]
@@ -1683,12 +1621,6 @@
1683
1621
  {
1684
1622
  "name": "Open"
1685
1623
  },
1686
- {
1687
- "name": "Filled"
1688
- },
1689
- {
1690
- "name": "Canceled"
1691
- },
1692
1624
  {
1693
1625
  "name": "Closed"
1694
1626
  }
@@ -1701,10 +1633,10 @@
1701
1633
  "kind": "enum",
1702
1634
  "variants": [
1703
1635
  {
1704
- "name": "Limit"
1636
+ "name": "Market"
1705
1637
  },
1706
1638
  {
1707
- "name": "Market"
1639
+ "name": "Limit"
1708
1640
  }
1709
1641
  ]
1710
1642
  }
@@ -1722,6 +1654,10 @@
1722
1654
  "name": "market_id",
1723
1655
  "type": "u64"
1724
1656
  },
1657
+ {
1658
+ "name": "question_id",
1659
+ "type": "u64"
1660
+ },
1725
1661
  {
1726
1662
  "name": "order_id",
1727
1663
  "type": "u64"
@@ -1758,18 +1694,10 @@
1758
1694
  "name": "total_shares",
1759
1695
  "type": "u64"
1760
1696
  },
1761
- {
1762
- "name": "filled_shares",
1763
- "type": "u64"
1764
- },
1765
1697
  {
1766
1698
  "name": "total_amount",
1767
1699
  "type": "u64"
1768
1700
  },
1769
- {
1770
- "name": "filled_amount",
1771
- "type": "u64"
1772
- },
1773
1701
  {
1774
1702
  "name": "comment",
1775
1703
  "type": {
@@ -1784,9 +1712,19 @@
1784
1712
  "option": "u64"
1785
1713
  }
1786
1714
  },
1715
+ {
1716
+ "name": "pnl",
1717
+ "type": "i64"
1718
+ },
1787
1719
  {
1788
1720
  "name": "timestamp",
1789
1721
  "type": "i64"
1722
+ },
1723
+ {
1724
+ "name": "is_question_winner",
1725
+ "type": {
1726
+ "option": "bool"
1727
+ }
1790
1728
  }
1791
1729
  ]
1792
1730
  }
@@ -1835,6 +1773,70 @@
1835
1773
  ]
1836
1774
  }
1837
1775
  },
1776
+ {
1777
+ "name": "ResolvedQuestion",
1778
+ "type": {
1779
+ "kind": "struct",
1780
+ "fields": [
1781
+ {
1782
+ "name": "question",
1783
+ "docs": ["The question or prediction topic for this week"],
1784
+ "type": {
1785
+ "array": ["u8", 120]
1786
+ }
1787
+ },
1788
+ {
1789
+ "name": "start_time",
1790
+ "docs": ["Start timestamp of the week"],
1791
+ "type": "i64"
1792
+ },
1793
+ {
1794
+ "name": "end_time",
1795
+ "docs": ["End timestamp of the week"],
1796
+ "type": "i64"
1797
+ },
1798
+ {
1799
+ "name": "hype_liquidity",
1800
+ "docs": ["Total liquidity for Hype (in TRD)"],
1801
+ "type": "u64"
1802
+ },
1803
+ {
1804
+ "name": "flop_liquidity",
1805
+ "docs": ["Total liquidity for Flop (in TRD)"],
1806
+ "type": "u64"
1807
+ },
1808
+ {
1809
+ "name": "winning_direction",
1810
+ "docs": ["The winning direction (Hype, Flop or None)"],
1811
+ "type": {
1812
+ "defined": {
1813
+ "name": "WinningDirection"
1814
+ }
1815
+ }
1816
+ },
1817
+ {
1818
+ "name": "market_price",
1819
+ "type": "u64"
1820
+ },
1821
+ {
1822
+ "name": "final_hype_price",
1823
+ "docs": ["Final price for Hype outcome at the end of the week"],
1824
+ "type": "u64"
1825
+ },
1826
+ {
1827
+ "name": "final_flop_price",
1828
+ "docs": ["Final price for Flop outcome at the end of the week"],
1829
+ "type": "u64"
1830
+ },
1831
+ {
1832
+ "name": "padding",
1833
+ "type": {
1834
+ "array": ["u8", 100]
1835
+ }
1836
+ }
1837
+ ]
1838
+ }
1839
+ },
1838
1840
  {
1839
1841
  "name": "StakeNFTArgs",
1840
1842
  "type": {
@@ -2111,14 +2113,9 @@
2111
2113
  "type": "u64"
2112
2114
  },
2113
2115
  {
2114
- "name": "open_orders",
2115
- "docs": ["Number of open orders"],
2116
- "type": "u8"
2117
- },
2118
- {
2119
- "name": "has_open_order",
2120
- "docs": ["Whether or not user has open order"],
2121
- "type": "bool"
2116
+ "name": "opened_orders",
2117
+ "docs": ["The number of orders the user has opened"],
2118
+ "type": "u64"
2122
2119
  },
2123
2120
  {
2124
2121
  "name": "orders",
@@ -2133,18 +2130,31 @@
2133
2130
  ]
2134
2131
  }
2135
2132
  },
2136
- {
2137
- "name": "position",
2138
- "type": "i64"
2139
- },
2140
2133
  {
2141
2134
  "name": "padding",
2142
2135
  "type": {
2143
- "array": ["u8", 64]
2136
+ "array": ["u8", 32]
2144
2137
  }
2145
2138
  }
2146
2139
  ]
2147
2140
  }
2141
+ },
2142
+ {
2143
+ "name": "WinningDirection",
2144
+ "type": {
2145
+ "kind": "enum",
2146
+ "variants": [
2147
+ {
2148
+ "name": "Hype"
2149
+ },
2150
+ {
2151
+ "name": "Flop"
2152
+ },
2153
+ {
2154
+ "name": "None"
2155
+ }
2156
+ ]
2157
+ }
2148
2158
  }
2149
2159
  ]
2150
2160
  }
@@ -8,3 +8,13 @@ export type CreateUserArgs = {
8
8
  name: string;
9
9
  referral?: PublicKey;
10
10
  };
11
+ export type User = {
12
+ ts: number;
13
+ authority: string;
14
+ referral: string;
15
+ referred: number;
16
+ name: string;
17
+ swapsMade: number;
18
+ swaps: number;
19
+ staked: number;
20
+ };
@@ -64,14 +64,7 @@ export declare enum RARITY_WEIGHT {
64
64
  LEGENDARY = 5,
65
65
  MYTHIC = 6
66
66
  }
67
- export declare enum COLLECTION_MUlTIPLIER {
68
- ALLIGATORS = 1.5,
69
- COLETA = 1.5,
70
- UNDEAD = 1.5,
71
- UNDEAD_TRIADFI = 2.5,
72
- PYTH = 1.5
73
- }
74
- export type StakeVaultResponse = {
67
+ export type StakeVault = {
75
68
  name: string;
76
69
  collection: string;
77
70
  authority: string;
@@ -87,7 +80,7 @@ export type StakeVaultResponse = {
87
80
  initTs: number;
88
81
  endTs: number;
89
82
  };
90
- export type StakeResponse = {
83
+ export type Stake = {
91
84
  name: string;
92
85
  stakeVault: string;
93
86
  authority: string;
@@ -100,13 +93,3 @@ export type StakeResponse = {
100
93
  available: number;
101
94
  amount: number;
102
95
  };
103
- export type UserResponse = {
104
- ts: number;
105
- authority: string;
106
- referral: string;
107
- referred: number;
108
- name: string;
109
- swapsMade: number;
110
- swaps: number;
111
- staked: number;
112
- };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COLLECTION_MUlTIPLIER = exports.RARITY_WEIGHT = void 0;
3
+ exports.RARITY_WEIGHT = void 0;
4
4
  var RARITY_WEIGHT;
5
5
  (function (RARITY_WEIGHT) {
6
6
  RARITY_WEIGHT[RARITY_WEIGHT["COMMON"] = 1] = "COMMON";
@@ -10,11 +10,3 @@ var RARITY_WEIGHT;
10
10
  RARITY_WEIGHT[RARITY_WEIGHT["LEGENDARY"] = 5] = "LEGENDARY";
11
11
  RARITY_WEIGHT[RARITY_WEIGHT["MYTHIC"] = 6] = "MYTHIC";
12
12
  })(RARITY_WEIGHT || (exports.RARITY_WEIGHT = RARITY_WEIGHT = {}));
13
- var COLLECTION_MUlTIPLIER;
14
- (function (COLLECTION_MUlTIPLIER) {
15
- COLLECTION_MUlTIPLIER[COLLECTION_MUlTIPLIER["ALLIGATORS"] = 1.5] = "ALLIGATORS";
16
- COLLECTION_MUlTIPLIER[COLLECTION_MUlTIPLIER["COLETA"] = 1.5] = "COLETA";
17
- COLLECTION_MUlTIPLIER[COLLECTION_MUlTIPLIER["UNDEAD"] = 1.5] = "UNDEAD";
18
- COLLECTION_MUlTIPLIER[COLLECTION_MUlTIPLIER["UNDEAD_TRIADFI"] = 2.5] = "UNDEAD_TRIADFI";
19
- COLLECTION_MUlTIPLIER[COLLECTION_MUlTIPLIER["PYTH"] = 1.5] = "PYTH";
20
- })(COLLECTION_MUlTIPLIER || (exports.COLLECTION_MUlTIPLIER = COLLECTION_MUlTIPLIER = {}));
@@ -2,23 +2,24 @@ export type Market = {
2
2
  address: string;
3
3
  bump: number;
4
4
  authority: string;
5
- marketId: number;
5
+ marketId: string;
6
6
  name: string;
7
- hypePrice: number;
8
- flopPrice: number;
9
- hypeLiquidity: number;
10
- flopLiquidity: number;
11
- totalHypeShares: number;
12
- totalFlopShares: number;
13
- totalVolume: number;
7
+ hypePrice: string;
8
+ flopPrice: string;
9
+ hypeLiquidity: string;
10
+ flopLiquidity: string;
11
+ totalHypeShares: string;
12
+ totalFlopShares: string;
13
+ totalVolume: string;
14
14
  mint: string;
15
- ts: number;
16
- updateTs: number;
17
- openOrdersCount: number;
18
- nextOrderId: number;
15
+ ts: string;
16
+ updateTs: string;
17
+ openOrdersCount: string;
18
+ nextOrderId: string;
19
19
  feeBps: number;
20
20
  feeVault: string;
21
21
  isActive: boolean;
22
+ marketPrice: string;
22
23
  isOfficial: boolean;
23
24
  };
24
25
  export type OrderDirection = {