forked from cowprotocol/services
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yml
1782 lines (1746 loc) · 58.3 KB
/
openapi.yml
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
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
version: 0.0.1
title: Order Book API
servers:
- description: Mainnet (Prod)
url: "https://api.cow.fi/mainnet"
- description: Mainnet (Staging)
url: "https://barn.api.cow.fi/mainnet"
- description: Gnosis Chain (Prod)
url: "https://api.cow.fi/xdai"
- description: Gnosis Chain (Staging)
url: "https://barn.api.cow.fi/xdai"
- description: Arbitrum One (Prod)
url: "https://api.cow.fi/arbitrum_one"
- description: Arbitrum One (Staging)
url: "https://barn.api.cow.fi/arbitrum_one"
- description: Sepolia (Prod)
url: "https://api.cow.fi/sepolia"
- description: Sepolia (Staging)
url: "https://barn.api.cow.fi/sepolia"
- description: Local
url: "http://localhost:8080"
paths:
/api/v1/orders:
post:
summary: >-
Create a new order. In order to replace an existing order with a new
one, the appData must contain a [valid replacement order
UID](https://github.com/cowprotocol/app-data/blob/main/src/schemas/v1.1.0.json#L62),
then the indicated order is cancelled, and a new one placed.
This allows an old order to be cancelled AND a new order to be created
in an atomic operation with a single signature.
This may be useful for replacing orders when on-chain prices move
outside of the original order's limit price.
responses:
"201":
description: Order has been accepted.
content:
application/json:
schema:
$ref: "#/components/schemas/UID"
"400":
description: Error during order validation.
content:
application/json:
schema:
$ref: "#/components/schemas/OrderPostError"
"403":
description: "Forbidden, your account is deny-listed."
"404":
description: No route was found quoting the order.
"429":
description: Too many order placements.
"500":
description: Error adding an order.
requestBody:
description: The order to create.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/OrderCreation"
delete:
summary: Cancel multiple orders by marking them invalid with a timestamp.
description: >
This is a *best effort* cancellation, and might not prevent solvers from
settling the orders (if the order is part of an in-flight settlement
transaction for example). Authentication must be provided by an
[EIP-712](https://eips.ethereum.org/EIPS/eip-712) signature of an
`OrderCancellations(bytes[] orderUids)` message.
requestBody:
description: Signed `OrderCancellations`.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/OrderCancellations"
responses:
"200":
description: Order(s) are cancelled.
"400":
description: Malformed signature.
content:
application/json:
schema:
$ref: "#/components/schemas/OrderCancellationError"
"401":
description: Invalid signature.
"404":
description: One or more orders were not found and no orders were cancelled.
"/api/v1/orders/{UID}":
get:
summary: Get existing order from UID.
parameters:
- in: path
name: UID
schema:
$ref: "#/components/schemas/UID"
required: true
responses:
"200":
description: Order
content:
application/json:
schema:
$ref: "#/components/schemas/Order"
"404":
description: Order was not found.
delete:
deprecated: true
summary: Cancel an order by marking it invalid with a timestamp.
description: |-
The successful deletion might not prevent solvers from settling the
order.
Authentication must be provided by providing an
[EIP-712](https://eips.ethereum.org/EIPS/eip-712) signature of an
`OrderCancellation(bytes orderUid)` message.
parameters:
- in: path
name: UID
schema:
$ref: "#/components/schemas/UID"
required: true
requestBody:
description: Signed `OrderCancellation`
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/OrderCancellation"
responses:
"200":
description: Order cancelled.
"400":
description: Malformed signature.
content:
application/json:
schema:
$ref: "#/components/schemas/OrderCancellationError"
"401":
description: Invalid signature.
"404":
description: Order was not found.
"/api/v1/orders/{UID}/status":
get:
summary: Get the status of an order.
parameters:
- in: path
name: UID
schema:
$ref: "#/components/schemas/UID"
required: true
responses:
"200":
description: >-
The order status with a list of solvers that proposed solutions (if
applicable).
content:
application/json:
schema:
$ref: "#/components/schemas/CompetitionOrderStatus"
"/api/v1/transactions/{txHash}/orders":
get:
summary: Get orders by settlement transaction hash.
parameters:
- in: path
name: txHash
schema:
$ref: "#/components/schemas/TransactionHash"
required: true
responses:
"200":
description: Order(s).
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Order"
/api/v1/trades:
get:
summary: Get existing trades.
description: |
Exactly one of `owner` or `orderUid` must be set.
parameters:
- name: owner
in: query
schema:
$ref: "#/components/schemas/Address"
required: false
- name: orderUid
in: query
schema:
$ref: "#/components/schemas/UID"
required: false
responses:
"200":
description: |-
### If `owner` is specified:
Return all trades related to that `owner`.
### If `orderUid` is specified:
Return all trades related to that `orderUid`. Given that an order
may be partially fillable, it is possible that an individual order
may have *multiple* trades.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Trade"
/api/v1/auction:
get:
summary: Get the current batch auction.
description: |-
The current batch auction that solvers should be solving right now. This
includes:
* A list of solvable orders. * The block on which the batch was created.
* Prices for all tokens being traded (used for objective value
computation).
**Note: This endpoint is currently permissioned. Reach out in discord if
you need access.**
responses:
"200":
description: Batch auction.
content:
application/json:
schema:
$ref: "#/components/schemas/Auction"
"/api/v1/account/{owner}/orders":
get:
summary: Get orders of one user paginated.
description: |-
The orders are sorted by their creation date descending (newest orders
first).
To enumerate all orders start with `offset` 0 and keep increasing the
`offset` by the total number of returned results. When a response
contains less than `limit` the last page has been reached.
parameters:
- name: owner
in: path
required: true
schema:
$ref: "#/components/schemas/Address"
- name: offset
in: query
description: |
The pagination offset. Defaults to 0.
schema:
type: integer
required: false
- name: limit
in: query
description: |
The pagination limit. Defaults to 10. Maximum 1000. Minimum 1.
schema:
type: integer
required: false
responses:
"200":
description: The orders.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Order"
"400":
description: Problem with parameters like limit being too large.
"/api/v1/token/{token}/native_price":
get:
summary: Get native price for the given token.
description: |-
Price is the exchange rate between the specified token and the network's
native currency.
It represents the amount of native token atoms needed to buy 1 atom of
the specified token.
parameters:
- name: token
in: path
required: true
schema:
$ref: "#/components/schemas/Address"
responses:
"200":
description: The estimated native price.
content:
application/json:
schema:
$ref: "#/components/schemas/NativePriceResponse"
"400":
description: Error finding the price.
"404":
description: No liquidity was found.
"500":
description: Unexpected error.
/api/v1/quote:
post:
summary: Quote a price and fee for the specified order parameters.
description: >
Given a partial order compute the minimum fee and a price estimate for
the order. Return a full order that can be used directly for signing,
and with an included signature, passed directly to the order creation
endpoint.
requestBody:
description: The order parameters to compute a quote for.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/OrderQuoteRequest"
responses:
"200":
description: Quoted order.
content:
application/json:
schema:
$ref: "#/components/schemas/OrderQuoteResponse"
"400":
description: Error quoting order.
content:
application/json:
schema:
$ref: "#/components/schemas/PriceEstimationError"
"404":
description: No route was found for the specified order.
"429":
description: Too many order quotes.
"500":
description: Unexpected error quoting an order.
"/api/v1/solver_competition/{auction_id}":
get:
summary: Get information about a solver competition.
description: |
Returns the competition information by `auction_id`.
parameters:
- name: auction_id
in: path
required: true
schema:
type: integer
responses:
"200":
description: Competition
content:
application/json:
schema:
$ref: "#/components/schemas/SolverCompetitionResponse"
"404":
description: No competition information available for this auction id.
"/api/v1/solver_competition/by_tx_hash/{tx_hash}":
get:
summary: Get information about solver competition.
description: |
Returns the competition information by `tx_hash`.
parameters:
- name: tx_hash
description: Transaction hash in which the competition was settled.
in: path
required: true
schema:
$ref: "#/components/schemas/TransactionHash"
responses:
"200":
description: Competition
content:
application/json:
schema:
$ref: "#/components/schemas/SolverCompetitionResponse"
"404":
description: No competition information available for this `tx_hash`.
/api/v1/solver_competition/latest:
get:
summary: Get information about the most recent solver competition.
description: |
Returns the competition information for the last seen auction_id.
responses:
"200":
description: Competition
content:
application/json:
schema:
$ref: "#/components/schemas/SolverCompetitionResponse"
"404":
description: No competition information available.
/api/v1/version:
get:
summary: Get the API's current deployed version.
description: >
Returns the git commit hash, branch name and release tag (code:
https://github.com/cowprotocol/services).
responses:
"200":
description: Version
content:
text/plain: { }
"/api/v1/app_data/{app_data_hash}":
get:
summary: Get the full `appData` from contract `appDataHash`.
parameters:
- in: path
name: app_data_hash
schema:
$ref: "#/components/schemas/AppDataHash"
required: true
responses:
"200":
description: Full `appData`.
content:
application/json:
schema:
$ref: "#/components/schemas/AppDataObject"
"404":
description: No full `appData` stored for this hash.
put:
summary: Registers a full `appData` so it can be referenced by `appDataHash`.
description: >
Uploads a full `appData` to orderbook so that orders created with the
corresponding `appDataHash` can be linked to the original full
`appData`.
parameters:
- in: path
name: app_data_hash
schema:
$ref: "#/components/schemas/AppDataHash"
required: true
requestBody:
description: The `appData` document to upload.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/AppDataObject"
responses:
"200":
description: The full `appData` already exists.
content:
application/json:
schema:
$ref: "#/components/schemas/AppDataHash"
"201":
description: The full `appData` was successfully registered.
content:
application/json:
schema:
$ref: "#/components/schemas/AppDataHash"
"400":
description: Error validating full `appData`
"500":
description: Error storing the full `appData`
/api/v1/app_data:
put:
summary: Registers a full `appData` and returns `appDataHash`.
description: >
Uploads a full `appData` to orderbook and returns the corresponding
`appDataHash`.
requestBody:
description: The `appData` document to upload.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/AppDataObject"
responses:
"200":
description: The full `appData` already exists.
content:
application/json:
schema:
$ref: "#/components/schemas/AppDataHash"
"201":
description: The full `appData` was successfully registered.
content:
application/json:
schema:
$ref: "#/components/schemas/AppDataHash"
"400":
description: Error validating full `appData`
"500":
description: Error storing the full `appData`
"/api/v1/users/{address}/total_surplus":
get:
summary: "Get the total surplus earned by the user. [UNSTABLE]"
description: |-
### Caution
This endpoint is under active development and should NOT be considered
stable.
parameters:
- in: path
name: address
schema:
$ref: "#/components/schemas/Address"
required: true
responses:
"200":
description: The total surplus.
content:
application/json:
schema:
$ref: "#/components/schemas/TotalSurplus"
components:
schemas:
TransactionHash:
description: 32 byte digest encoded as a hex with `0x` prefix.
type: string
example: "0xd51f28edffcaaa76be4a22f6375ad289272c037f3cc072345676e88d92ced8b5"
Address:
description: 20 byte Ethereum address encoded as a hex with `0x` prefix.
type: string
example: "0x6810e776880c02933d47db1b9fc05908e5386b96"
AppData:
description: |
The string encoding of a JSON object representing some `appData`. The
format of the JSON expected in the `appData` field is defined
[here](https://github.com/cowprotocol/app-data).
type: string
example: '{"version":"0.9.0","metadata":{}}'
AppDataHash:
description: >
32 bytes encoded as hex with `0x` prefix.
It's expected to be the hash of the stringified JSON object representing
the `appData`.
type: string
example: "0x0000000000000000000000000000000000000000000000000000000000000000"
AppDataObject:
description: An `appData` document that is registered with the API.
type: object
properties:
fullAppData:
$ref: "#/components/schemas/AppData"
required:
- appData
BigUint:
description: A big unsigned integer encoded in decimal.
type: string
example: "1234567890"
CallData:
description: >-
Some `calldata` sent to a contract in a transaction encoded as a hex
with `0x` prefix.
type: string
example: "0xca11da7a"
TokenAmount:
description: Amount of a token. `uint256` encoded in decimal.
type: string
example: "1234567890"
OnchainOrderData:
type: object
properties:
sender:
description: >
If orders are placed as on-chain orders, the owner of the order
might be a smart contract, but not the user placing the order. The
actual user will be provided in this field.
allOf:
- $ref: "#/components/schemas/Address"
placementError:
description: >
Describes the error, if the order placement was not successful. This
could happen, for example, if the `validTo` is too high, or no valid
quote was found or generated.
type: string
enum:
- QuoteNotFound
- ValidToTooFarInFuture
- PreValidationError
required:
- sender
EthflowData:
description: Provides the additional data for ethflow orders.
type: object
properties:
refundTxHash:
description: |
Specifies in which transaction the order was refunded. If
this field is null the order was not yet refunded.
allOf:
- $ref: "#/components/schemas/TransactionHash"
nullable: true
userValidTo:
description: |
Describes the `validTo` of an order ethflow order.
**NOTE**: For ethflow orders, the `validTo` encoded in the smart
contract is `type(uint256).max`.
type: integer
required:
- refundTxHash
- userValidTo
OrderKind:
description: Is this order a buy or sell?
type: string
enum:
- buy
- sell
OrderClass:
description: Order class.
type: string
enum:
- market
- limit
- liquidity
SellTokenSource:
description: Where should the `sellToken` be drawn from?
type: string
enum:
- erc20
- internal
- external
BuyTokenDestination:
description: Where should the `buyToken` be transferred to?
type: string
enum:
- erc20
- internal
PriceQuality:
description: |-
How good should the price estimate be?
Fast: The price estimate is chosen among the fastest N price estimates.
Optimal: The price estimate is chosen among all price estimates.
Verified: The price estimate is chosen among all verified/simulated
price estimates.
**NOTE**: Orders are supposed to be created from `verified` or `optimal`
price estimates.
type: string
enum:
- fast
- optimal
- verified
OrderStatus:
description: The current order status.
type: string
enum:
- presignaturePending
- open
- fulfilled
- cancelled
- expired
OrderParameters:
description: Order parameters.
type: object
properties:
sellToken:
description: ERC-20 token to be sold.
allOf:
- $ref: "#/components/schemas/Address"
buyToken:
description: ERC-20 token to be bought.
allOf:
- $ref: "#/components/schemas/Address"
receiver:
description: >
An optional Ethereum address to receive the proceeds of the trade
instead of the owner (i.e. the order signer).
allOf:
- $ref: "#/components/schemas/Address"
nullable: true
sellAmount:
description: Amount of `sellToken` to be sold in atoms.
allOf:
- $ref: "#/components/schemas/TokenAmount"
buyAmount:
description: Amount of `buyToken` to be bought in atoms.
allOf:
- $ref: "#/components/schemas/TokenAmount"
validTo:
description: Unix timestamp (`uint32`) until which the order is valid.
type: integer
appData:
$ref: "#/components/schemas/AppDataHash"
feeAmount:
description: feeRatio * sellAmount + minimal_fee in atoms.
allOf:
- $ref: "#/components/schemas/TokenAmount"
kind:
description: The kind is either a buy or sell order.
allOf:
- $ref: "#/components/schemas/OrderKind"
partiallyFillable:
description: Is the order fill-or-kill or partially fillable?
type: boolean
sellTokenBalance:
allOf:
- $ref: "#/components/schemas/SellTokenSource"
default: erc20
buyTokenBalance:
allOf:
- $ref: "#/components/schemas/BuyTokenDestination"
default: erc20
signingScheme:
allOf:
- $ref: "#/components/schemas/SigningScheme"
default: eip712
required:
- sellToken
- buyToken
- sellAmount
- buyAmount
- validTo
- appData
- feeAmount
- kind
- partiallyFillable
OrderCreation:
description: Data a user provides when creating a new order.
type: object
properties:
sellToken:
description: "see `OrderParameters::sellToken`"
allOf:
- $ref: "#/components/schemas/Address"
buyToken:
description: "see `OrderParameters::buyToken`"
allOf:
- $ref: "#/components/schemas/Address"
receiver:
description: "see `OrderParameters::receiver`"
allOf:
- $ref: "#/components/schemas/Address"
nullable: true
sellAmount:
description: "see `OrderParameters::sellAmount`"
allOf:
- $ref: "#/components/schemas/TokenAmount"
buyAmount:
description: "see `OrderParameters::buyAmount`"
allOf:
- $ref: "#/components/schemas/TokenAmount"
validTo:
description: "see `OrderParameters::validTo`"
type: integer
feeAmount:
description: "see `OrderParameters::feeAmount`"
allOf:
- $ref: "#/components/schemas/TokenAmount"
kind:
description: "see `OrderParameters::kind`"
allOf:
- $ref: "#/components/schemas/OrderKind"
partiallyFillable:
description: "see `OrderParameters::partiallyFillable`"
type: boolean
sellTokenBalance:
description: "see `OrderParameters::sellTokenBalance`"
allOf:
- $ref: "#/components/schemas/SellTokenSource"
default: erc20
buyTokenBalance:
description: "see `OrderParameters::buyTokenBalance`"
allOf:
- $ref: "#/components/schemas/BuyTokenDestination"
default: erc20
signingScheme:
$ref: "#/components/schemas/SigningScheme"
signature:
$ref: "#/components/schemas/Signature"
from:
description: >
If set, the backend enforces that this address matches what is
decoded as the *signer* of the signature. This helps catch errors
with invalid signature encodings as the backend might otherwise
silently work with an unexpected address that for example does not
have any balance.
allOf:
- $ref: "#/components/schemas/Address"
nullable: true
quoteId:
description: >
Orders can optionally include a quote ID. This way the order can be
linked to a quote and enable providing more metadata when analysing
order slippage.
type: integer
nullable: true
appData:
description: >
This field comes in two forms for backward compatibility. The hash
form will eventually stop being accepted.
anyOf:
- title: Full App Data
allOf:
- $ref: "#/components/schemas/AppData"
description: >-
**Short**:
If you do not care about `appData`, set this field to `"{}"` and
make sure that the order you signed for this request had its
`appData` field set to
`0xb48d38f93eaa084033fc5970bf96e559c33c4cdc07d889ab00b4d63f9590739d`.
**Long**:
A string encoding a JSON object like `"{"hello":"world"}"`.
This field determines the smart contract order's `appData`
field, which is assumed to be set to the `keccak256` hash of the
UTF-8 encoded bytes of this string. You must ensure that the
signature that is part of this request indeed signed a smart
contract order with the `appData` field set appropriately. If
this isn't the case, signature verification will fail. For
easier debugging it is recommended to additionally set the
`appDataHash` field.
The field must be the encoding of a valid JSON object. The JSON
object can contain arbitrary application specific data (JSON key
values). The optional key `backend` is special. It **MUST**
conform to the schema documented in `ProtocolAppData`.
The intended use of the other keys of the object is follow the
standardized format defined
[here](https://github.com/cowprotocol/app-data). Example:
```json {
"version": "0.7.0",
"appCode": "YOUR_APP_CODE",
"metadata": {}
} ```
The total byte size of this field's UTF-8 encoded bytes is
limited to 1000.
type: string
- $ref: "#/components/schemas/AppDataHash"
appDataHash:
description: >
May be set for debugging purposes. If set, this field is compared to
what the backend internally calculates as the app data hash based on
the contents of `appData`. If the hash does not match, an error is
returned. If this field is set, then `appData` **MUST** be a string
encoding of a JSON object.
allOf:
- $ref: "#/components/schemas/AppDataHash"
nullable: true
required:
- sellToken
- buyToken
- sellAmount
- buyAmount
- validTo
- appData
- feeAmount
- kind
- partiallyFillable
- signingScheme
- signature
OrderMetaData:
description: >
Extra order data that is returned to users when querying orders but not
provided by users when creating orders.
type: object
properties:
creationDate:
description: Creation time of the order. Encoded as ISO 8601 UTC.
type: string
example: "2020-12-03T18:35:18.814523Z"
class:
$ref: "#/components/schemas/OrderClass"
owner:
$ref: "#/components/schemas/Address"
uid:
$ref: "#/components/schemas/UID"
availableBalance:
description: >
Unused field that is currently always set to `null` and will be
removed in the future.
allOf:
- $ref: "#/components/schemas/TokenAmount"
nullable: true
deprecated: true
executedSellAmount:
description: >
The total amount of `sellToken` that has been executed for this
order including fees.
allOf:
- $ref: "#/components/schemas/BigUint"
executedSellAmountBeforeFees:
description: >
The total amount of `sellToken` that has been executed for this
order without fees.
allOf:
- $ref: "#/components/schemas/BigUint"
executedBuyAmount:
description: >
The total amount of `buyToken` that has been executed for this
order.
allOf:
- $ref: "#/components/schemas/BigUint"
executedFeeAmount:
description: The total amount of fees that have been executed for this order.
allOf:
- $ref: "#/components/schemas/BigUint"
invalidated:
description: Has this order been invalidated?
type: boolean
status:
description: Order status.
allOf:
- $ref: "#/components/schemas/OrderStatus"
fullFeeAmount:
description: Amount that the signed fee would be without subsidies.
allOf:
- $ref: "#/components/schemas/TokenAmount"
isLiquidityOrder:
description: |-
Liquidity orders are functionally the same as normal smart contract
orders but are not placed with the intent of actively getting
traded. Instead they facilitate the trade of normal orders by
allowing them to be matched against liquidity orders which uses less
gas and can have better prices than external liquidity.
As such liquidity orders will only be used in order to improve
settlement of normal orders. They should not be expected to be
traded otherwise and should not expect to get surplus.
type: boolean
ethflowData:
allOf:
- $ref: "#/components/schemas/EthflowData"
onchainUser:
description: >
This represents the actual trader of an on-chain order.
### ethflow orders
In this case, the `owner` would be the `EthFlow` contract and *not*
the actual trader.
allOf:
- $ref: "#/components/schemas/Address"
onchainOrderData:
description: >
There is some data only available for orders that are placed
on-chain. This data can be found in this object.
allOf:
- $ref: "#/components/schemas/OnchainOrderData"
executedSurplusFee:
description: Surplus fee that the limit order was executed with.
allOf:
- $ref: "#/components/schemas/BigUint"
nullable: true
fullAppData:
description: >
Full `appData`, which the contract-level `appData` is a hash of. See
`OrderCreation` for more information.
type: string
nullable: true
required:
- creationDate
- class
- owner
- uid
- executedSellAmount
- executedSellAmountBeforeFees
- executedBuyAmount
- executedFeeAmount
- invalidated
- status
Order:
allOf:
- $ref: "#/components/schemas/OrderCreation"
- $ref: "#/components/schemas/OrderMetaData"
AuctionOrder:
description: >
A solvable order included in the current batch auction. Contains the
data forwarded to solvers for solving.
type: object
properties:
uid:
$ref: "#/components/schemas/UID"
sellToken:
description: "see `OrderParameters::sellToken`"
allOf:
- $ref: "#/components/schemas/Address"
buyToken:
description: "see `OrderParameters::buyToken`"
allOf:
- $ref: "#/components/schemas/Address"
sellAmount:
description: "see `OrderParameters::sellAmount`"
allOf:
- $ref: "#/components/schemas/TokenAmount"
buyAmount:
description: "see `OrderParameters::buyAmount`"
allOf:
- $ref: "#/components/schemas/TokenAmount"
created:
description: Creation time of the order. Denominated in epoch seconds.
type: string
example: "123456"
validTo: