@triadxyz/triad-protocol 1.6.6-beta → 1.6.7-beta-dev

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,3 +1,4 @@
1
+ import { PublicKey } from '@solana/web3.js';
1
2
  export type Market = {
2
3
  address: string;
3
4
  bump: number;
@@ -65,17 +66,31 @@ export type OrderStatus = {
65
66
  open: {};
66
67
  } | {
67
68
  closed: {};
69
+ } | {
70
+ claimed: {};
71
+ } | {
72
+ liquidated: {};
73
+ } | {
74
+ waiting: {};
68
75
  };
69
76
  export type OrderType = {
70
77
  limit: {};
71
78
  } | {
72
79
  market: {};
73
80
  };
74
- export type OpenOrderArgs = {
81
+ export type OrderSide = {
82
+ bid: {};
83
+ } | {
84
+ ask: {};
85
+ };
86
+ export type PlaceOrderArgs = {
75
87
  marketId: number;
76
88
  amount: number;
89
+ price: number;
77
90
  direction: OrderDirection;
78
- token: string;
91
+ orderType: OrderType;
92
+ orderSide: OrderSide;
93
+ mint: PublicKey;
79
94
  };
80
95
  export type InitializeMarketArgs = {
81
96
  marketId: number;
@@ -5,7 +5,7 @@
5
5
  * IDL can be found at `target/idl/triad_protocol.json`.
6
6
  */
7
7
  export type TriadProtocol = {
8
- address: 'TRDwq3BN4mP3m9KsuNUWSN6QDff93VKGSwE95Jbr9Ss';
8
+ address: '9acY2YXu8oyHETTuDPWie4eB7WoSw9YxNnWUUVHktgs1';
9
9
  metadata: {
10
10
  name: 'triadProtocol';
11
11
  version: '0.1.4';
@@ -75,8 +75,8 @@ export type TriadProtocol = {
75
75
  args: [];
76
76
  },
77
77
  {
78
- name: 'claimStakeRewards';
79
- discriminator: [107, 91, 233, 196, 211, 47, 218, 21];
78
+ name: 'cancelOrder';
79
+ discriminator: [95, 129, 237, 240, 8, 49, 223, 132];
80
80
  accounts: [
81
81
  {
82
82
  name: 'signer';
@@ -84,16 +84,11 @@ export type TriadProtocol = {
84
84
  signer: true;
85
85
  },
86
86
  {
87
- name: 'verifier';
88
- writable: true;
89
- signer: true;
90
- },
91
- {
92
- name: 'stakeVault';
87
+ name: 'userTrade';
93
88
  writable: true;
94
89
  },
95
90
  {
96
- name: 'stake';
91
+ name: 'market';
97
92
  writable: true;
98
93
  },
99
94
  {
@@ -101,13 +96,13 @@ export type TriadProtocol = {
101
96
  writable: true;
102
97
  },
103
98
  {
104
- name: 'fromAta';
99
+ name: 'userAta';
105
100
  writable: true;
106
101
  pda: {
107
102
  seeds: [
108
103
  {
109
104
  kind: 'account';
110
- path: 'stakeVault';
105
+ path: 'signer';
111
106
  },
112
107
  {
113
108
  kind: 'account';
@@ -158,13 +153,13 @@ export type TriadProtocol = {
158
153
  };
159
154
  },
160
155
  {
161
- name: 'toAta';
156
+ name: 'marketVault';
162
157
  writable: true;
163
158
  pda: {
164
159
  seeds: [
165
160
  {
166
161
  kind: 'account';
167
- path: 'signer';
162
+ path: 'market';
168
163
  },
169
164
  {
170
165
  kind: 'account';
@@ -216,7 +211,6 @@ export type TriadProtocol = {
216
211
  },
217
212
  {
218
213
  name: 'tokenProgram';
219
- address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
220
214
  },
221
215
  {
222
216
  name: 'associatedTokenProgram';
@@ -229,19 +223,14 @@ export type TriadProtocol = {
229
223
  ];
230
224
  args: [
231
225
  {
232
- name: 'args';
233
- type: {
234
- defined: {
235
- name: 'claimStakeRewardsArgs';
236
- };
237
- };
226
+ name: 'orderId';
227
+ type: 'u64';
238
228
  }
239
229
  ];
240
- returns: 'u64';
241
230
  },
242
231
  {
243
- name: 'claimWheelToken';
244
- discriminator: [34, 238, 160, 232, 58, 155, 177, 168];
232
+ name: 'claimStakeRewards';
233
+ discriminator: [107, 91, 233, 196, 211, 47, 218, 21];
245
234
  accounts: [
246
235
  {
247
236
  name: 'signer';
@@ -254,20 +243,12 @@ export type TriadProtocol = {
254
243
  signer: true;
255
244
  },
256
245
  {
257
- name: 'wheel';
246
+ name: 'stakeVault';
247
+ writable: true;
248
+ },
249
+ {
250
+ name: 'stake';
258
251
  writable: true;
259
- pda: {
260
- seeds: [
261
- {
262
- kind: 'const';
263
- value: [119, 104, 101, 108, 108];
264
- },
265
- {
266
- kind: 'arg';
267
- path: 'args.name';
268
- }
269
- ];
270
- };
271
252
  },
272
253
  {
273
254
  name: 'mint';
@@ -280,7 +261,7 @@ export type TriadProtocol = {
280
261
  seeds: [
281
262
  {
282
263
  kind: 'account';
283
- path: 'wheel';
264
+ path: 'stakeVault';
284
265
  },
285
266
  {
286
267
  kind: 'account';
@@ -405,15 +386,16 @@ export type TriadProtocol = {
405
386
  name: 'args';
406
387
  type: {
407
388
  defined: {
408
- name: 'claimWheelTokenArgs';
389
+ name: 'claimStakeRewardsArgs';
409
390
  };
410
391
  };
411
392
  }
412
393
  ];
394
+ returns: 'u64';
413
395
  },
414
396
  {
415
- name: 'closeOrder';
416
- discriminator: [90, 103, 209, 28, 7, 63, 168, 4];
397
+ name: 'claimWheelToken';
398
+ discriminator: [34, 238, 160, 232, 58, 155, 177, 168];
417
399
  accounts: [
418
400
  {
419
401
  name: 'signer';
@@ -421,30 +403,38 @@ export type TriadProtocol = {
421
403
  signer: true;
422
404
  },
423
405
  {
424
- name: 'squads';
425
- writable: true;
426
- address: '6fcSf6qfwPNR9AUUNC1UWYZDy5cQ4TzTb2aaipN2zFdq';
427
- },
428
- {
429
- name: 'userTrade';
406
+ name: 'verifier';
430
407
  writable: true;
408
+ signer: true;
431
409
  },
432
410
  {
433
- name: 'market';
411
+ name: 'wheel';
434
412
  writable: true;
413
+ pda: {
414
+ seeds: [
415
+ {
416
+ kind: 'const';
417
+ value: [119, 104, 101, 108, 108];
418
+ },
419
+ {
420
+ kind: 'arg';
421
+ path: 'args.name';
422
+ }
423
+ ];
424
+ };
435
425
  },
436
426
  {
437
427
  name: 'mint';
438
428
  writable: true;
439
429
  },
440
430
  {
441
- name: 'userAta';
431
+ name: 'fromAta';
442
432
  writable: true;
443
433
  pda: {
444
434
  seeds: [
445
435
  {
446
436
  kind: 'account';
447
- path: 'signer';
437
+ path: 'wheel';
448
438
  },
449
439
  {
450
440
  kind: 'account';
@@ -495,13 +485,13 @@ export type TriadProtocol = {
495
485
  };
496
486
  },
497
487
  {
498
- name: 'marketVault';
488
+ name: 'toAta';
499
489
  writable: true;
500
490
  pda: {
501
491
  seeds: [
502
492
  {
503
493
  kind: 'account';
504
- path: 'market';
494
+ path: 'signer';
505
495
  },
506
496
  {
507
497
  kind: 'account';
@@ -566,8 +556,12 @@ export type TriadProtocol = {
566
556
  ];
567
557
  args: [
568
558
  {
569
- name: 'orderId';
570
- type: 'u64';
559
+ name: 'args';
560
+ type: {
561
+ defined: {
562
+ name: 'claimWheelTokenArgs';
563
+ };
564
+ };
571
565
  }
572
566
  ];
573
567
  },
@@ -709,7 +703,6 @@ export type TriadProtocol = {
709
703
  },
710
704
  {
711
705
  name: 'tokenProgram';
712
- address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
713
706
  },
714
707
  {
715
708
  name: 'associatedTokenProgram';
@@ -920,7 +913,6 @@ export type TriadProtocol = {
920
913
  },
921
914
  {
922
915
  name: 'tokenProgram';
923
- address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
924
916
  },
925
917
  {
926
918
  name: 'associatedTokenProgram';
@@ -943,8 +935,8 @@ export type TriadProtocol = {
943
935
  ];
944
936
  },
945
937
  {
946
- name: 'openOrder';
947
- discriminator: [206, 88, 88, 143, 38, 136, 50, 224];
938
+ name: 'payoutOrder';
939
+ discriminator: [247, 233, 158, 228, 63, 32, 236, 113];
948
940
  accounts: [
949
941
  {
950
942
  name: 'signer';
@@ -969,7 +961,7 @@ export type TriadProtocol = {
969
961
  writable: true;
970
962
  },
971
963
  {
972
- name: 'userFromAta';
964
+ name: 'userAta';
973
965
  writable: true;
974
966
  pda: {
975
967
  seeds: [
@@ -1026,7 +1018,7 @@ export type TriadProtocol = {
1026
1018
  };
1027
1019
  },
1028
1020
  {
1029
- name: 'marketToAta';
1021
+ name: 'marketVault';
1030
1022
  writable: true;
1031
1023
  pda: {
1032
1024
  seeds: [
@@ -1084,7 +1076,6 @@ export type TriadProtocol = {
1084
1076
  },
1085
1077
  {
1086
1078
  name: 'tokenProgram';
1087
- address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
1088
1079
  },
1089
1080
  {
1090
1081
  name: 'associatedTokenProgram';
@@ -1097,18 +1088,14 @@ export type TriadProtocol = {
1097
1088
  ];
1098
1089
  args: [
1099
1090
  {
1100
- name: 'args';
1101
- type: {
1102
- defined: {
1103
- name: 'openOrderArgs';
1104
- };
1105
- };
1091
+ name: 'orderId';
1092
+ type: 'u64';
1106
1093
  }
1107
1094
  ];
1108
1095
  },
1109
1096
  {
1110
- name: 'payoutOrder';
1111
- discriminator: [247, 233, 158, 228, 63, 32, 236, 113];
1097
+ name: 'placeOrder';
1098
+ discriminator: [51, 194, 155, 175, 109, 130, 96, 106];
1112
1099
  accounts: [
1113
1100
  {
1114
1101
  name: 'signer';
@@ -1133,7 +1120,7 @@ export type TriadProtocol = {
1133
1120
  writable: true;
1134
1121
  },
1135
1122
  {
1136
- name: 'userAta';
1123
+ name: 'userFromAta';
1137
1124
  writable: true;
1138
1125
  pda: {
1139
1126
  seeds: [
@@ -1190,7 +1177,7 @@ export type TriadProtocol = {
1190
1177
  };
1191
1178
  },
1192
1179
  {
1193
- name: 'marketVault';
1180
+ name: 'marketToAta';
1194
1181
  writable: true;
1195
1182
  pda: {
1196
1183
  seeds: [
@@ -1248,7 +1235,6 @@ export type TriadProtocol = {
1248
1235
  },
1249
1236
  {
1250
1237
  name: 'tokenProgram';
1251
- address: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';
1252
1238
  },
1253
1239
  {
1254
1240
  name: 'associatedTokenProgram';
@@ -1261,8 +1247,12 @@ export type TriadProtocol = {
1261
1247
  ];
1262
1248
  args: [
1263
1249
  {
1264
- name: 'orderId';
1265
- type: 'u64';
1250
+ name: 'args';
1251
+ type: {
1252
+ defined: {
1253
+ name: 'placeOrderArgs';
1254
+ };
1255
+ };
1266
1256
  }
1267
1257
  ];
1268
1258
  },
@@ -2102,11 +2092,6 @@ export type TriadProtocol = {
2102
2092
  writable: true;
2103
2093
  signer: true;
2104
2094
  },
2105
- {
2106
- name: 'squads';
2107
- writable: true;
2108
- address: '6fcSf6qfwPNR9AUUNC1UWYZDy5cQ4TzTb2aaipN2zFdq';
2109
- },
2110
2095
  {
2111
2096
  name: 'nft';
2112
2097
  writable: true;
@@ -2704,6 +2689,10 @@ export type TriadProtocol = {
2704
2689
  type: {
2705
2690
  kind: 'struct';
2706
2691
  fields: [
2692
+ {
2693
+ name: 'authority';
2694
+ type: 'pubkey';
2695
+ },
2707
2696
  {
2708
2697
  name: 'marketId';
2709
2698
  type: 'u64';
@@ -2736,6 +2725,10 @@ export type TriadProtocol = {
2736
2725
  name: 'volume';
2737
2726
  type: 'u64';
2738
2727
  },
2728
+ {
2729
+ name: 'mint';
2730
+ type: 'pubkey';
2731
+ },
2739
2732
  {
2740
2733
  name: 'updateTs';
2741
2734
  type: 'i64';
@@ -2749,12 +2742,12 @@ export type TriadProtocol = {
2749
2742
  type: 'u64';
2750
2743
  },
2751
2744
  {
2752
- name: 'winningDirection';
2753
- type: {
2754
- defined: {
2755
- name: 'winningDirection';
2756
- };
2757
- };
2745
+ name: 'feeBps';
2746
+ type: 'u16';
2747
+ },
2748
+ {
2749
+ name: 'isAllowedToPayout';
2750
+ type: 'bool';
2758
2751
  },
2759
2752
  {
2760
2753
  name: 'marketStart';
@@ -2765,8 +2758,18 @@ export type TriadProtocol = {
2765
2758
  type: 'i64';
2766
2759
  },
2767
2760
  {
2768
- name: 'isAllowedToPayout';
2769
- type: 'bool';
2761
+ name: 'question';
2762
+ type: {
2763
+ array: ['u8', 80];
2764
+ };
2765
+ },
2766
+ {
2767
+ name: 'winningDirection';
2768
+ type: {
2769
+ defined: {
2770
+ name: 'winningDirection';
2771
+ };
2772
+ };
2770
2773
  },
2771
2774
  {
2772
2775
  name: 'marketLiquidityAtStart';
@@ -2902,26 +2905,6 @@ export type TriadProtocol = {
2902
2905
  fields: [];
2903
2906
  };
2904
2907
  },
2905
- {
2906
- name: 'openOrderArgs';
2907
- type: {
2908
- kind: 'struct';
2909
- fields: [
2910
- {
2911
- name: 'amount';
2912
- type: 'u64';
2913
- },
2914
- {
2915
- name: 'direction';
2916
- type: {
2917
- defined: {
2918
- name: 'orderDirection';
2919
- };
2920
- };
2921
- }
2922
- ];
2923
- };
2924
- },
2925
2908
  {
2926
2909
  name: 'order';
2927
2910
  type: {
@@ -2936,7 +2919,7 @@ export type TriadProtocol = {
2936
2919
  type: 'u64';
2937
2920
  },
2938
2921
  {
2939
- name: 'questionId';
2922
+ name: 'filledShares';
2940
2923
  type: 'u64';
2941
2924
  },
2942
2925
  {
@@ -2953,17 +2936,14 @@ export type TriadProtocol = {
2953
2936
  },
2954
2937
  {
2955
2938
  name: 'price';
2956
- docs: ['The price of the order (in TRD)'];
2957
2939
  type: 'u64';
2958
2940
  },
2959
2941
  {
2960
2942
  name: 'totalAmount';
2961
- docs: ['The total amount of TRD committed to this order'];
2962
2943
  type: 'u64';
2963
2944
  },
2964
2945
  {
2965
2946
  name: 'totalShares';
2966
- docs: ['The total number of shares to be purchased'];
2967
2947
  type: 'u64';
2968
2948
  },
2969
2949
  {
@@ -2975,7 +2955,7 @@ export type TriadProtocol = {
2975
2955
  };
2976
2956
  },
2977
2957
  {
2978
- name: 'direction';
2958
+ name: 'orderDirection';
2979
2959
  type: {
2980
2960
  defined: {
2981
2961
  name: 'orderDirection';
@@ -2986,10 +2966,18 @@ export type TriadProtocol = {
2986
2966
  name: 'userNonce';
2987
2967
  type: 'u32';
2988
2968
  },
2969
+ {
2970
+ name: 'orderSide';
2971
+ type: {
2972
+ defined: {
2973
+ name: 'orderSide';
2974
+ };
2975
+ };
2976
+ },
2989
2977
  {
2990
2978
  name: 'padding';
2991
2979
  type: {
2992
- array: ['u8', 28];
2980
+ array: ['u8', 27];
2993
2981
  };
2994
2982
  }
2995
2983
  ];
@@ -3023,7 +3011,7 @@ export type TriadProtocol = {
3023
3011
  type: 'u64';
3024
3012
  },
3025
3013
  {
3026
- name: 'questionId';
3014
+ name: 'filledShares';
3027
3015
  type: 'u64';
3028
3016
  },
3029
3017
  {
@@ -3031,13 +3019,21 @@ export type TriadProtocol = {
3031
3019
  type: 'u64';
3032
3020
  },
3033
3021
  {
3034
- name: 'direction';
3022
+ name: 'orderDirection';
3035
3023
  type: {
3036
3024
  defined: {
3037
3025
  name: 'orderDirection';
3038
3026
  };
3039
3027
  };
3040
3028
  },
3029
+ {
3030
+ name: 'orderSide';
3031
+ type: {
3032
+ defined: {
3033
+ name: 'orderSide';
3034
+ };
3035
+ };
3036
+ },
3041
3037
  {
3042
3038
  name: 'orderType';
3043
3039
  type: {
@@ -3080,12 +3076,6 @@ export type TriadProtocol = {
3080
3076
  name: 'timestamp';
3081
3077
  type: 'i64';
3082
3078
  },
3083
- {
3084
- name: 'isQuestionWinner';
3085
- type: {
3086
- option: 'bool';
3087
- };
3088
- },
3089
3079
  {
3090
3080
  name: 'userNonce';
3091
3081
  type: 'u32';
@@ -3093,6 +3083,20 @@ export type TriadProtocol = {
3093
3083
  ];
3094
3084
  };
3095
3085
  },
3086
+ {
3087
+ name: 'orderSide';
3088
+ type: {
3089
+ kind: 'enum';
3090
+ variants: [
3091
+ {
3092
+ name: 'bid';
3093
+ },
3094
+ {
3095
+ name: 'ask';
3096
+ }
3097
+ ];
3098
+ };
3099
+ },
3096
3100
  {
3097
3101
  name: 'orderStatus';
3098
3102
  type: {
@@ -3112,6 +3116,9 @@ export type TriadProtocol = {
3112
3116
  },
3113
3117
  {
3114
3118
  name: 'liquidated';
3119
+ },
3120
+ {
3121
+ name: 'waiting';
3115
3122
  }
3116
3123
  ];
3117
3124
  };
@@ -3130,6 +3137,46 @@ export type TriadProtocol = {
3130
3137
  ];
3131
3138
  };
3132
3139
  },
3140
+ {
3141
+ name: 'placeOrderArgs';
3142
+ type: {
3143
+ kind: 'struct';
3144
+ fields: [
3145
+ {
3146
+ name: 'amount';
3147
+ type: 'u64';
3148
+ },
3149
+ {
3150
+ name: 'price';
3151
+ type: 'u64';
3152
+ },
3153
+ {
3154
+ name: 'orderDirection';
3155
+ type: {
3156
+ defined: {
3157
+ name: 'orderDirection';
3158
+ };
3159
+ };
3160
+ },
3161
+ {
3162
+ name: 'orderSide';
3163
+ type: {
3164
+ defined: {
3165
+ name: 'orderSide';
3166
+ };
3167
+ };
3168
+ },
3169
+ {
3170
+ name: 'orderType';
3171
+ type: {
3172
+ defined: {
3173
+ name: 'orderType';
3174
+ };
3175
+ };
3176
+ }
3177
+ ];
3178
+ };
3179
+ },
3133
3180
  {
3134
3181
  name: 'priceEvent';
3135
3182
  type: {
@@ -3504,23 +3551,14 @@ export type TriadProtocol = {
3504
3551
  },
3505
3552
  {
3506
3553
  name: 'totalDeposits';
3507
- docs: [
3508
- 'The total value of deposits the user has made (in TRD)',
3509
- 'precision: QUOTE_PRECISION'
3510
- ];
3511
3554
  type: 'u64';
3512
3555
  },
3513
3556
  {
3514
3557
  name: 'totalWithdraws';
3515
- docs: [
3516
- 'The total value of withdrawals the user has made (in TRD)',
3517
- 'precision: QUOTE_PRECISION'
3518
- ];
3519
3558
  type: 'u64';
3520
3559
  },
3521
3560
  {
3522
3561
  name: 'openedOrders';
3523
- docs: ['The number of orders the user has opened'];
3524
3562
  type: 'u64';
3525
3563
  },
3526
3564
  {
@@ -3544,10 +3582,14 @@ export type TriadProtocol = {
3544
3582
  name: 'isSubUser';
3545
3583
  type: 'bool';
3546
3584
  },
3585
+ {
3586
+ name: 'poseidon';
3587
+ type: 'u16';
3588
+ },
3547
3589
  {
3548
3590
  name: 'padding';
3549
3591
  type: {
3550
- array: ['u8', 27];
3592
+ array: ['u8', 25];
3551
3593
  };
3552
3594
  }
3553
3595
  ];