Messages

Session

FIX messages

SenderMessage NameTypeComments
ClientLogonALogon with username and password
ServerLogonALogon confirmation
BothLogout5Logout request/confirmation
BothHeartbeat0Heart beat message sent periodically by each party to verify connection is still up, in the event no data has been received after (default) 30 seconds
BothTestRequest1Test request
ClientServerLogon procedureLogout procedureTest procedureLogonLogonRejectLogoutLogoutTestRequestHeartbeatClientServer

Logon - A

TagField NameRequiredTypeComments
98EncryptMethodYint0=None
108HeartBtIntYintHeart beat interval, seconds
553UserNameYstringClient user name
554PasswordYstringClient password
141ResetSeqNumFlagYboolYes (true), FIX message sequence numbers will start from 1 on each session

Reject - 3

TagField NameRequiredTypeComments
45RefSeqNumYintMsqSeqNum<34> of the rejected message
371RefTagIDNintTag number of the offending tag in the rejected message
372RefMsgTypeNstringMsgType<35> of the rejected message
373SessionRejectReasonNintRejection code
58TextNstringError message

Logout - 5

TagField NameRequiredTypeComments
58TextNstringLogout text message

Test - 1

TagField NameRequiredTypeComments
112TestReqIDYstringIdentifier, or 'hello world' text to be returned in ensuing Heartbeat

Heartbeat - 0

TagField NameRequiredTypeComments
112TestReqIDNstringOnly required if it is in a reply to a Test message

Orders

Instant Execution

BTCS supports three order types for instant execution; all with FOK (Fill or Kill) as Time-in-Force:

  • Market: Plain vanilla market order.
  • Limit: Either the entire order can be filled within the limit set on the order, or it will be rejected.
  • Quote: The client asks for a quote, i.e. a guaranteed price to buy or sell a given quantity of an instrument. Given a quote id, the client can then submit an order and will be filled accordingly.

Event Driven Execution

BTCS supports two order types for market price driven execution; both with GTC (Good Till Cancel) as Time-in-Force:

  • Limit:
    • For sell orders: Sell the entire order quantiy at a minimum price.
    • For buy orders: Buy the entire order quantity at a maximum price.
  • Stop:
    • For sell orders: If the top-of-book bid price touches the order stop price, or is lower, then the order will be filled as plain vanilla market order.
    • For buy orders: If the top-of-book offer price touches the order stop price, or is higher, then the order will be filled as plain vanilla market order.

Strategy Execution

For execution strategies beyond the vanilla types above, BTCS supports Smart target strategy for advanced execution. Here, the order is fed to the market bit-by-bit throughout a time period which aims to give the client, on average, the best price in the market. This is intended for larger orders.

Cancellation

The client can at any time cancel an open order, which will cancel any attempts to fill the remaining quantity on the order.

Best Execution Policy

All orders are executed according to our Best Execution policy.

FIX messages

SenderMessage NameTypeComments
ClientQuoteRequestRRequest for tradeable quote
ServerQuoteSTradeable quote
ServerQuoteRequestRejectAGRejection of quote request
ClientNewOrderSingleDNew order
ServerExecutionReport8Status on an order, including acceptance, fills, cancellations and rejects
ClientOrderStatusRequestHRequest for status on an individual order
ClientOrderMassStatusRequestAFRequest for status on all orders
ClientOrderCancelRequestFRequest to cancel an order
ServerOrderCancelReject9Rejection message, if an order could not be cancelled or modified

Quote trading

ClientServerQuote request procedurealt[all good][in case of error]Quote order procedurealt[all good][in case of error]QuoteRequestQuoteQuoteRequestRejectNewOrderSingle(Quote)ExecutionReport(Filled)ExecutionReport(Rejected)ClientServer

Market and Limit Orders (FOK)

ClientServerInstant Market or Limit order procedureloop[for each fill except for the last one]alt[Order could be fully filled (FOK)][not enough liquidity (at the price limit)]alt[all good][in case of error or for FOK, not enoughliquidity]NewOrderSingle(1=Market or 2=Limit | FOK)ExecutionReport(New)ExecutionReport(PartiallyFilled)ExecutionReport(Filled)ExecutionReport(Rejected)ExecutionReport(Rejected)ClientServer

Limit, Stop, and Strategy Orders (GTC) - full accept

ClientServerEvent driven procedurealt[all good, fully accepted][in case of error]NewOrderSingle(GTC)ExecutionReport(New)ExecutionReport(Rejected)ClientServer

Limit, Stop, and Strategy Orders (GTC) - pending accept

ClientServerEvent driven procedurealt[later full acceptance by tradingdesk][problem with the order]alt[partially good, pending fullacceptance]NewOrderSingle(GTC)ExecutionReport(PendingNew)ExecutionReport(New)ExecutionReport(Rejected)ClientServer

Order Status

OrderStatusRequestOrderMassStatusRequest
ClientServerStatus on single order procedurealt[order exists][order was cancelled]opt[order does not exist]OrderStatusRequestExecutionReport(New)ExecutionReport(Cancelled)RejectClientServer
ClientServerStatus on all orders procedureloop[For each client order]OrderMassStatusRequestExecutionReportClientServer

Cancellation

ClientServerOrder cancellation procedurealt[order can be cancelled][in case of error]OrderCancelRequestExecutionReport(PendingCancel)ExecutionReport(Cancelled)OrderCancelRejectClientServer

QuoteRequest - R

TagField NameRequiredTypeComments
1AccountYstringAccount where the amount is to be deducted from; debited
131QuoteReqIDYstringUnique identifier for this request
146NoRelatedSymYint1. Number of symbols in this request. BTCS only supports a quote for a single instrument
>55SymbolYstringccyA/ccyB
>38OrderQtyYdecimalMust be positive and specifies the quantity in currency the client wants to buy or sell
>15CurrencyYstringEither ccyA or ccyB
>54SideNchar1=Buy
2=Sell
If set, the calculated commission amount is an exact amount otherwise an estimate
>8007QtyIncludesCommNboolQuantity should include the commission amount

Quote - S

The quote defines the bid- and offer prices that the client can expect to be filled at for the requested quantity and currency.

TagField NameRequiredTypeComments
117QuoteIDYstringBTCS assigned id for this quote
131QuoteReqIDYstringClient's QuoteRequest ID this quote refers to
15CurrencyYstringEither ccyA or ccyB
38OrderQtyYdecimalThe quantity to be traded
55SymbolYstringccyA/ccyB
132BidPxYdecimalBid price
133OfferPxYdecimalOffer price
126ExpireTimeYUTC TimestampWhen the quote expires
60TransactTimeYUTC TimestampTimestamp with 3 decimals when the report was created

QuoteRequestReject -AG

TagField NameRequiredTypeComments
131QuoteReqIDYstringClient's QuoteRequest ID this quote refers to
658QuoteRequestRejectReasonYintUnique rejection code
58TextNstringError description

NewOrderSingle Fields

The below is a summary of the various mandatory (m) and optional (o) order fields to support the different order and execution types.

TagField NameMarket InstantLimit InstantRFQ InstantSmartLimitStop
1Accountmmmmmm
11ClOrdIDmmmmmm
15Currencymmmmmm
38OrderQtymmmmmm
55Symbolmmmmmm
54Sidemmmmmm
60TransactionTimemmmmmm
117QuoteIDm
40OrdTypeMarketLimitPreivouslyQuotedMarketLimitStop
59TimeInForceFOKFOKFOKGTCGTCGTC
847TargetStrategySmart
126ExpireTimeomm
44Pricemm
99StopPxm

NewOrderSingle - D

TagField NameRequiredTypeComments
1AccountYstringAccount where the amount is to be deducted from; debited
11ClOrdIDYstringUnique client order
15CurrencyYstringEither ccyA or ccyB
38OrderQtyYdecimalMust be positive, and specifies the quantity the client wants to buy or sell, in currency
40OrdTypeYchar1=Market
2=Limit
3=Stop
D=Previously quoted
44PriceNdecimalLimit price
99StopPxNdecimalStop price
54SideYchar1=Buy
2=Sell
55SymbolYstringccyA/ccyB
59TimeInForceYchar4=Fill or Kill
1=Good Till Cancel
60TransactTimeYUTC TimestampTimestamp with 3 decimals when the order was created
117QuoteIDNstringBTCS assigned id for quote that should be executed. Only relevant when OrdType=D=Previously quoted
126ExpireTimeNUTC TimestampExpireTime (UTC) (For GTC)
847TargetStrategyNint0=None
100=Smart
101=TWAP
102=Scheduled
103=SoftLimit
104=DCA
8004ToAccountNstring2nd account, if it cannot be deduced from the symbol. Account where the amount will be credited to
8007QtyIncludesCommNboolQuantity should include the commission amount

ExecutionReport - 8 - Normal case

TagField NameRequiredTypeComments
1AccountYstringAccount where the amount is to be deducted from; debited
11ClOrdIDYstringUnique client order, eiter from NewOrderSingle, OrderCancelRequest, or OrderCancelReplaceRequest
41OrigClOrdIDYstringOriginal client order that was cancelled or modified
37OrderIDYstringBTCS assigned order Id
117QuoteIDNstringBTCS assigned quote Id
40OrdTypeYchar1=Market
2=Limit
3=Stop
D=Previously quoted
44PriceNdecimalLimit price
99StopPxNdecimalStop price
54SideYchar1=Buy
2=Sell
55SymbolYstringccyA/ccyB
59TimeInForceYchar4=Fill or Kill (Market, Limit, PreviouslyQuoted)
1=Good Till Cancel (Market, Limit, Stop, StopLimit)
15CurrencyYstringOriginal order currency
38OrderQtyYdecimalOriginal order quantity
17ExecIDYstringBTCS assigned execution ID to uniquely identify this execution
150ExecTypeYchar0=New
4=Cancelled
5=Replaced
8=Rejected
F=Trade (fill or partial fill)
I=Order status
39OrdStatusYcharA=PendingNew
0=New
1=PartiallyFilled
2=Filled
4=Cancelled
6=PendingCancel
8=Rejected
31LastPxNdecimalThe price for this particular fill
32LastQtyNdecimalThe quantity in currency for this particular fill
14CumQtyNdecimalCumulative sum of the fills for this order
151LeavesQtyNdecimalQuantity - Cumulative quantity
60TransactTimeYUTC TimestampTimestamp with 3 decimals when the report was created
126ExpireTimeNUTC TimestampExpireTime (UTC)
847TargetStrategyNint0=None
100=Smart
103OrdRejReasonNintUnique error code if the order was rejected
58TextNstringError description
8012AvailableToTradeNdecimalIf TradingPolicy is violated, this is a hint what could be traded instead
479CommCurrencyNstringCommission currency
12CommissionNdecimalCommission amount
584MasStatusReqIDNstringClient provided request ID, if in a reply to OrderMassStatusRequest
911TotNumReportsNintTotal number of reports to be replied, if in a reply to OrderMassStatusRequest
912LastRptRequestedNboolIs this the last report, if in a reply to OrderMassStatusRequest

ExecutionReport - 8 - Empty reply to OrderMassStatusRequest

TagField NameRequiredTypeComments
17ExecIDYstringBTCS assigned execution ID to uniquely identify this execution
150ExecTypeYcharI=Order status
60TransactTimeYUTC TimestampTimestamp with 3 decimals when the report was created
584MasStatusReqIDYstringClient provided request ID, if in a reply to OrderMassStatusRequest
911TotNumReportsYint0
912LastRptRequestedYboolY

OrderStatusRequest - H

TagField NameRequiredTypeComments
1AccountYstringAccount used for the order
11ClOrdIDYstringClient order Id this request refers to

OrderMassStatusRequest - AF

TagField NameRequiredTypeComments
1AccountYstringAn account that was used for one of the orders
584MasStatusReqIDYstringClient provided request ID
585MassStatusReqTypeYint7=All orders
11=Open orders

OrderCancelRequest - F

TagField NameRequiredTypeComments
1AccountYstringAccount used for the order
11ClOrdIDYstringUnique identifier for this request
41OrigClOrdIDYstringClient order Id of the order that should be cancelled
60TransactTimeYUTC TimestampTimestamp with 3 decimals when the request was created

OrderCancelReject - 9

TagField NameRequiredTypeComments
11ClOrdIDYstringUnique identifier for the cancellation request
41OrigClOrdIDYstringClient order Id of the order that should be cancelled
39OrdStatusYchar8=Rejected
102CxlRejReasonNintRejection code
58TextNstringRejection description
434CxlRejResponseToYchar1=OrderCancelRequest
2=OrderCancelReplaceRequest

Market Data

SenderMessage NameTypeComments
ClientMarketDataRequestVRequest to subscribe and unsubscribe to market data
ServerMarketDataRequestRejectYRejection of market data request
ServerMarketDataSnapshotFullRefreshWMarket data with the option to inlcude only top-of-book or full-book
SubscribeUnsubscribe
ClientServerMarketData subscription procedureloop[streaming prices]alt[all good][in case of error]MarketDataRequest(Subscribe)MarketDataSnapshotFullRefreshMarketDataRequestRejectClientServer
ClientServerMarketData un-subscription procedureServer simply stops sending pricesalt[all good][in case of error]MarketDataRequest(Unsubscribe)MarketDataRequestRejectClientServer

MarketDataRequest - V

TagField NameRequiredTypeComments
262MDReqIDYstringUnique identifier for the market data request. It is allowed to use the symbol, e.g. BTCUSD, as request id
263SubscriptionRequestTypeYchar1=Subsribe
2=Unsubscribe
264MarketDepthYint0=Full Book
1=Top of Book
265MDUpdateTypeYint0=Full Refresh
267NoMDEntryTypesYint2. Client wants both Bid and Offer prices. Client must specify two MDEntryType fields
>269MDEntryTypeYchar0=Bid
1=Offer
146NoRelatedSymYint1. Number of symbols in this request.
>55SymbolYstringccyA/ccyB

MarketDataRequestReject - Y

TagField NameRequiredTypeComments
262MDReqIDYstringUnique identifier for the market data request
58TextNstringReject reason
8001MarketDataRejectionCodeNintUnique code for the reason for the rejection

MarketDataSnapshotFullRefresh - W

TagField NameRequiredTypeComments
262MDReqIDYstringUnique identifier for the market data request
55SymbolYstringccyA/ccyB
268NoMDEntriesYintNumber of market data entries in this message
>269MDEntryTypeYchar0=Bid
1=Offer
>270MDEntryPxYdecimalPrice
>271MDEntrySizeYdecimalQuantity
>8002VenueIDNintId of the execution venue offering this price

Custom FIX Fields

These fields are in addition to the FIX standard.

TagField NameTypeComments
8001MarketDataRejectionCodeintUnique code for the reason for the rejection
8002VenueIDintId of the execution venue offering this price
8004ToAccountstring2nd account, if it cannot be deduced from the symbol. Account where the amount will be credited to
8007QtyIncludesCommboolQuantity should include the commission amount
8012AvailableToTradedecimalIf TradingPolicy is violated, this is a hint what could be traded instead