-
Notifications
You must be signed in to change notification settings - Fork 5
/
bot-api.yaml
556 lines (555 loc) · 39.5 KB
/
bot-api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
openapi: '3.1.0'
info:
title: Genius Yield Trading Bot API
description: Open API Specification of the Genius Yield Trading Bot API for external trading strategy implementation integration.
version: '0.0.1'
license:
name: Apache License 2.0
identifier: Apache-2.0
contact:
name: Genius Yield Technical Support
url: https://www.geniusyield.co/
email: [email protected]
servers:
- url: http://{backendServerUrl}/api/{apiVersion}
description: Trading Bot API backend with environment and version
variables:
backendServerUrl:
default: localhost
description: The URI of the Trading Bot API backend.
apiVersion:
default: v0
description: API version number
components:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: api-key
description: API key to access the Trading Bot API.
schemas:
ErrorResponse:
type: object
properties:
errorCode:
type: string
examples: ["MULTI_FILL_NOT_SAME_PAIR"]
message:
type: string
examples: ["Given orders are not having same payment token"]
required: [code, message]
examples: [{"errorCode": "MULTI_FILL_NOT_SAME_PAIR", "message": "Given orders are not having same payment token"}]
Settings:
type: object
properties: {
network: { type: string, enum: ["preprod", "mainnet"], examples: ["mainnet", "preprod"] },
version: { type: string, examples: ["1.0.2"], pattern: "[0-9].[0-9].[0-9]" },
revision: { type: string, examples: ["c7cc91eec7f3d50b8de196a01034b0cc7097ae59"] },
backend: { type: string },
address: { type: string, examples: ["addr1v87wwwe4f59dqc50qyt0ckcs0kvh7glpweyal2k5nsgyucgk6038f"] },
collateral_utxo: { type: string, examples: ["33be2c9754bb3c2ea32039722cff2e34cva09d746283ab1234ce7155866e3d30#3"] }
}
required: [network, version, revision, backend]
optional: [address, collateral_utxo]
examples:
- { network: "mainnet", version: "0.1.0", revision: "c7cc91eec7f3d50b8de196a01034b0cc7097ae59", backend: "mmb", address: "addr1v87wwwe4f59dqc50qyt0ckcs0kvh7glpweyal2k5nsgyucgk6038f", collateral_utxo: "33be2c9754bb3c2ea32039722cff2e34cva09d746283ab1234ce7155866e3d30#3" }
- { network: "preprod", version: "0.1.0", revision: "c7cc91eec7f3d50b8de196a01034b0cc7097ae59", backend: "mmb", address: "addr1v87wwwe4f59dqc50qyt0ckcs0kvh7glpweyal2k5nsgyucgk6038f", collateral_utxo: "33be2c9754bb3c2ea32039722cff2e34cva09d746283ab1234ce7155866e3d30#3" }
Fees:
type: object
properties: {
flat_maker_fee: { type: number, format: double, minimum: 0 },
flat_taker_fee: { type: number, format: double, minimum: 0 },
percentage_maker_fee: { type: number, format: double, minimum: 0, maximum: 100 },
percentage_taker_fee: { type: number, format: double, minimum: 0, maximum: 100 }
}
required: [flat_maker_fee, flat_taker_fee, percentage_maker_fee, percentage_taker_fee]
examples:
- { flat_maker_fee: "1.2", flat_taker_fee: "2.3", percentage_maker_fee: "0.75", percentage_taker_fee: "1.25" }
Market:
type: object
properties:
market_id: { type: string, description: "Identifier of a market with concatenated asset IDs with underscore delimiter to separate base and target.", examples: ["lovelace_dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53"] }
base_asset: { type: string, description: "Identifier of the base asset", examples: ["lovelace", "dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53"], }
target_asset: { type: string, description: "Identifier of the target asset", examples: ["dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53"] }
required: [market_id, base_asset, target_asset]
examples:
- {
market_id: "lovelace_dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53",
base_asset: "lovelace",
target_asset: "dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53"
}
Markets:
type: array
items: {$ref: '#/components/schemas/Market'}
Asset:
type: object
properties:
asset: { type: string, description: "Identifier of the asset", examples: ["lovelace", "dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53"] }
asset_ticker: { type: string, description: "Ticker of the cryptoasset.", examples: ["ADA", "GENS"] }
asset_decimals: { type: integer, format: int32, minimum: 0, examples: [0, 6] }
required: [asset, asset_ticker, asset_decimals]
examples:
- {
asset: "dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53",
asset_ticker: "GENS",
asset_decimals: 6
}
- {
asset: "lovelace",
asset_ticker: "ADA",
asset_decimals: 6
}
Balances:
examples:
- {
lovalace: "1",
dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53: "2"
}
Order:
properties:
base_asset: {type: string, description: "The base cryptoasset", examples: ["lovelace"] }
base_amount: {type: string, format: integer, description: "Transaction amount in base pair volume in indivisible units", examples: ["6000000"] }
target_asset: {type: string, description: "The the target cryptoasset", examples: ["dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53"] }
target_amount: { type: string, format: integer, description: "Transaction amount in target pair volume in indivisible units." }
type: { type: string, enum: ["buy", "sell"], examples: ["buy"] }
valid_from: {type: string, format: date-time, examples: ["1985-04-12T23:00:00.00Z"] }
valid_until: {type: string, format: date-time, examples: ["1985-04-12T23:15:00.00Z"] }
required: [base_asset, base_amount, target_asset, target_amount, type]
examples:
- {
base_asset : "lovelace",
base_amount : "4000000",
target_asset: "dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53",
target_amount : "1000000",
type : "buy"
}
- {
base_asset : "lovelace",
base_amount : "4000000",
target_asset: "dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53",
target_amount : "1000000",
type : "buy",
valid_from: "2024-04-12T23:00:00.00Z",
valid_until: "2024-04-13T23:00:00.00Z",
}
PostOrderParameters:
type: object
properties:
offer_amount: {type: string, examples: ["1"] }
offer_token: {type: string, examples: ["lovelace"] }
price_amount: {type: string, examples: ["1"]}
price_token: { type: string, examples: ["66a524d7f34d954a3ad30b4e2d08023c950dfcd53bbe3c2314995da6.744d454c44"]}
address: {type: string, examples: ["addr1v87wwwe4f59dqc50qyt0ckcs0kvh7glpweyal2k5nsgyucgk6038f"]}
PostOrderResponse:
type: object
properties:
transaction: {type: string, examples: ["84a70082825820975e4c7f8d7937f8102e500714feb3f014c8766fcf287a11c10c686154fcb27501825820c887cba672004607a0f60ab28091d5c24860dbefb92b1a8776272d752846574f000d818258207a67cd033169e330c9ae9b8d0ef8b71de9eb74bbc8f3f6be90446dab7d1e8bfd00018282583900fd040c7a10744b79e5c80ec912a05dbdb3009e372b7f4b0f026d16b0c663651ffc046068455d2994564ba9d4b3e9b458ad8ab5232aebbf401a1abac7d882583900fd040c7a10744b79e5c80ec912a05dbdb3009e372b7f4b0f026d16b0c663651ffc046068455d2994564ba9d4b3e9b458ad8ab5232aebbf40821a0017ad4aa2581ca6bb5fd825455e7c69bdaa9d3a6dda9bcbe9b570bc79bd55fa50889ba1466e69636b656c1911d7581cb17cb47f51d6744ad05fb937a762848ad61674f8aebbaec67be0bb6fa14853696c6c69636f6e190258021a00072f3c0e8009a1581cb17cb47f51d6744ad05fb937a762848ad61674f8aebbaec67be0bb6fa14853696c6c69636f6e1902580b5820291b4e4c5f189cb896674e02e354028915b11889687c53d9cf4c1c710ff5e4aea203815908d45908d101000033332332232332232323232323232323232323232323232323232222223232323235500222222222225335333553024120013232123300122333500522002002001002350012200112330012253350021001102d02c25335325335333573466e3cd400488008d404c880080b40b04ccd5cd19b873500122001350132200102d02c102c3500122002102b102c00a132635335738921115554784f206e6f7420636f6e73756d65640002302115335333573466e3c048d5402c880080ac0a854cd4ccd5cd19b8701335500b2200102b02a10231326353357389210c77726f6e6720616d6f756e740002302113263533573892010b77726f6e6720746f6b656e00023021135500122222222225335330245027007162213500222253350041335502d00200122161353333573466e1cd55cea8012400046644246600200600464646464646464646464646666ae68cdc39aab9d500a480008cccccccccc888888888848cccccccccc00402c02802402001c01801401000c008cd40548c8c8cccd5cd19b8735573aa0049000119910919800801801180f1aba15002301a357426ae8940088c98d4cd5ce01381401301289aab9e5001137540026ae854028cd4054058d5d0a804999aa80c3ae501735742a010666aa030eb9405cd5d0a80399a80a80f1aba15006335015335502101f75a6ae854014c8c8c8cccd5cd19b8735573aa00490001199109198008018011919191999ab9a3370e6aae754009200023322123300100300233502475a6ae854008c094d5d09aba2500223263533573805605805405226aae7940044dd50009aba150023232323333573466e1cd55cea8012400046644246600200600466a048eb4d5d0a80118129aba135744a004464c6a66ae700ac0b00a80a44d55cf280089baa001357426ae8940088c98d4cd5ce01381401301289aab9e5001137540026ae854010cd4055d71aba15003335015335502175c40026ae854008c06cd5d09aba2500223263533573804604804404226ae8940044d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135744a00226aae7940044dd50009aba150023232323333573466e1d400520062321222230040053016357426aae79400c8cccd5cd19b875002480108c848888c008014c060d5d09aab9e500423333573466e1d400d20022321222230010053014357426aae7940148cccd5cd19b875004480008c848888c00c014dd71aba135573ca00c464c6a66ae7007807c07407006c0680644d55cea80089baa001357426ae8940088c98d4cd5ce00b80c00b00a9100109aab9e5001137540022464460046eb0004c8004d5406488cccd55cf8009280c119a80b98021aba100230033574400402446464646666ae68cdc39aab9d5003480008ccc88848ccc00401000c008c8c8c8cccd5cd19b8735573aa004900011991091980080180118099aba1500233500c012357426ae8940088c98d4cd5ce00b00b80a80a09aab9e5001137540026ae85400cccd5401dd728031aba1500233500875c6ae84d5d1280111931a99ab9c012013011010135744a00226aae7940044dd5000899aa800bae75a224464460046eac004c8004d5405c88c8cccd55cf8011280b919a80b19aa80c18031aab9d5002300535573ca00460086ae8800c0444d5d080089119191999ab9a3370ea0029000119091180100198029aba135573ca00646666ae68cdc3a801240044244002464c6a66ae7004004403c0380344d55cea80089baa001232323333573466e1cd55cea80124000466442466002006004600a6ae854008dd69aba135744a004464c6a66ae7003403803002c4d55cf280089baa0012323333573466e1cd55cea800a400046eb8d5d09aab9e500223263533573801601801401226ea8004488c8c8cccd5cd19b87500148010848880048cccd5cd19b875002480088c84888c00c010c018d5d09aab9e500423333573466e1d400d20002122200223263533573801c01e01a01801601426aae7540044dd50009191999ab9a3370ea0029001100911999ab9a3370ea0049000100911931a99ab9c00a00b009008007135573a6ea80048c8c8c8c8c8cccd5cd19b8750014803084888888800c8cccd5cd19b875002480288488888880108cccd5cd19b875003480208cc8848888888cc004024020dd71aba15005375a6ae84d5d1280291999ab9a3370ea00890031199109111111198010048041bae35742a00e6eb8d5d09aba2500723333573466e1d40152004233221222222233006009008300c35742a0126eb8d5d09aba2500923333573466e1d40192002232122222223007008300d357426aae79402c8cccd5cd19b875007480008c848888888c014020c038d5d09aab9e500c23263533573802402602202001e01c01a01801601426aae7540104d55cf280189aab9e5002135573ca00226ea80048c8c8c8c8cccd5cd19b875001480088ccc888488ccc00401401000cdd69aba15004375a6ae85400cdd69aba135744a00646666ae68cdc3a80124000464244600400660106ae84d55cf280311931a99ab9c00b00c00a009008135573aa00626ae8940044d55cf280089baa001232323333573466e1d400520022321223001003375c6ae84d55cf280191999ab9a3370ea004900011909118010019bae357426aae7940108c98d4cd5ce00400480380300289aab9d5001137540022244464646666ae68cdc39aab9d5002480008cd5403cc018d5d0a80118029aba135744a004464c6a66ae7002002401c0184d55cf280089baa00149924103505431001200132001355008221122253350011350032200122133350052200230040023335530071200100500400132001355007222533500110022213500222330073330080020060010033200135500622225335001100222135002225335333573466e1c005200000d00c13330080070060031333008007335009123330010080030020060031122002122122330010040031122123300100300212200212200111232300100122330033002002001482c0252210853696c6c69636f6e003351223300248920975e4c7f8d7937f8102e500714feb3f014c8766fcf287a11c10c686154fcb27500480088848cc00400c00880050581840100d87980821a001f372a1a358a2b14f5f6"] }
transaction_id: {type: string, examples: ["a8d75b90a052302c1232bedd626720966b1697fe38de556c617c340233688935"] }
nft_token: {type: string, examples: ["ff80aaaf03a273b8f5c558168dc0e2377eea810badbae6eceefc14ef.474f4c44"] }
order_ref: {type: string, examples: ["4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189#1"] }
transaction_fee: {type: string, examples: ["1"]}
maker_lovelace_flat_fee: {type: string, examples: ["1"]}
maker_offered_percent_fee: {type: string, examples: ["0.3"]}
maker_offered_percent_fee_amount: {type: string, examples: ["1"]}
lovelace_deposit: {type: string, examples: ["1"]}
DeleteOrderParameters:
type: object
properties:
address: {type: string, examples: ["addr1v87wwwe4f59dqc50qyt0ckcs0kvh7glpweyal2k5nsgyucgk6038f"]}
order_references: {type: array, items: {type: string}, examples: [["addr1v87wwwe4f59dqc50qyt0ckcs0kvh7glpweyal2k5nsgyucgk6038f"]]}
DeleteOrderResponse:
type: object
properties:
transaction: {type: string, examples: ["hexa"] }
transaction_id: {type: string, examples: ["lovelace"] }
transaction_fee: {type: string, examples: ["1"]}
PostOrderFillParameters:
type: object
properties:
order_references_with_amount:
type: array
items:
type: array
items:
type: string
example: ["0018dbaa1611531b9f11a31765e8abe875f9c43750b82b5f321350f31e1ea747#0", "100"]
example: { "order_references_with_amount": [ [ "0018dbaa1611531b9f11a31765e8abe875f9c43750b82b5f321350f31e1ea747#0", "100" ], [ "0018dbaa1611531b9f11a31765e8abe875f9c43750b82b5f321350f31e144444#0", "100" ] ] }
PostOrderFillResponse:
type: object
properties:
taker_lovelace_flat_fee:
type: string
examples: ["123456789123456789123456789123456789123456789"]
taker_offered_percent_fee:
type: string
examples: ["0.125"]
taker_offered_percent_fee_amount:
type: string
examples: ["123456789123456789123456789123456789123456789"]
transaction:
type: string
examples: ["84a70082825820975e4c7f8d7937f8102e500714feb3f014c8766fcf287a11c10c686154fcb27501825820c887cba672004607a0f60ab28091d5c24860dbefb92b1a8776272d752846574f000d818258207a67cd033169e330c9ae9b8d0ef8b71de9eb74bbc8f3f6be90446dab7d1e8bfd00018282583900fd040c7a10744b79e5c80ec912a05dbdb3009e372b7f4b0f026d16b0c663651ffc046068455d2994564ba9d4b3e9b458ad8ab5232aebbf401a1abac7d882583900fd040c7a10744b79e5c80ec912a05dbdb3009e372b7f4b0f026d16b0c663651ffc046068455d2994564ba9d4b3e9b458ad8ab5232aebbf40821a0017ad4aa2581ca6bb5fd825455e7c69bdaa9d3a6dda9bcbe9b570bc79bd55fa50889ba1466e69636b656c1911d7581cb17cb47f51d6744ad05fb937a762848ad61674f8aebbaec67be0bb6fa14853696c6c69636f6e190258021a00072f3c0e8009a1581cb17cb47f51d6744ad05fb937a762848ad61674f8aebbaec67be0bb6fa14853696c6c69636f6e1902580b5820291b4e4c5f189cb896674e02e354028915b11889687c53d9cf4c1c710ff5e4aea203815908d45908d101000033332332232332232323232323232323232323232323232322223232323235500222222222225335333553024120013232123300122333500522002002001002350012200112330012253350021001102d02c25335325335333573466e3cd400488008d404c880080b40b04ccd5cd19b873500122001350132200102d02c102c3500122002102b102c00a132635335738921115554784f206e6f7420636f6e73756d65640002302115335333573466e3c048d5402c880080ac0a854cd4ccd5cd19b8701335500b2200102b02a10231326353357389210c77726f6e6720616d6f756e740002302113263533573892010b77726f6e6720746f6b656e00023021135500122222222225335330245027007162213500222253350041335502d00200122161353333573466e1cd55cea8012400046644246600200600464646464646464646464646666ae68cdc39aab9d500a480008cccccccccc888888888848cccccccccc00402c02802402001c01801401000c008cd40548c8c8cccd5cd19b8735573aa0049000119910919800801801180f1aba15002301a357426ae8940088c98d4cd5ce01381401301289aab9e5001137540026ae854028cd4054058d5d0a804999aa80c3ae501735742a010666aa030eb9405cd5d0a80399a80a80f1aba15006335015335502101f75a6ae854014c8c8c8cccd5cd19b8735573aa00490001199109198008018011919191999ab9a3370e6aae754009200023322123300100300233502475a6ae854008c094d5d09aba2500223263533573805605805405226aae7940044dd50009aba150023232323333573466e3c048d5402c880080ac0a854cd4ccd5cd19b8701335500b2200102b02a10231326353357389210c77726f6e6720616d6f756e740002302113263533573892010b77726f6e6720746f6b656e00023021135500122222222225335330245027007162213500222253350041335502d00200122161353333573466e1cd55cea8012400046644246600200600464646464646464646464646666ae68cdc39aab9d500a480008cccccccccc888888888848cccccccccc00402c02802402001c01801401000c008cd40548c8c8cccd5cd19b8735573aa004900011991091980080180118099aba1500233500c012357426ae8940088c98d4cd5ce00b00b80a80a09aab9e5001137540026ae85400cccd5401dd728031aba1500233500875c6ae84d5d1280111931a99ab9c012013011010135744a00226aae7940044dd5000899aa800bae75a224464460046eac004c8004d5405c88c8cccd55cf8011280b919a80b19aa80c18031aab9d5002300535573ca00460086ae8800c0444d5d080089119191999ab9a3370ea0029000119091180100198029aba135573ca00646666ae68cdc3a801240044244002464c6a66ae7004004403c0380344d55cea80089baa001357426ae8940088c98d4cd5ce00b80c00b00a9100109aab9e5001137540022464460046eb0004c8004d5406488cccd55cf8009280c119a80b98021aba100230033574400402446464646666ae68cdc39aab9d5003480008ccc88848ccc00401000c008c8c8c8cccd5cd19b8735573aa004900011991091980080180118099aba1500233500c012357426ae8940088c98d4cd5ce00b00b80a80a09aab9e5001137540026ae85400cccd5401dd728031aba1500233500875c6ae84d5d1280111931a99ab9c012013011010135744a00226aae7940044dd5000899aa800bae75a224464460046eac004c8004d5405c88c8cccd55cf8011280b919a80b19aa80c18031aab9d5002300535573ca00460086ae8800c0444d5d080089119191999ab9a3370ea0029000119091180100198029aba135573ca00646666ae68cdc3a801240044244002464c6a66ae7004004403c0380344d55cea80089baa001232323333573466e1cd55cea80124000466442466002006004600a6ae854008dd69aba135744a004464c6a66ae7003403803002c4d55cf280089baa0012323333573466e1cd55cea800a400046eb8d5d09aab9e500223263533573801601801401226ea8004488c8c8cccd5cd19b87500148010848880048cccd5cd"]
transaction_id: {type: string, examples: ["0018dbaa1611531b9f11a31765e8abe875f9c43750b82b5f321350f31e1ea747"] }
transaction_fee: {type: string, examples: ["1"]}
examples: [{ "taker_lovelace_flat_fee": "123456789123456789123456789123456789123456789", "taker_offered_percent_fee": "0.125", "taker_offered_percent_fee_amount": "123456789123456789123456789123456789123456789", "transaction": "84a70082825820975e4c7f8d7937f8102e500714feb3f014c8766fcf287a11c10c686154fcb27501825820c887cba672004607a0f60ab28091d5c24860dbefb92b1a8776272d752846574f000d818258207a67cd033169e330c9ae9b8d0ef8b71de9eb74bbc8f3f6be90446dab7d1e8bfd00018282583900fd040c7a10744b79e5c80ec912a05dbdb3009e372b7f4b0f026d16b0c663651ffc046068455d2994564ba9d4b3e9b458ad8ab5232aebbf401a1abac7d882583900fd040c7a10744b79e5c80ec912a05dbdb3009e372b7f4b0f026d16b0c663651ffc046068455d2994564ba9d4b3e9b458ad8ab5232aebbf40821a0017ad4aa2581ca6bb5fd825455e7c69bdaa9d3a6dda9bcbe9b570bc79bd55fa50889ba1466e69636b656c1911d7581cb17cb47f51d6744ad05fb937a762848ad61674f8aebbaec67be0bb6fa14853696c6c69636f6e190258021a00072f3c0e8009a1581cb17cb47f51d6744ad05fb937a762848ad61674f8aebbaec67be0bb6fa14853696c6c69636f6e1902580b5820291b4e4c5f189cb896674e02e354028915b11889687c53d9cf4c1c710ff5e4aea203815908d45908d101000033332332232332232323232323232323232323232323232323232222223232323235500222222222225335333553024120013232123300122333500522002002001002350012200112330012253350021001102d02c25335325335333573466e3cd400488008d404c880080b40b04ccd5cd19b873500122001350132200102d02c102c3500122002102b102c00a132635335738921115554784f206e6f7420636f6e73756d65640002302115335333573466e3c048d5402c880080ac0a854cd4ccd5cd19b8701335500b2200102b02a10231326353357389210c77726f6e6720616d6f756e740002302113263533573892010b77726f6e6720746f6b656e00023021135500122222222225335330245027007162213500222253350041335502d00200122161353333573466e1cd55cea8012400046644246600200600464646464646464646464646666ae68cdc39aab9d500a480008cccccccccc888888888848cccccccccc00402c02802402001c01801401000c008cd40548c8c8cccd5cd19b8735573aa0049000119910919800801801180f1aba15002301a357426ae8940088c98d4cd5ce01381401301289aab9e5001137540026ae854028cd4054058d5d0a804999aa80c3ae501735742a010666aa030eb9405cd5d0a80399a80a80f1aba15006335015335502101f75a6ae854014c8c8c8cccd5cd19b8735573aa00490001199109198008018011919191999ab9a3370e6aae754009200023322123300100300233502475a6ae854008c094d5d09aba2500223263533573805605805405226aae7940044dd50009aba150023232323333573466e1cd55cea8012400046644246600200600466a048eb4d5d0a80118129aba135744a004464c6a66ae700ac0b00a80a44d55cf280089baa001357426ae8940088c98d4cd5ce01381401301289aab9e5001137540026ae854010cd4055d71aba15003335015335502175c40026ae854008c06cd5d09aba2500223263533573804604804404226ae8940044d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135744a00226aae7940044dd50009aba150023232323333573466e1d400520062321222230040053016357426aae79400c8cccd5cd19b875002480108c848888c008014c060d5d09aab9e500423333573466e1d400d20022321222230010053014357426aae7940148cccd5cd19b875004480008c848888c00c014dd71aba135573ca00c464c6a66ae7007807c07407006c0680644d55cea80089baa001357426ae8940088c98d4cd5ce00b80c00b00a9100109aab9e5001137540022464460046eb0004c8004d5406488cccd55cf8009280c119a80b98021aba100230033574400402446464646666ae68cdc39aab9d5003480008ccc88848ccc00401000c008c8c8c8cccd5cd19b8735573aa004900011991091980080180118099aba1500233500c012357426ae8940088c98d4cd5ce00b00b80a80a09aab9e5001137540026ae85400cccd5401dd728031aba1500233500875c6ae84d5d1280111931a99ab9c012013011010135744a00226aae7940044dd5000899aa800bae75a224464460046eac004c8004d5405c88c8cccd55cf8011280b919a80b19aa80c18031aab9d5002300535573ca00460086ae8800c0444d5d080089119191999ab9a3370ea0029000119091180100198029aba135573ca00646666ae68cdc3a801240044244002464c6a66ae7004004403c0380344d55cea80089baa001232323333573466e1cd55cea80124000466442466002006004600a6ae854008dd69aba135744a004464c6a66ae7003403803002c4d55cf280089baa0012323333573466e1cd55cea800a400046eb8d5d09aab9e500223263533573801601801401226ea8004488c8c8cccd5cd19b87500148010848880048cccd5cd19b875002480088c84888c00c010c018d5d09aab9e500423333573466e1d400d20002122200223263533573801c01e01a01801601426aae7540044dd50009191999ab9a3370ea0029001100911999ab9a3370ea0049000100911931a99ab9c00a00b009008007135573a6ea80048c8c8c8c8c8cccd5cd19b8750014803084888888800c8cccd5cd19b875002480288488888880108cccd5cd19b875003480208cc8848888888cc004024020dd71aba15005375a6ae84d5d1280291999ab9a3370ea00890031199109111111198010048041bae35742a00e6eb8d5d09aba2500723333573466e1d40152004233221222222233006009008300c35742a0126eb8d5d09aba2500923333573466e1d40192002232122222223007008300d357426aae79402c8cccd5cd19b875007480008c848888888c014020c038d5d09aab9e500c23263533573802402602202001e01c01a01801601426aae7540104d55cf280189aab9e5002135573ca00226ea80048c8c8c8c8cccd5cd19b875001480088ccc888488ccc00401401000cdd69aba15004375a6ae85400cdd69aba135744a00646666ae68cdc3a80124000464244600400660106ae84d55cf280311931a99ab9c00b00c00a009008135573aa00626ae8940044d55cf280089baa001232323333573466e1d400520022321223001003375c6ae84d55cf280191999ab9a3370ea004900011909118010019bae357426aae7940108c98d4cd5ce00400480380300289aab9d5001137540022244464646666ae68cdc39aab9d5002480008cd5403cc018d5d0a80118029aba135744a004464c6a66ae7002002401c0184d55cf280089baa00149924103505431001200132001355008221122253350011350032200122133350052200230040023335530071200100500400132001355007222533500110022213500222330073330080020060010033200135500622225335001100222135002225335333573466e1c005200000d00c13330080070060031333008007335009123330010080030020060031122002122122330010040031122123300100300212200212200111232300100122330033002002001482c0252210853696c6c69636f6e003351223300248920975e4c7f8d7937f8102e500714feb3f014c8766fcf287a11c10c686154fcb27500480088848cc00400c00880050581840100d87980821a001f372a1a358a2b14f5f6", "transaction_fee": "123456789123456789123456789123456789123456789", "transaction_id": "a8d75b90a052302c1232bedd626720966b1697fe38de556c617c340233688935" }]
BuildTxRequestBase:
type: object
properties:
collateral_utxo: {type: string, examples: ["33be2c9754bb3c2ea32039722cff2e34cva09d746283ab1234ce7155866e3d30#3"]}
address: {type: string, examples: ["addr1v87wwwe4f59dqc50qyt0ckcs0kvh7glpweyal2k5nsgyucgk6038f"]}
BuildPlaceOrdersTxRequest:
allOf:
- $ref: '#/components/schemas/BuildTxRequestBase'
- type: object
properties:
orders: {type: array, items: {$ref: '#/components/schemas/Order'}}
required: [orders]
Orders:
type: array
items: {$ref: '#/components/schemas/Order'}
BuildCancelOrdersTxRequest:
allOf:
- $ref: '#/components/schemas/BuildTxRequestBase'
- type: object
properties:
orders: {type: array, items: {type: string, description: "orders to be cancelled"}}
required: [orders]
Transaction:
type: object
properties:
cbor_hex: {type: string}
SubmitTransactionResponse:
type: object
properties:
transaction_id: {type: string}
message: {type: string}
fees: {type: string, format: numeric}
flat_fees: {type: string, format: numeric}
offer_fee_percent: {type: string, format: numeric}
offer_fee_amount: {type: string, format: numeric}
deposit: {type: string, format: numeric}
required: [transaction_id, message, fees, flat_fees, offer_fee_percent, offer_fee_percent, offer_fee_amount, deposit]
Trade:
type: object
properties:
timestamp: { type: string , description: Trade timestamp, format: "date-time", examples: ["1985-04-12T23:00:00.00Z"] }
base_asset: {type: string, description: "The base cryptoasset", examples: ["lovelace"] }
base_asset_amount: { type: string, format: integer, description: "Transaction amount in base pair volume in indivisible units." }
target_asset: {type: string, description: "The the target cryptoasset", examples: ["dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb.0014df1047454e53"] }
target_asset_amount: { type: string, format: integer, description: "Transaction amount in target pair volume in indivisible units." }
type: { type: string, description: "Used to determine the type of the transaction that was completed. Buy: Identifies an ask that was removed from the order book. Sell: Identifies a bid that was removed from the order book." }
required: [timestamp, base_asset, base_asset_amount, target_asset, target_asset_amount, type]
Price:
type: object
properties:
base_close: { type: string, format: numeric, description: Base close price. }
base_high: { type: string, format: numeric, description: Target high price }
base_low: { type: string, format: numeric, description: Base low price }
base_open: { type: string, format: numeric, description: Base open price. }
base_volume: {type: string, format: numeric, description: Base volume in indivisible units. }
target_close: { type: string, format: numeric, description: Target close price }
target_high: { type: string, format: numeric, description: Target high price. }
target_low: { type: string, format: numeric, description: Target low price. }
target_open: { type: string, format: numeric, description: Target open price. }
target_volume: { type: string, format: numeric, description: Base volume in indivisible units. }
count: { type: integer, description: Candlestick size }
time_period_start: { type: string , description: "Timestamp of the start of the time period", format: "date-time", examples: ["1985-04-12T23:00:00.00Z"] }
time_period_end: { type: string , description: "Timestamp of the end of the time period", format: "date-time", examples: ["1985-04-12T23:15:00.00Z"] }
required: [base_close, base_high, base_low, base_open, base_volume, target_close, target_high, target_low, target_open, target_volume, count, time_period_start, time_period_end]
Prices:
type: array
items: {$ref: '#/components/schemas/Price'}
OrderInfo:
type: object
properties:
offer_amount: { type: string }
output_reference: { type: string }
nft_token: { type: string }
owner_address: { type: string }
owner_key_hash: { type: string }
price: { type: string }
start: { type: string, format: ISO8601}
end: { type: string, format: ISO8601}
required:
- offer_amount
- price
- owner_address
- owner_key_hash
- output_reference
OrderBookInfo:
type: object
properties:
market_pair_id: {type: string}
timestamp: {type: string }
asks:
type: array
items: { $ref: '#/components/schemas/OrderInfo' }
bids:
type: array
items: { $ref: '#/components/schemas/OrderInfo' }
required:
- market_pair_id
- timestamp
- bids
- asks
MarketOHLC:
type: object
examples:
- base_close: 0.207742
base_high: 0.207742
base_low: 0.207742
base_open: 0.207742
base_volume: 25.21128
count: 1
target_close: 4.813658
target_high: 4.813658
target_low: 4.813658
target_open: 4.813658
target_volume: 121.358488
timestamp: 2024-03-07T23:45:00Z
properties:
base_close:
format: double
type: number
base_high:
format: double
type: number
base_low:
format: double
type: number
base_open:
format: double
type: number
base_volume:
format: double
type: number
count:
minimum: 0
type: integer
target_close:
format: double
type: number
target_high:
format: double
type: number
target_low:
format: double
type: number
target_open:
format: double
type: number
target_volume:
format: double
type: number
timestamp:
description: This is the posix time in ISO8601 format.
examples: ["1970-01-01T00:00:00Z"]
format: ISO8601
type: string
required:
- base_close
- base_high
- base_low
- base_open
- base_volume
- target_close
- target_high
- target_low
- target_open
- target_volume
- count
- timestamp
security:
- ApiKeyAuth: [read, write]
tags:
- name: settings
description: Endpoints to access configuration settings and Trading Bot API backend metadata.
- name: assets
description: Endpoints to access the details of the available assets.
- name: markets
description: Endpoints to access the details of the trading pairs available via the Trading Bot API.
- name: balances
description: Endpoints to access the asset balances available for the trading bot.
- name: orders
description: Endpoints to access the orderbook(s), place new orders or cancel existing orders.
- name: fees
description: Endpoints to access the fee information
- name: historical-prices
description: Endpoints to access historical prices.
paths:
/settings:
get:
tags: [settings]
description: Fetch the configuration and metadata.
responses:
"200": {description: Success, content: {application/json: {schema: {$ref: '#/components/schemas/Settings' }}}}
"400": {description: Bad Request, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"401": {description: Anauthorized access, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"500": {description: Internal Server Error, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
/assets/{id}:
get:
parameters:
- name: id
in: path
required: true
description: The ID of the asset to retrieve
schema:
type: string
tags: [assets]
description: Fetch the assets.
responses:
"200": {description: Success, content: {application/json: {schema: {$ref: '#/components/schemas/Asset' }}}}
"400": {description: Bad Request, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"401": {description: Anauthorized access, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"500": {description: Internal Server Error, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
/markets:
get:
tags: [markets]
description: Get the trading pairs available for trading.
responses:
"200": {description: Success, content: {application/json: {schema: {$ref: '#/components/schemas/Markets' }}}}
"400": {description: Bad Request, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"401": {description: Anauthorized access, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"500": {description: Internal Server Error, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
/balances/{address}:
get:
tags: [balances]
description: Get available trading bot balances.
parameters:
- name: address
in: path
required: true
schema:
type: string
responses:
"200": {description: Success, content: {application/json: {schema: {$ref: '#/components/schemas/Balances' }}}}
"400": {description: Bad Request, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"401": {description: Anauthorized access, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"501": {description: Internal Server Error, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
/orders:
post:
tags: [orders]
description: Create new orders.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PostOrderParameters'
responses:
"200": {description: Success, content: {application/json: {schema: {$ref: '#/components/schemas/PostOrderResponse' }}}}
"400": {description: Bad Request, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"401": {description: Anauthorized access, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"501": {description: Internal Server Error, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
delete:
tags: [orders]
description: Cancel existing orders.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteOrderParameters'
responses:
"200":
description: Canceled on-chain orders.
content: { application/json: { schema: { $ref: '#/components/schemas/DeleteOrderResponse'}}}
"400": {description: Bad Request, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"401": {description: Anauthorized access, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"501": {description: Internal Server Error, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
/orders/fill:
post:
tags: [orders]
description: Direct fill from existing on-chain orders.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PostOrderFillParameters'
responses:
"200": {description: Success, content: {application/json: {schema: {$ref: '#/components/schemas/PostOrderFillResponse' }}}}
"400": {description: Bad Request, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"401": {description: Anauthorized access, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"501": {description: Internal Server Error, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
/order-books/{market_id}:
parameters:
- name: market_id
in: path
required: true
description: The ID of the market to retrieve the orderbook for.
schema: {type: string}
- in: query
name: "address"
schema: {type: string}
required: false
get:
tags: [orders]
description: Get order book for a specific market.
responses:
"200": {description: Success, content: {application/json: {schema: {$ref: '#/components/schemas/OrderBookInfo' }}}}
'400':
description: Invalid `address` or `market-id`
'401':
description: Unauthorized access - API key missing
'403':
description: Forbidden - The API key does not have permission to perform
the request
'500':
description: Internal server error
/historical-prices/maestro/{market}/{dex}:
parameters:
- in: path
name: market
required: true
schema: {type: string}
- name: dex
in: path
required: true
schema: {type: string}
- name: resolution
in: query
required: false
schema: {type: string}
- name: to
in: query
schema: {type: string}
required: false
- name: from
in: query
schema: {type: string}
required: false
- name: limit
in: query
required: false
schema: {type: number}
- name: sort
in: query
required: false
schema: {type: string}
get:
description: This endpoint internally calls Maestro's "DEX And Pair OHLC" endpoint.
responses:
"200": {description: Success, content: {application/json: {schema: {type: array, items: {$ref: '#/components/schemas/MarketOHLC'} }}}}
'400':
description: Invalid `sort` or `limit` or `to` or `from` or `resolution`
or `dex` or `market-id`
'401':
description: Unauthorized access - API key missing
'403':
description: Forbidden - The API key does not have permission to perform
the request
'500':
description: Internal server error
summary: Get price history using Maestro.
tags:
- historical-prices
/trading-fees:
get:
tags: [fees]
description: Fetch the current trading fees.
responses:
"200": {description: Success, content: {application/json: {schema: {$ref: '#/components/schemas/Fees' }}}}
"400": {description: Bad Request, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"401": {description: Anauthorized access, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}
"501": {description: Internal Server Error, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorResponse'}}}}