Server messages¶
Order lifecycle¶
After a place order message is received by cryptology (TBD) the following messages
will be sent over web socket connection. All order related messages are partner
specific (i.e. you can’t receive any of these messages for regular user or
other partner orders).
The time parameter is a list of two integers. The first one is a UNIX
timestamp in the UTC time zone. The second value is a number of microseconds.
BuyOrderPlaced,SellOrderPlacedorder was received by cryptology.
closed_inlineindicates an order that was fully executed immediately, it’s safe not to expect (and, therefore ignore) other messages for this order. End of order lifecycle.initial_amountequals to the full order size whileamountis the part of the order left after instant order execution and placed to the order book.{ "@type": "BuyOrderPlaced", "amount": "1", "initial_amount": "3", "closed_inline": false, "order_id": 1, "price": "1", "time": [ 946684800, 0 ], "trade_pair": "BTC_USD", "client_order_id": 123 }
BuyOrderAmountChanged,SellOrderAmountChangedorder was partially executed, sets a new amount
{ "@type": "BuyOrderAmountChanged", "amount": "1", "order_id": 1, "fee": "0.002", "time": [ 946684800, 0 ], "trade_pair": "BTC_USD", "client_order_id": 123 }
BuyOrderCancelled,SellOrderCancelledorder was canceled (manual, TTL, IOC, FOK, tbd), end of order lifecycle
{ "@type": "BuyOrderCancelled", "order_id": 1, "time": [ 946684800, 0 ], "trade_pair": "BTC_USD", "client_order_id": 123 }
BuyOrderClosed,SellOrderClosedorder was fully executed, end of order lifecycle
{ "@type": "BuyOrderClosed", "order_id": 1, "time": [ 946684800, 0 ], "trade_pair": "BTC_USD", "client_order_id": 123 }
OrderNotFoundattempt to cancel a non-existing order was made
{ "@type": "OrderNotFound", "order_id": 1 }
Wallet¶
SetBalancesets a new partner balance for a given currency.
reasoncan betradeoron_holdfor the changes caused by trades,transferfor balance update by depositing money orwithdrawas a result of a withdrawal.{ "@type": "SetBalance", "balance": "1", "change": "1", "currency": "USD", "reason": "trade", "time": [ 946684800, 0 ] }
InsufficientFundsindicates that an account doesn’t have enough funds to place an order
{ "@type": "InsufficientFunds", "order_id": 1, "currency": "USD" }
DepositTransactionAcceptedindicates transaction information when depositing funds to the account
{ "@type": "DepositTransactionAccepted", "currency": "BTC", "amount": "0.1", "transaction_info": { "to_address": "0x49293a856169d46dbf789c89b51b2ca6c7d1c4f50x4", "blockchain_tx_ids": [ "0x124129474b1dcbdb4e39436de49f7e5987f46dc4b8740966655718d7a1da699b" ] }, "time": [ 946684800, 0 ] }
WithdrawalTransactionAcceptedindicates transaction information when withdrawing funds from the account
{ "@type": "WithdrawalTransactionAccepted", "currency": "BTC", "amount": "0.1", "transaction_info": { "to_address": "0x49293a856169d46dbf789c89b51b2ca6c7d1c4f50x4", "blockchain_tx_ids": [ "0x124129474b1dcbdb4e39436de49f7e5987f46dc4b8740966655718d7a1da699b" ] }, "time": [ 946684800, 0 ] }
General¶
OwnTradesent when the account participated in a deal on either side.
makerequalstrueif the account was a maker.maker_buyequalstrueif the maker side was buying.{ "@type": "OwnTrade", "time": [ 946684800, 0 ], "trade_pair": "BTC_USD", "amount": "1", "price": "1", "maker": true, "maker_buy": false, "order_id": 1, "client_order_id": 123 }