@overcast-xyz/solana-program 0.1.1

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.
@@ -0,0 +1,447 @@
1
+ {
2
+ "address": "KCauVaXvP8pdxsAVo62JciiuCKAaCmUQEApUtXjthpJ",
3
+ "metadata": {
4
+ "name": "overcast_fee_hook",
5
+ "version": "0.1.0",
6
+ "spec": "0.1.0",
7
+ "description": "Created with Anchor"
8
+ },
9
+ "instructions": [
10
+ {
11
+ "name": "claim",
12
+ "discriminator": [62, 198, 214, 193, 213, 159, 108, 210],
13
+ "accounts": [
14
+ {
15
+ "name": "signer",
16
+ "writable": true,
17
+ "signer": true
18
+ },
19
+ {
20
+ "name": "protocol_fee",
21
+ "pda": {
22
+ "seeds": [
23
+ {
24
+ "kind": "const",
25
+ "value": [
26
+ 115, 116, 97, 116, 105, 99, 45, 112, 114, 111, 116, 111, 99,
27
+ 111, 108, 45, 102, 101, 101
28
+ ]
29
+ },
30
+ {
31
+ "kind": "arg",
32
+ "path": "config.salt"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "name": "protocol_fee_ata",
39
+ "writable": true,
40
+ "pda": {
41
+ "seeds": [
42
+ {
43
+ "kind": "account",
44
+ "path": "protocol_fee"
45
+ },
46
+ {
47
+ "kind": "account",
48
+ "path": "token_program"
49
+ },
50
+ {
51
+ "kind": "account",
52
+ "path": "claim_mint"
53
+ }
54
+ ],
55
+ "program": {
56
+ "kind": "const",
57
+ "value": [
58
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
59
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
60
+ 219, 233, 248, 89
61
+ ]
62
+ }
63
+ }
64
+ },
65
+ {
66
+ "name": "token_receiver",
67
+ "writable": true
68
+ },
69
+ {
70
+ "name": "claim_mint"
71
+ },
72
+ {
73
+ "name": "token_program"
74
+ },
75
+ {
76
+ "name": "associated_token_program",
77
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
78
+ },
79
+ {
80
+ "name": "system_program",
81
+ "address": "11111111111111111111111111111111"
82
+ }
83
+ ],
84
+ "args": [
85
+ {
86
+ "name": "config",
87
+ "type": {
88
+ "defined": {
89
+ "name": "ProtocolFee"
90
+ }
91
+ }
92
+ },
93
+ {
94
+ "name": "amount",
95
+ "type": "u64"
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "name": "initialize",
101
+ "discriminator": [175, 175, 109, 31, 13, 152, 155, 237],
102
+ "accounts": [
103
+ {
104
+ "name": "signer",
105
+ "writable": true,
106
+ "signer": true
107
+ },
108
+ {
109
+ "name": "protocol_fee",
110
+ "writable": true,
111
+ "pda": {
112
+ "seeds": [
113
+ {
114
+ "kind": "const",
115
+ "value": [
116
+ 115, 116, 97, 116, 105, 99, 45, 112, 114, 111, 116, 111, 99,
117
+ 111, 108, 45, 102, 101, 101
118
+ ]
119
+ },
120
+ {
121
+ "kind": "arg",
122
+ "path": "config.salt"
123
+ }
124
+ ]
125
+ }
126
+ },
127
+ {
128
+ "name": "system_program",
129
+ "address": "11111111111111111111111111111111"
130
+ }
131
+ ],
132
+ "args": [
133
+ {
134
+ "name": "config",
135
+ "type": {
136
+ "defined": {
137
+ "name": "ProtocolFee"
138
+ }
139
+ }
140
+ }
141
+ ]
142
+ },
143
+ {
144
+ "name": "on_create_option",
145
+ "discriminator": [77, 121, 77, 57, 251, 113, 10, 237],
146
+ "accounts": [
147
+ {
148
+ "name": "protocol_fees"
149
+ }
150
+ ],
151
+ "args": [
152
+ {
153
+ "name": "option",
154
+ "type": {
155
+ "defined": {
156
+ "name": "MarketOption"
157
+ }
158
+ }
159
+ },
160
+ {
161
+ "name": "metadata",
162
+ "type": "bytes"
163
+ }
164
+ ],
165
+ "returns": {
166
+ "defined": {
167
+ "name": "FeeResolution"
168
+ }
169
+ }
170
+ },
171
+ {
172
+ "name": "update",
173
+ "discriminator": [219, 200, 88, 176, 158, 63, 253, 127],
174
+ "accounts": [
175
+ {
176
+ "name": "signer",
177
+ "writable": true,
178
+ "signer": true
179
+ },
180
+ {
181
+ "name": "protocol_fee",
182
+ "writable": true,
183
+ "pda": {
184
+ "seeds": [
185
+ {
186
+ "kind": "const",
187
+ "value": [
188
+ 115, 116, 97, 116, 105, 99, 45, 112, 114, 111, 116, 111, 99,
189
+ 111, 108, 45, 102, 101, 101
190
+ ]
191
+ },
192
+ {
193
+ "kind": "arg",
194
+ "path": "config.salt"
195
+ }
196
+ ]
197
+ }
198
+ },
199
+ {
200
+ "name": "system_program",
201
+ "address": "11111111111111111111111111111111"
202
+ }
203
+ ],
204
+ "args": [
205
+ {
206
+ "name": "config",
207
+ "type": {
208
+ "defined": {
209
+ "name": "ProtocolFee"
210
+ }
211
+ }
212
+ }
213
+ ]
214
+ }
215
+ ],
216
+ "accounts": [
217
+ {
218
+ "name": "ProtocolFee",
219
+ "discriminator": [121, 127, 98, 139, 72, 110, 44, 118]
220
+ }
221
+ ],
222
+ "events": [
223
+ {
224
+ "name": "FeesClaimed",
225
+ "discriminator": [22, 104, 110, 222, 38, 157, 14, 62]
226
+ }
227
+ ],
228
+ "errors": [
229
+ {
230
+ "code": 6000,
231
+ "name": "CustomError",
232
+ "msg": "Custom error message"
233
+ },
234
+ {
235
+ "code": 6001,
236
+ "name": "ArithmeticOverflow",
237
+ "msg": "Arithmetic overflow computing settlement"
238
+ },
239
+ {
240
+ "code": 6002,
241
+ "name": "Unauthorized",
242
+ "msg": "Signer is not authorized to perform this action"
243
+ }
244
+ ],
245
+ "types": [
246
+ {
247
+ "name": "FeeConfig",
248
+ "type": {
249
+ "kind": "enum",
250
+ "variants": [
251
+ {
252
+ "name": "Linear",
253
+ "fields": [
254
+ {
255
+ "name": "bps",
256
+ "type": "u32"
257
+ }
258
+ ]
259
+ }
260
+ ]
261
+ }
262
+ },
263
+ {
264
+ "name": "FeeResolution",
265
+ "docs": [
266
+ "An option-creation hook returns this from `on_create_option` to tell core how",
267
+ "much of the premium to divert as a protocol fee."
268
+ ],
269
+ "type": {
270
+ "kind": "struct",
271
+ "fields": [
272
+ {
273
+ "name": "premium_fee_amount",
274
+ "type": "u64"
275
+ }
276
+ ]
277
+ }
278
+ },
279
+ {
280
+ "name": "FeesClaimed",
281
+ "type": {
282
+ "kind": "struct",
283
+ "fields": [
284
+ {
285
+ "name": "protocol_fee",
286
+ "type": "pubkey"
287
+ },
288
+ {
289
+ "name": "mint",
290
+ "type": "pubkey"
291
+ },
292
+ {
293
+ "name": "receiver",
294
+ "type": "pubkey"
295
+ },
296
+ {
297
+ "name": "amount",
298
+ "type": "u64"
299
+ }
300
+ ]
301
+ }
302
+ },
303
+ {
304
+ "name": "MarketOption",
305
+ "docs": [
306
+ "A live option, as passed to a settlement layer / hook. Mirrors",
307
+ "`overcast_core::state::MarketOption` byte-for-byte."
308
+ ],
309
+ "type": {
310
+ "kind": "struct",
311
+ "fields": [
312
+ {
313
+ "name": "details",
314
+ "type": {
315
+ "defined": {
316
+ "name": "OptionDetails"
317
+ }
318
+ }
319
+ },
320
+ {
321
+ "name": "taker",
322
+ "type": "pubkey"
323
+ },
324
+ {
325
+ "name": "maker",
326
+ "type": "pubkey"
327
+ },
328
+ {
329
+ "name": "settlement_offer",
330
+ "type": "pubkey"
331
+ },
332
+ {
333
+ "name": "collateral_offer",
334
+ "type": "pubkey"
335
+ },
336
+ {
337
+ "name": "borrowed_collateral",
338
+ "docs": [
339
+ "Collateral currently out on loan via `borrow_collateral` and not yet",
340
+ "returned via `repay_collateral`."
341
+ ],
342
+ "type": "u64"
343
+ }
344
+ ]
345
+ }
346
+ },
347
+ {
348
+ "name": "OptionDetails",
349
+ "docs": [
350
+ "The economic terms of an option, as seen by a settlement layer / hook.",
351
+ "",
352
+ "Mirrors `overcast_core::state::OptionDetails` byte-for-byte — core owns the",
353
+ "on-chain account representation, this is the shared interface view."
354
+ ],
355
+ "type": {
356
+ "kind": "struct",
357
+ "fields": [
358
+ {
359
+ "name": "domain",
360
+ "type": "u32"
361
+ },
362
+ {
363
+ "name": "start_timestamp",
364
+ "type": "i64"
365
+ },
366
+ {
367
+ "name": "end_timestamp",
368
+ "type": "i64"
369
+ },
370
+ {
371
+ "name": "premium_asset",
372
+ "type": "pubkey"
373
+ },
374
+ {
375
+ "name": "premium_amount",
376
+ "type": "u64"
377
+ },
378
+ {
379
+ "name": "collateral_asset",
380
+ "type": "pubkey"
381
+ },
382
+ {
383
+ "name": "collateral_amount",
384
+ "type": "u64"
385
+ },
386
+ {
387
+ "name": "settlement_asset",
388
+ "type": "pubkey"
389
+ },
390
+ {
391
+ "name": "settlement_amount",
392
+ "type": "u64"
393
+ },
394
+ {
395
+ "name": "settlement_layer",
396
+ "type": "pubkey"
397
+ },
398
+ {
399
+ "name": "borrow_allowed",
400
+ "docs": [
401
+ "Opt-in flag: if false, `borrow_collateral` is hard-rejected by core",
402
+ "regardless of what the settlement layer says. If true, the layer is",
403
+ "CPI'd and can still refuse."
404
+ ],
405
+ "type": "bool"
406
+ }
407
+ ]
408
+ }
409
+ },
410
+ {
411
+ "name": "ProtocolFee",
412
+ "type": {
413
+ "kind": "struct",
414
+ "fields": [
415
+ {
416
+ "name": "authority",
417
+ "type": "pubkey"
418
+ },
419
+ {
420
+ "name": "payout_authority",
421
+ "type": "pubkey"
422
+ },
423
+ {
424
+ "name": "claim_authority",
425
+ "type": "pubkey"
426
+ },
427
+ {
428
+ "name": "fee_config",
429
+ "type": {
430
+ "defined": {
431
+ "name": "FeeConfig"
432
+ }
433
+ }
434
+ },
435
+ {
436
+ "name": "salt",
437
+ "type": "pubkey"
438
+ },
439
+ {
440
+ "name": "bump",
441
+ "type": "u8"
442
+ }
443
+ ]
444
+ }
445
+ }
446
+ ]
447
+ }