Trading

My orders

Changes of the user's orders.

WSSwss://ws.bit2me.com/v1/tradingmy-orders

Streams the current state of one of the user's orders each time it changes, on every market or only on symbol. Needs an authenticated connection.

Subscribe

Subscribes the connection to my-orders. Send symbol to receive only that market, or leave it out to receive every market. Authenticate the connection first: an unauthenticated connection gets Forbidden.

event*string
Valuesubscribe
symbol?string

Only this market. Every market when not sent.

Match^[A-Z0-9]+/[A-Z0-9]+$
ExampleB2M/EUR
subscription*object
Show properties
name*string
Valuemy-orders

Update

Changes of the user's orders.

The current state of one of the user's orders, sent each time it changes.

event*string
Valuemy-orders
symbol*string

Market symbol as BASE/QUOTE, uppercase. The list of valid symbols is GET /v2/trading/market-config.

Match^[A-Z0-9]+/[A-Z0-9]+$
ExampleB2M/EUR
data*object
Show properties
id?string
Formatuuid
userId?string
Formatuuid
timestamp?integer

Creation time of the order, in milliseconds since the Unix epoch.

datetime?string

Creation time of the order.

Formatdate-time
side?string

buy spends the quote currency to get the base currency; sell does the opposite.

Value inbuy | sell
symbol?string

Market symbol as BASE/QUOTE, uppercase. The list of valid symbols is GET /v2/trading/market-config.

Match^[A-Z0-9]+/[A-Z0-9]+$
ExampleB2M/EUR
price?number
stopPrice?number
amount?number

Order size in the base currency.

filled?number

Part of amount already executed.

remainingAmount?number

amount minus filled.

status?string
  • open: in the order book, waiting to be filled; may be partially filled.
  • inactive: a stop-limit order whose stopPrice has not been reached yet.
  • filled: completely executed.
  • cancelled: cancelled by the user, by Bit2Me or by its time-in-force.
Value inopen | inactive | filled | cancelled
type?string
  • limit: rests in the book at price or better.
  • market: executes immediately against the book at the best available prices.
  • stop-limit: stays inactive until the market reaches stopPrice, then becomes a limit order at price.
Value inlimit | market | stop-limit
cost?number

Value executed so far, in the quote currency.

clientOrderId?string | null
timeInForce?string
  • GTC (good 'til cancelled), the default: rests in the book until filled or cancelled.
  • FOK (fill or kill): executes completely and immediately, or is cancelled. Only for limit orders.
  • IOC (immediate or cancel): not available on Bit2Me markets.
Value inGTC | IOC | FOK
DefaultGTC
cancelationReason?string | null

Why the order was cancelled, starting with a stable CR-<n> code.

Unsubscribe

Removes the my-orders subscription. Send the same symbol used to subscribe, if any.

Removes the my-orders subscription of the connection.

event*string
Valueunsubscribe
symbol?string

The same symbol sent to subscribe, if any.

Match^[A-Z0-9]+/[A-Z0-9]+$
ExampleB2M/EUR
subscription*object
Show properties
name*string
Valuemy-orders
{  "event": "subscribe",  "subscription": {    "name": "my-orders"  }}
{  "event": "my-orders",  "symbol": "B2M/EUR",  "data": {    "id": "51002851-2f76-4c10-9b4c-bcc131f27b1d",    "userId": "7bd4cc22-7682-4e45-85b3-29386b979d75",    "timestamp": 1666006194005,    "datetime": "2022-10-17T11:29:54.005Z",    "side": "buy",    "symbol": "B2M/EUR",    "price": 1,    "stopPrice": 0,    "amount": 1000,    "filled": 10,    "remainingAmount": 990,    "status": "cancelled",    "type": "limit",    "cost": 0,    "clientOrderId": null,    "timeInForce": "GTC",    "cancelationReason": "CR-1: User request"  }}
{  "event": "unsubscribe",  "subscription": {    "name": "my-orders"  }}