@@ -105,6 +105,11 @@ tags:
105
105
106
106
The following headers are returned on every request <table> <tr> <td>Header</td><td>Description</td> </tr> <tr> <td>X-Ratelimit-Limit</td><td>Request limit per second</td> </tr> <tr> <td>X-Ratelimit-Remaining</td><td>Remaining number of requests allowed in interval</td> </tr> <tr> <td>X-Ratelimit-Reset</td><td>Duration in milliseconds until the total quota resets</td> </tr> </table>
107
107
The following header is also returned if the response is `429 Too Many Requests` <table> <tr> <td>Header</td><td>Description</td> </tr> <tr> <td>Retry-After</td><td>Duration in seconds of how long to wait before making a new request</td> </tr> </table>
108
+ - name: Trade WebSocket
109
+ description: |-
110
+ Trade WebSocket API to get real-time status updates for market data and trigger messages for:
111
+ - Order books - Subscribe to a live feed of all outstanding buy and sell orders on the market for specific coins and tokens. Send messages when specific market conditions occur.
112
+ - Trade orders - Subscribe to live status updates for your trade orders, including individual fills for an order. Send messages when statuses update.
108
113
- name: Staking Request
109
114
description: API to create, retrieve staking requests, and retrieve staking request transactions. A staking request can be of type STAKE or UNSTAKE.
110
115
- name: Staking State Information
@@ -21257,6 +21262,38 @@ paths:
21257
21262
responses:
21258
21263
'202':
21259
21264
description: Acknowledgement that the action was received
21265
+ /api/prime/trading/v1/ws:
21266
+ get:
21267
+ summary: Get WebSocket connection
21268
+ description: Establish a WebSocket connection to get real-time updates for order books and trade orders.
21269
+ operationId: trade.websocket
21270
+ tags:
21271
+ - Trade WebSocket
21272
+ parameters:
21273
+ - in: header
21274
+ name: Authorization
21275
+ required: true
21276
+ schema:
21277
+ type: string
21278
+ description: Bearer token for authorization
21279
+ requestBody:
21280
+ description: Event subscription details
21281
+ required: true
21282
+ content:
21283
+ application/json:
21284
+ schema:
21285
+ $ref: '#/components/schemas/WebSocketSubscription'
21286
+ responses:
21287
+ '101':
21288
+ description: Switching Protocols
21289
+ content:
21290
+ application/json:
21291
+ schema:
21292
+ oneOf:
21293
+ - $ref: '#/components/schemas/OrderBooksResponse'
21294
+ - $ref: '#/components/schemas/TradeOrdersResponse'
21295
+ '403':
21296
+ description: Forbidden - Missing or invalid access token header
21260
21297
/api/staking/v1/{coin}/wallets/{walletId}/requests:
21261
21298
post:
21262
21299
tags:
@@ -41616,6 +41653,47 @@ components:
41616
41653
- intentType
41617
41654
- nonce
41618
41655
- $ref: '#/components/schemas/BaseIntentWithoutNonce'
41656
+ FillUpdated:
41657
+ title: Fill Updated
41658
+ allOf:
41659
+ - $ref: '#/components/schemas/TradeBaseOrder'
41660
+ - type: object
41661
+ properties:
41662
+ cumulativeQuantity:
41663
+ type: string
41664
+ format: decimal
41665
+ description: The cumulative quantity of the fill
41666
+ averagePrice:
41667
+ type: string
41668
+ format: decimal
41669
+ description: The average price of the fill
41670
+ tradeId:
41671
+ type: string
41672
+ description: The ID of the trade
41673
+ fillQuantity:
41674
+ type: string
41675
+ format: decimal
41676
+ description: The quantity of the fill
41677
+ fillPrice:
41678
+ type: string
41679
+ format: decimal
41680
+ description: The price of the fill
41681
+ example:
41682
+ channel: orders
41683
+ time: '2019-04-25T01:02:03.045678Z'
41684
+ accountId: f230fdebfa084ffebc7e00515f54603f
41685
+ orderId: 14db12f5-4d3d-4fd8-8ced-062aa81bb4bc
41686
+ clientOrderId: my-order-1
41687
+ product: TBTC-TUSD*
41688
+ status: opened
41689
+ type: market
41690
+ side: buy
41691
+ quantity: '1.01'
41692
+ cumulativeQuantity: '0.5'
41693
+ averagePrice: '7090.1'
41694
+ tradeId: a6a9ab1b-2947-41b7-b44d-4ce61fca8b92
41695
+ fillQuantity: '0.50'
41696
+ fillPrice: '7090.1'
41619
41697
FilteringConditions:
41620
41698
type: object
41621
41699
description: |
@@ -45657,7 +45735,7 @@ components:
45657
45735
- $ref: '#/components/schemas/NewTWAPOrderRequest'
45658
45736
- $ref: '#/components/schemas/NewSteadyPaceOrderRequest'
45659
45737
NewSteadyPaceOrderRequest:
45660
- title: SteadyPace
45738
+ title: Steady Pace
45661
45739
required:
45662
45740
- product
45663
45741
- quantity
@@ -45675,7 +45753,7 @@ components:
45675
45753
description: Product name e.g. BTC-USD
45676
45754
type:
45677
45755
type: string
45678
- description: Must be set to "twap "
45756
+ description: Must be set to "steady_pace "
45679
45757
fundingType:
45680
45758
$ref: '#/components/schemas/FundingType'
45681
45759
side:
@@ -46177,6 +46255,175 @@ components:
46177
46255
filledQuantity: '0.02457152'
46178
46256
filledQuoteQuantity: '1000'
46179
46257
averagePrice: '40697.32'
46258
+ OrderBooksRequest:
46259
+ title: Order Books
46260
+ required:
46261
+ - type
46262
+ - channel
46263
+ - accountId
46264
+ - productId
46265
+ type: object
46266
+ properties:
46267
+ type:
46268
+ type: string
46269
+ description: The event type (e.g. "subscribe" or "unsubscribe")
46270
+ channel:
46271
+ type: string
46272
+ description: The subscription channel (e.g. "level2" for order books)
46273
+ accountId:
46274
+ type: string
46275
+ description: The ID of the account
46276
+ productId:
46277
+ type: string
46278
+ description: The ID of product. (e.g. "TBTC-TUSD*")
46279
+ example:
46280
+ type: subscribe
46281
+ channel: level2
46282
+ accountId: f230fdebfa084ffebc7e00515f54603f
46283
+ productId: TBTC-TUSD*
46284
+ OrderBooksResponse:
46285
+ title: Order Books Response
46286
+ type: object
46287
+ properties:
46288
+ channel:
46289
+ type: string
46290
+ description: The channel name (e.g. "level2").
46291
+ type:
46292
+ type: string
46293
+ description: The type of the response (e.g. "snapshot").
46294
+ product:
46295
+ type: string
46296
+ description: The product name (e.g. "TBTC-TUSD*").
46297
+ time:
46298
+ type: string
46299
+ format: date-time
46300
+ description: The timestamp of the snapshot.
46301
+ bids:
46302
+ type: array
46303
+ description: An array of bid levels [price, size].
46304
+ items:
46305
+ type: array
46306
+ items:
46307
+ type: string
46308
+ asks:
46309
+ type: array
46310
+ description: An array of ask levels [price, size].
46311
+ items:
46312
+ type: array
46313
+ items:
46314
+ type: string
46315
+ example:
46316
+ channel: level2
46317
+ type: snapshot
46318
+ product: TBTC-TUSD*
46319
+ time: '2020-01-01T09:35:26.465Z'
46320
+ bids:
46321
+ - - '7001.10'
46322
+ - '1.5084'
46323
+ asks:
46324
+ - - '7002.55'
46325
+ - '2.7524'
46326
+ OrderCanceled:
46327
+ title: Order Canceled
46328
+ allOf:
46329
+ - $ref: '#/components/schemas/TradeBaseOrder'
46330
+ - type: object
46331
+ properties:
46332
+ cumulativeQuantity:
46333
+ type: string
46334
+ format: decimal
46335
+ description: The cumulative quantity of the fill
46336
+ averagePrice:
46337
+ type: string
46338
+ format: decimal
46339
+ description: The average price of the fill
46340
+ example:
46341
+ channel: orders
46342
+ time: '2019-04-25T01:02:03.045678Z'
46343
+ accountId: f230fdebfa084ffebc7e00515f54603f
46344
+ orderId: 14db12f5-4d3d-4fd8-8ced-062aa81bb4bc
46345
+ clientOrderId: my-order-1
46346
+ product: TBTC-TUSD*
46347
+ status: canceled
46348
+ type: market
46349
+ side: buy
46350
+ quantity: '1.01'
46351
+ cumulativeQuantity: '0.50'
46352
+ averagePrice: '7090.1'
46353
+ OrderCompleted:
46354
+ title: Order Completed
46355
+ allOf:
46356
+ - $ref: '#/components/schemas/TradeBaseOrder'
46357
+ - type: object
46358
+ properties:
46359
+ cumulativeQuantity:
46360
+ type: string
46361
+ format: decimal
46362
+ description: The cumulative quantity of the fill
46363
+ averagePrice:
46364
+ type: string
46365
+ format: decimal
46366
+ description: The average price of the fill
46367
+ example:
46368
+ channel: orders
46369
+ time: '2019-04-25T01:02:03.045678Z'
46370
+ accountId: f230fdebfa084ffebc7e00515f54603f
46371
+ orderId: 14db12f5-4d3d-4fd8-8ced-062aa81bb4bc
46372
+ clientOrderId: my-order-1
46373
+ product: TBTC-TUSD*
46374
+ status: completed
46375
+ type: market
46376
+ side: buy
46377
+ quantity: '1.01'
46378
+ cumulativeQuantity: '1.01'
46379
+ averagePrice: '7090.1'
46380
+ OrderCreated:
46381
+ title: Order Created
46382
+ allOf:
46383
+ - $ref: '#/components/schemas/TradeBaseOrder'
46384
+ - type: object
46385
+ example:
46386
+ channel: orders
46387
+ time: '2019-04-25T01:02:03.045678Z'
46388
+ accountId: f230fdebfa084ffebc7e00515f54603f
46389
+ orderId: 14db12f5-4d3d-4fd8-8ced-062aa81bb4bc
46390
+ clientOrderId: my-order-1
46391
+ product: TBTC-TUSD*
46392
+ status: opened
46393
+ type: market
46394
+ side: buy
46395
+ quantity: '1.01'
46396
+ OrderError:
46397
+ title: Order Error
46398
+ allOf:
46399
+ - $ref: '#/components/schemas/TradeBaseOrder'
46400
+ - type: object
46401
+ properties:
46402
+ cumulativeQuantity:
46403
+ type: string
46404
+ format: decimal
46405
+ description: The cumulative quantity of the fill
46406
+ averagePrice:
46407
+ type: string
46408
+ format: decimal
46409
+ description: The average price of the fill
46410
+ message:
46411
+ type: string
46412
+ description: The error message
46413
+ example:
46414
+ channel: order
46415
+ time: '2019-04-25T01:02:03.045678Z'
46416
+ accountId: f230fdebfa084ffebc7e00515f54603f
46417
+ orderId: 14db12f5-4d3d-4fd8-8ced-062aa81bb4bc
46418
+ clientOrderId: my-order-1
46419
+ product: TBTC-TUSD*
46420
+ status: error
46421
+ message: insufficient fund
46422
+ type: market
46423
+ side: buy
46424
+ quantity: '1.01'
46425
+ cumulativeQuantity: '0.50'
46426
+ averagePrice: '7090.1'
46180
46427
OrderStatus:
46181
46428
type: string
46182
46429
enum:
@@ -51943,7 +52190,6 @@ components:
51943
52190
- second
51944
52191
- minute
51945
52192
- hour
51946
- - day
51947
52193
subOrderSize:
51948
52194
type: string
51949
52195
description: The size of each sub-order in the SteadyPace order.
@@ -52616,6 +52862,40 @@ components:
52616
52862
items:
52617
52863
$ref: '#/components/schemas/Touchpoint'
52618
52864
- $ref: '#/components/schemas/PaginatedResults'
52865
+ TradeBaseOrder:
52866
+ type: object
52867
+ properties:
52868
+ channel:
52869
+ type: string
52870
+ description: The channel you are subscribed to (e.g. "orders")
52871
+ time:
52872
+ type: string
52873
+ format: date-time
52874
+ accountId:
52875
+ type: string
52876
+ description: The ID of the account
52877
+ orderId:
52878
+ type: string
52879
+ description: The ID of the order
52880
+ clientOrderId:
52881
+ type: string
52882
+ description: Custom order ID.
52883
+ product:
52884
+ type: string
52885
+ description: Product name e.g. BTC-USD
52886
+ status:
52887
+ type: string
52888
+ description: The status of the order (e.g. "completed")
52889
+ type:
52890
+ type: string
52891
+ description: The type of order (e.g. "market", "limit", "twap")
52892
+ side:
52893
+ type: string
52894
+ description: The side of the order (e.g. "buy", "sell")
52895
+ quantity:
52896
+ type: string
52897
+ format: decimal
52898
+ description: The specified order quantity.
52619
52899
TradeBaseQuoteInbound:
52620
52900
title: TradeBaseQuoteInbound
52621
52901
oneOf:
@@ -52681,6 +52961,35 @@ components:
52681
52961
required:
52682
52962
- currency
52683
52963
- quantity
52964
+ TradeOrdersRequest:
52965
+ title: Trade Orders
52966
+ required:
52967
+ - type
52968
+ - channel
52969
+ - accountId
52970
+ type: object
52971
+ properties:
52972
+ type:
52973
+ type: string
52974
+ description: The event type (e.g. "subscribe" or "unsubscribe")
52975
+ channel:
52976
+ type: string
52977
+ description: The subscription channel (e.g. "orders" for trade orders)
52978
+ accountId:
52979
+ type: string
52980
+ description: The ID of the account
52981
+ example:
52982
+ type: subscribe
52983
+ channel: orders
52984
+ accountId: f230fdebfa084ffebc7e00515f54603f
52985
+ TradeOrdersResponse:
52986
+ title: Trade Orders Response
52987
+ oneOf:
52988
+ - $ref: '#/components/schemas/OrderCreated'
52989
+ - $ref: '#/components/schemas/FillUpdated'
52990
+ - $ref: '#/components/schemas/OrderCompleted'
52991
+ - $ref: '#/components/schemas/OrderCanceled'
52992
+ - $ref: '#/components/schemas/OrderError'
52684
52993
TradeUser:
52685
52994
required:
52686
52995
- email
@@ -59776,6 +60085,10 @@ components:
59776
60085
required:
59777
60086
- sharedStakingObjectId
59778
60087
- $ref: '#/components/schemas/SuiUnstakingIntent'
60088
+ WebSocketSubscription:
60089
+ oneOf:
60090
+ - $ref: '#/components/schemas/OrderBooksRequest'
60091
+ - $ref: '#/components/schemas/TradeOrdersRequest'
59779
60092
Webhook:
59780
60093
title: Webhook
59781
60094
type: object
0 commit comments