-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
579 lines (571 loc) · 16.2 KB
/
openapi.yaml
File metadata and controls
579 lines (571 loc) · 16.2 KB
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
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
openapi: 3.0.0
info:
version: "1.1"
title: Woorton Market-Maker OTC API
x-logo:
url: https://www.woorton.com/assets/images/logo/woorton-logo.png
description: >
<p>
The Woorton OTC Public API allows clients to access the market-maker service anytime.
<br>
The main usage is get quotations and executing trades.
<br><br>
<b>Clients must be registered to Woorton OTC service to use this API.</b>
</p>
<h2>Sandbox Environment</h2>
<p>
URL: <code>https://api-sandbox.woorton.com/api/v1</code>
</p>
<h2>Authentication</h2>
<p>
To authenticate with the API, you must add an <code>Authorization</code> header,
with the following format : <code>Bearer <TOKEN></code>.
<br><br>
Example:
<br>
<code>Authorization: Bearer e3f515ac6b9b81cd48de42d2ce3f0ada</code>
<br><br>
Your token will be securely send it to you by Woorton support team.
</p>
<h2>Security</h2>
<p>
API access is filtered with IP whitelisting, please contact Woorton support team
to whitelist your IPs.
</p>
<h2>General notes</h2>
<ul>
<li>API is only accessible through TLS ;
<li>dates are in <a href="https://fr.wikipedia.org/wiki/ISO_8601#UTC">ISO 8601 UTC format</a>.</li>
</ul>
<h2>Libraries and implementation examples</h2>
<p>
You can find API client library for different languages:
</p>
<ul>
<li><a href="https://github.com/jwoorton/woorton-API-python">Python</a> ;</li>
<li><i>more coming soon... </i></li>
</ul>
paths:
/request_quotes:
post:
tags: ["Quotes"]
description: >
<p>
You may request for a quotation using this action.
<br><br>
Once the quotation is returned (in response), you will have a short delay to confirm, ie execute, the trade, by calling the <a href="#tag/Quotes/paths/~1trades/post"><u>Trade API</u></a>.
<br><br>
Quote expires approximately 20 seconds after the request.
<br><br>
Allowed instrument can queried via /api/v1/instruments.
</p>
<table style="width:50%">
<thead>
<tr>
<th>Pair</th>
<th>Amount precision</th>
<th>Total precision</th>
</tr>
</thead>
<tbody>
<tr>
<tr><td>ETHBTC.SPOT</td><td>2</td><td>8</td></tr>
<tr><td>ETHUST.SPOT</td><td>2</td><td>2</td></tr>
<tr><td>BTCUST.SPOT</td><td>2</td><td>2</td></tr>
<tr><td>LTCUST.SPOT</td><td>2</td><td>2</td></tr>
<tr><td>BCHUST.SPOT</td><td>2</td><td>2</td></tr>
<tr><td>XRPUST.SPOT</td><td>2</td><td>2</td></tr>
<tr><td>Others</td><td>4</td><td>2</td></tr>
</tbody>
</table>
summary: Create a New RFQ
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RFQ_request"
required: true
responses:
"201":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/RFQ_response"
examples:
response:
value:
client_request_id: d83b5b1a-4d2c-4582-955c-d01abbad9e01
request_id: 3cdb0e86-5001-4b0c-bd35-0b51b3062575
amount: "1.00000000"
price: "1745.51"
total: "1745.51"
instrument: BTCEUR.SPOT
direction: buy
created_at: 2018-12-29T14:33:24.001345Z
expires_at: 2018-12-29T14:33:39.001345Z
summary: Request for Quote
/trades:
post:
tags: ["Quotes"]
description: |
<p>
Confirm the given quotation by executing a trade.
<br><br>
Quotation can only be confirmed, not changed.
<br><br>
<b>Note:</b> all parameters of the corresponding RFQ must be given again.
</p>
summary: Confirm a quote (ie execute trade)
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Trade_request"
required: true
responses:
"201":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/Trade_response"
examples:
response:
value:
client_request_id: d83b5b1a-4d2c-4582-955c-d01abbad9e01
amount: "1.00000000"
price: "3123.12345678"
total: "3123.12345678"
direction: buy
instrument: BTCEUR.SPOT
state: executed
created_at: 2018-12-29T14:33:24.001345Z
expired_date: 2018-12-29T14:33:39.001345Z
get:
tags: ["History"]
summary: List Trades
description: >
<p>
You may list all trades using this action.
<br><br>
Results can be filtered per state (allowed states are `executed`, `canceled` and `pending_confirmation`).
<br><br>
Results are paginated (see `page` & `per_page` parameter). At most 100 items are returned per query.
</p>
parameters:
- name: page
in: query
example: 1
schema:
type: number
- name: per_page
in: query
example: 50
schema:
type: number
- name: state
in: query
example: executed
schema:
type: string
responses:
"200":
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Trade_response"
examples:
response:
value:
- request_id: b1dec8dd-d33f-46d9-a6a6-e10cc721264a
client_request_id: d83b5b1a-4d2c-4582-955c-d01abbad9e01
amount: "1.231122"
price: 14545.33445544
instrument: BTCEUR.SPOT
direction: buy
state: executed
- request_id: 14a357bd-f45a-449c-854a-89af2600c26c
client_request_id: 693c39b3-90ff-4d27-9265-c42b6ce93369
amount: "0.1"
price: 345.3416656
instrument: BTCEUR.SPOT
direction: buy
state: canceled
summary: Trades
/orders:
post:
tags: ["Orders"]
summary: Post an order
description: |
You may post an order using this action.
<br><br>
<b>Orders do not requires confirmations.</b>
<br><br>
Order type are:
<ul>
<li>FOK: Fill-or-Kill Order;
<li>MKT: Market Order.
</ul>
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Order_request"
required: true
responses:
"201":
description: Successful Response
content:
application/json:
schema:
$ref: "#/components/schemas/Trade_response"
examples:
response:
value:
client_request_id: d83b5b1a-4d2c-4582-955c-d01abbad9e01
amount: "1.00000000"
price: "3123.12345678"
total: "3123.12345678"
direction: buy
instrument: BTCEUR.SPOT
state: executed
order_type: "FOK"
created_at: 2018-12-29T14:33:24.001345Z
expired_date: 2018-12-29T14:33:39.001345Z
/balances:
get:
tags: ["History"]
summary: Get balances for all currencies.
description: |
<p>
You may list all your balances using this action.
<br>
The sign of the amount indicates who owes to the other:
<br>
<ul>
<li>negative: you owe Woorton the amount ;</li>
<li>positive: Woorton owe you the amount.</li>
</ul>
</p>
responses:
"200":
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Balances"
examples:
response:
value:
USD: 0
EUR: 0
ETH: 0
BTC: 0
LTC: 0
summary: Balances
/exposures:
get:
tags: ["Misc"]
summary: Get exposure for all currencies
description: >
<p>
You may list your allowed and consumed exposure for all currencies using this action.
<br>
For each currency, you get your maximum exposure amount.
<br><br>
<b>Note:</b>
<br>
Pending settlement request are not take in account until confirmed by Woorton team ; you can contact Woorton support to increase your exposures.
</p>
responses:
"200":
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Exposures"
examples:
response:
value:
USD: 50000
EUR: 50000
ETH: 100
BTC: 10
LTC: 100
summary: Exposures
/ledger:
get:
tags: ["History"]
summary: List ledger operations.
description: >
<p>
You may list all ledger operations using this action.
</p>
Operation's category can be:
<ul>
<li>trade;</li>
<li>withdrawal;</li>
<li>deposit.</li>
</ul>
<p>
Results are paginated (see page & per_page parameter). At most 100 items are returned per query.
</p>
parameters:
- name: page
in: query
example: 1
schema:
type: number
- name: per_page
in: query
example: 50
schema:
type: number
responses:
"200":
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Ledger"
examples:
response:
value:
- operation_id: 0ea203d1-a2de-4f85-ad9e-689e422d8fae
currency: BTC
amount: "13.43554455"
category: trade
created_at: 2018-12-24T19:15:31.012345Z
- operation_id: 1f6cf143-bbe5-46d5-825e-e21814d55bc9
currency: EUR
amount: "40000.00000000"
category: deposit
created_at: 2018-12-25T13:55:34.012345Z
summary: Ledger
/instruments:
get:
tags: ["Misc"]
summary: List available instruments.
description: >
You may list all instruments using this action.
<br>
Instruments' list could change over time, please consult this list regularly.
parameters:
- name: page
in: query
example: 1
schema:
type: number
responses:
"200":
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Instruments"
summary: Instruments
servers:
- url: https://api-sandbox.woorton.com/api/v1
components:
schemas:
RFQ_request:
title: Request for Quote Request
type: object
properties:
client_request_id:
type: string
default: d83b5b1a-4d2c-4582-955c-d01abbad9e01
amount:
type: string
default: "1.0"
instrument:
type: string
example: BTCEUR.SPOT
direction:
type: string
example: buy
required:
- client_request_id
- amount
- instrument
- direction
RFQ_response:
title: Request for Quote Response
type: object
properties:
client_request_id:
type: string
default: some-client-uuid
request_id:
type: string
default: some-uuid
instrument:
type: string
example: BTCEUR.SPOT
direction:
type: string
example: buy
amount:
type: string
default: "1.0"
total:
type: number
example: "3123.12"
price:
type: number
example: "3123.12"
created_at:
type: string
example: 2018-12-23T21:51:34.001122Z
expires_at:
type: string
example: 2018-12-23T21:51:34.001122Z
Trade_request:
title: Trade
type: object
properties:
request_id:
type: string
default: some-uuid
amount:
type: string
default: "1.0"
total:
type: string
default: "3123.12345678"
instrument:
type: string
example: BTCEUR.SPOT
direction:
type: string
example: buy
Trade_response:
title: Trade
type: object
properties:
request_id:
type: string
client_request_id:
type: string
total:
type: string
example: "3123.12345678"
amount:
type: string
default: "1.0"
instrument:
type: string
example: BTCEUR.SPOT
direction:
type: string
example: buy
state:
type: string
enum:
- executed
- canceled
- pending_quote
example: executed
created_at:
type: string
example: 2018-12-23T21:51:25.001122Z
executed_at:
type: string
example: 2018-12-23T21:51:34.001122Z
Order_request:
title: Order
type: object
properties:
client_request_id:
type: string
default: some-uuid
amount:
type: string
default: "1.0"
requested_price:
type: string
default: "6500.45"
order_type:
type: string
example: "FOK"
instrument:
type: string
example: BTCEUR.SPOT
direction:
type: string
example: buy
Balances:
title: Balances
type: object
properties:
USD:
type: number
example: 0
EUR:
type: number
example: 0
BTC:
type: number
example: 0
LTC:
type: number
example: 0
XRP:
type: number
example: 0
BCH:
type: number
example: 0
Exposures:
title: Exposures
type: object
properties:
USD:
type: number
example: 0
EUR:
type: number
example: 0
BTC:
type: number
example: 0
LTC:
type: number
example: 0
XRP:
type: number
example: 0
BCH:
type: number
example: 0
Instruments:
title: Instruments
type: array
example:
instrumennts:
- ETHBTC.SPOT
- ETHUSD.SPOT
- ETHEUR.SPOT
- BTCEUR.SPOT
- BTCUSD.SPOT
- LTCUSD.SPOT
- LTCEUR.SPOT
- BCHUSD.SPOT
items: {}
Ledger:
title: Ledger
type: array
items:
type: object