My Order and Trade

This document provides example request and subscription payloads for receiving personal order and trade execution data via WebSocket.

Real-Time Streaming Method for My Orders and Trades

For my orders and trades data, the corresponding information is transmitted as a real-time stream only when an actual order or trade event occurs. Therefore, it is normal behavior that no data is received if no orders or trades happen after the connection is established.

Please refer to the WebSocket Usage Guide - Connection Management to ensure your client implementation or specifications maintain the connection even when no data is being transmitted.

Check the proper endpoint based on your region.
The examples in this page is written using Singapore fiat code(SGD). Set the quote currency to match your region. The base_url differs by country/region. Make sure to specify the correct region value for your environment.

Quotation
- Singapore (sg): wss://sg-api.upbit.com/websocket/v1
- Indonesia (id): wss://id-api.upbit.com/websocket/v1
- Thailand (th): wss://th-api.upbit.com/websocket/v1

Exchange
- Singapore (sg): wss://sg-api.upbit.com/websocket/v1/private
- Indonesia (id): wss://id-api.upbit.com/websocket/v1/private
- Thailand (th): wss://th-api.upbit.com/websocket/v1/private

Request Message Format

To request my order and trade data, after establishing the WebSocket connection, you must create a JSON object with the structure below and include it as a Data Type Object in the request message. For the full WebSocket data request message specification including Ticket and Format fields, please refer to the WebSocket Usage Guide document.

Field Name Type Description Required Default
type String myOrder Required
codes List List of trading pairs to receive.
Must be requested in uppercase.
Optional If omitted or requested as an empty array, data for all markets will be received.

Examples

[
  {
    "ticket": "0e66c0ac-7e13-43ef-91fb-2a87c2956c49"
  },
  {
    "type": "myOrder"
  }
]

// or

[
  {
    "ticket": "test-myOrder"
  },
  {
    "type": "myOrder",
    "codes": []
  }
]
[
  {
    "ticket": "0e66c0ac-7e13-43ef-91fb-2a87c2956c49"
  },
  {
    "type": "myOrder",
    "codes": ["SGD-BTC"]
  }
]
[
  {
    "ticket": "0e66c0ac-7e13-43ef-91fb-2a87c2956c49"
  },
  {
    "type": "myOrder",
    "codes": ["SGD-BTC"]
  },
  {
    "format": "JSON_LIST"
  }
]

Subscription Data Specification

New Fields Added (2025.07.02)
Due to the addition of the Self-Match Prevention (SMP) feature, the order data fields have been updated as follows. For detailed information, please refer to the related announcement and the [SMP Detailed Explanation].

  • smp_type: reduce, cancel_maker, cancel_taker
  • A new order state prevented (match prevention) has been added to the state field.
  • A new order condition post_only has been added, and post_only is now a valid value for the time_in_force field.
Field Name Abbreviation Description Type Value
typetyData typeStringmyOrder
codecdPair code (e.g., SGD-BTC)String
uuiduidUnique identifier (UUID) for the order.String
ask_bidabBuy/Sell classificationStringASK: Sell
BID: Buy
order_typeotOrder typeString limit: Limit order
price: Market buy order
market: Market sell order
best: Best limit order
statesOrder stateString wait: Waiting to be filled
watch: Pending reserved order
trade: Trade occurred
done: Fully filled
cancel: Order canceled
prevented: Match prevented
trade_uuidtuidUnique identifier (UUID) for the tradeString
pricepOrder price or trade price (when state is "trade")Double
avg_priceapAverage trade priceDouble
volumevOrder volume or trade volume (when state is trade)Double
remaining_volumervRemaining order volume after tradeDouble
executed_volumeevExecuted volumeDouble
trades_counttcNumber of trades on this orderInteger
reserved_feersfReserved fee amountDouble
remaining_feermfRemaining fee amountDouble
paid_feepfFee amount paid at the time of execution.Double
lockedlFunds locked for the orderDouble
executed_fundsefAmount executedDouble
time_in_forcetifIOC, FOK, POST ONLY order conditionsString ioc
fok
post_only
trade_feetfFee incurred upon trade
(state:trade(null if state is not trade)
Double
is_makerimMaker/taker status of the order involved in the trade
(state: trade(null if state is not trade)
Boolean true: Maker order
false: Taker order
identifieridClient-specified order identifierString
smp_typesmptSelf-match prevention type (prevents matching between maker and taker orders from the same user)String reduce: Reduce and proceed
cancel_maker: Cancel maker order
cancel_taker: Cancel taker order
prevented_volumepvOrder quantity canceled due to self-match preventionDouble
prevented_lockedplAmount canceled due to self-match prevention
(For buy orders: canceled amount in funds
For sell orders: canceled amount in volume)
Double
trade_timestampttmsTrade timestamp (ms)Long
order_timestampotmsOrder timestamp (ms)Long
timestamptmsTimestamp (ms)Long
stream_typestStream typeString REALTIME: Real-time stream
SNAPSHOT: Snapshot

Examples

{
  "type": "myOrder",
  "code": "SGD-XRP",
  "uuid": "ac2dc2a3-fce9-40a2-a4f6-5987c25c438f",
  "ask_bid": "BID",
  "order_type": "limit",
  "state": "trade",
  "trade_uuid": "68315169-fba4-4175-ade3-aff14a616657",
  "price": 0.001453,
  "avg_price": 0.00145372,
  "volume": 30925891.29839369,
  "remaining_volume": 29968038.09235948,
  "executed_volume": 30925891.29839369,
  "trades_count": 1,
  "reserved_fee": 44.23943970238218,
  "remaining_fee": 21.77177967409916,
  "paid_fee": 22.467660028283017,
  "locked": 43565.33112787242,
  "executed_funds": 44935.32005656603,
  "time_in_force": null,
  "trade_fee": 22.467660028283017,
  "is_maker": true,
  "identifier": "test-1",
  "smp_type": "cancel_maker",
  "prevented_volume": 1.174291929,
  "prevented_locked": 0.001706246173,
  "trade_timestamp": 1710751590421,
  "order_timestamp": 1710751590000,
  "timestamp": 1710751597500,
  "stream_type": "REALTIME"
}
[
  {
    "type": "myOrder",
    "code": "SGD-XRP",
    "uuid": "ac2dc2a3-fce9-40a2-a4f6-5987c25c438f",
    "ask_bid": "BID",
    "order_type": "limit",
    "state": "trade",
    "trade_uuid": "68315169-fba4-4175-ade3-aff14a616657",
    "price": 0.001453,
    "avg_price": 0.00145372,
    "volume": 30925891.29839369,
    "remaining_volume": 29968038.09235948,
    "executed_volume": 30925891.29839369,
    "trades_count": 1,
    "reserved_fee": 44.23943970238218,
    "remaining_fee": 21.77177967409916,
    "paid_fee": 22.467660028283017,
    "locked": 43565.33112787242,
    "executed_funds": 44935.32005656603,
    "time_in_force": null,
    "trade_fee": 22.467660028283017,
    "is_maker": true,
    "identifier": "test-1",
    "smp_type": "cancel_maker",
    "prevented_volume": 1.174291929,
    "prevented_locked": 0.001706246173,
    "trade_timestamp": 1710751590421,
    "order_timestamp": 1710751590000,
    "timestamp": 1710751597500,
    "stream_type": "REALTIME"
  }
]