내 주문 및 체결 (MyOrder)

📘

Private 타입 endpoint

새롭게 추가된 myOrdermyAsset 타입의 경우 wss://api.upbit.com/websocket/v1/private 으로 요청하셔야 합니다. 자세한 내용은 기본 정보 를 참고해주시기 바랍니다.

Request

요청은 JSON Object를 이용하며 응답 또한 JSON Object 입니다. 요청은 크게 ticket field, type field, format field 로 나누어지며 하나의 요청에 여러 개의 type field 를 명시할 수 있습니다. ticket field 와 format field 에 대해서는 요청 방법 및 포맷을 참고해주시기 바랍니다.

📘

Request format

[{Ticket Field},{Type Field},....,{Type Field},{Format Field}]

Type Field

수신하고 싶은 시세 정보를 나열하는 필드입니다.

필드명
타입
내용
필수 여부
기본 값
typeString데이터 타입
myOrder: 내 주문
O
codesList마켓 코드 리스트
*대문자로 요청해야 합니다.
X생략하거나 빈 배열로 요청할 경우 모든 마켓에 대한 정보를 수신합니다.

Response

📘

  • 자전거래 체결 방지 (Self-Match Prevention) 주문 옵션 필드가 추가됩니다. (상세 설명 바로가기)
    • smp_type : reduce, cancel_maker, cancel_taker
  • 주문 상태 state 필드에 prevented (체결 방지) 타입이 신규로 추가됩니다.
  • 신규 주문 조건 post_only가 추가되어 time_in_force 필드에 post_only 타입이 신규로 추가됩니다.
❗️

myOrder 타입의 경우 특정 이벤트가 발생할 때만 데이터를 전송합니다.

따라서, 연결 후 즉시 데이터가 수신되지 않는 경우는 정상적인 동작입니다. 주문의 생성/체결/취소와 같은 이벤트가 발생할 때 데이터가 전송됩니다.
데이터 없이도 연결을 유지하고 싶으신 경우 주기적으로 ping/pong 을 통해 connection 관리를 하실 수 있습니다.

Example

Request

예제 1. 모든 마켓 정보 수신 (codes 필드 제외)

[
  {
    "ticket": "test-myOrder"
  },
  {
    "type": "myOrder"
  }
]

예제 2. 모든 마켓 정보 수신 (codes 에 빈 배열)

[
  {
    "ticket": "test-myOrder"
  },
  {
    "type": "myOrder",
    "codes": []
  }
]

예제 3. 특정 마켓 정보 수신

[
  {
    "ticket": "test-myOrder"
  },
  {
    "type": "myOrder",
    "codes": ["KRW-BTC"]
  }
]

Response

{
  "type": "myOrder",
  "code": "KRW-BTC",
  "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"
}
※ This English version is a translation of the original Korean version of the Upbit Developer Center, generated using a third-party tool. In the event of any discrepancies, the Korean version shall take precedence.