@@ -105,6 +105,11 @@ tags:
105105
106106 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>
107107 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.
108113 - name: Staking Request
109114 description: API to create, retrieve staking requests, and retrieve staking request transactions. A staking request can be of type STAKE or UNSTAKE.
110115 - name: Staking State Information
@@ -21257,6 +21262,38 @@ paths:
2125721262 responses:
2125821263 '202':
2125921264 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
2126021297 /api/staking/v1/{coin}/wallets/{walletId}/requests:
2126121298 post:
2126221299 tags:
@@ -41616,6 +41653,47 @@ components:
4161641653 - intentType
4161741654 - nonce
4161841655 - $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'
4161941697 FilteringConditions:
4162041698 type: object
4162141699 description: |
@@ -45657,7 +45735,7 @@ components:
4565745735 - $ref: '#/components/schemas/NewTWAPOrderRequest'
4565845736 - $ref: '#/components/schemas/NewSteadyPaceOrderRequest'
4565945737 NewSteadyPaceOrderRequest:
45660- title: SteadyPace
45738+ title: Steady Pace
4566145739 required:
4566245740 - product
4566345741 - quantity
@@ -45675,7 +45753,7 @@ components:
4567545753 description: Product name e.g. BTC-USD
4567645754 type:
4567745755 type: string
45678- description: Must be set to "twap "
45756+ description: Must be set to "steady_pace "
4567945757 fundingType:
4568045758 $ref: '#/components/schemas/FundingType'
4568145759 side:
@@ -46177,6 +46255,175 @@ components:
4617746255 filledQuantity: '0.02457152'
4617846256 filledQuoteQuantity: '1000'
4617946257 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'
4618046427 OrderStatus:
4618146428 type: string
4618246429 enum:
@@ -51943,7 +52190,6 @@ components:
5194352190 - second
5194452191 - minute
5194552192 - hour
51946- - day
5194752193 subOrderSize:
5194852194 type: string
5194952195 description: The size of each sub-order in the SteadyPace order.
@@ -52616,6 +52862,40 @@ components:
5261652862 items:
5261752863 $ref: '#/components/schemas/Touchpoint'
5261852864 - $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.
5261952899 TradeBaseQuoteInbound:
5262052900 title: TradeBaseQuoteInbound
5262152901 oneOf:
@@ -52681,6 +52961,35 @@ components:
5268152961 required:
5268252962 - currency
5268352963 - 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'
5268452993 TradeUser:
5268552994 required:
5268652995 - email
@@ -59776,6 +60085,10 @@ components:
5977660085 required:
5977760086 - sharedStakingObjectId
5977860087 - $ref: '#/components/schemas/SuiUnstakingIntent'
60088+ WebSocketSubscription:
60089+ oneOf:
60090+ - $ref: '#/components/schemas/OrderBooksRequest'
60091+ - $ref: '#/components/schemas/TradeOrdersRequest'
5977960092 Webhook:
5978060093 title: Webhook
5978160094 type: object
0 commit comments