diff --git a/assets/FIX42-paxos.xml b/assets/FIX42-paxos.xml new file mode 100644 index 0000000..6a877f4 --- /dev/null +++ b/assets/FIX42-paxos.xml @@ -0,0 +1,363 @@ + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/docs.json b/docs.json index efa888c..1f92e99 100644 --- a/docs.json +++ b/docs.json @@ -965,6 +965,26 @@ } ] }, + { + "tab": "FIX API Reference", + "groups": [ + { + "group": "FIX API Reference", + "pages": [ + "guides/crypto-brokerage/fix/reference/index", + "guides/crypto-brokerage/fix/reference/session-messages", + "guides/crypto-brokerage/fix/reference/new-order", + "guides/crypto-brokerage/fix/reference/order-cancel", + "guides/crypto-brokerage/fix/reference/order-status", + "guides/crypto-brokerage/fix/reference/execution-report-new", + "guides/crypto-brokerage/fix/reference/execution-report-fills", + "guides/crypto-brokerage/fix/reference/execution-report-cancels", + "guides/crypto-brokerage/fix/reference/execution-report-reject-expired", + "guides/crypto-brokerage/fix/reference/encoded-tags" + ] + } + ] + }, { "tab": "Previews", "hidden": true, diff --git a/guides/crypto-brokerage/fix/index.mdx b/guides/crypto-brokerage/fix/index.mdx index 40369e4..febef93 100644 --- a/guides/crypto-brokerage/fix/index.mdx +++ b/guides/crypto-brokerage/fix/index.mdx @@ -4,7 +4,7 @@ description: Leverage the FIX protocol for crypto trading. --- -FIX (Financial Information eXchange) is an electronic messaging protocol widely adopted by financial institutions to transmit trading activity such as submitting or canceling orders and receiving execution information. The [FIX API](https://developer.paxos.com/docs/itbit/fix/) is based on FIX 4.2 and modeled after common Forex FIX implementations. +FIX (Financial Information eXchange) is an electronic messaging protocol widely adopted by financial institutions to transmit trading activity such as submitting or canceling orders and receiving execution information. The [FIX API](/guides/crypto-brokerage/fix/reference) is based on FIX 4.2 and modeled after common Forex FIX implementations. ## Get Started @@ -18,4 +18,10 @@ FIX (Financial Information eXchange) is an electronic messaging protocol widely Learn about connection management, sequence number management and testing. + + Message types, required tags, and encoded values for Paxos FIX 4.2. + + + QuickFIX-compatible FIX 4.2 data dictionary for Paxos. + diff --git a/guides/crypto-brokerage/fix/onboard.mdx b/guides/crypto-brokerage/fix/onboard.mdx index 7a9b20b..ef1d0fa 100644 --- a/guides/crypto-brokerage/fix/onboard.mdx +++ b/guides/crypto-brokerage/fix/onboard.mdx @@ -59,4 +59,4 @@ Contact support@paxos.com with test results or for help with an alternative to [ - Test the FIX implementation in the Sandbox environment by running through the [certification process](/guides/crypto-brokerage/fix/certify). - Review the [FIX best practices](/guides/crypto-brokerage/fix/best-practices). -- Read the [FIX reference documentation](https://developer.paxos.com/docs/itbit/fix/). +- Read the [FIX reference documentation](/guides/crypto-brokerage/fix/reference). diff --git a/guides/crypto-brokerage/fix/reference/encoded-tags.mdx b/guides/crypto-brokerage/fix/reference/encoded-tags.mdx new file mode 100644 index 0000000..466cb8f --- /dev/null +++ b/guides/crypto-brokerage/fix/reference/encoded-tags.mdx @@ -0,0 +1,34 @@ +--- +title: "Encoded Tags" +description: "MsgType and ExecType lookup values for Paxos FIX 4.2." +--- + +Use these tables to decode **MsgType (`35`)** and **ExecType (`150`)** values in FIX messages. + +## MsgType (`35`) + +| Value | Description | Reference | +| --- | --- | --- | +| `A` | Logon | [Session Messages](/guides/crypto-brokerage/fix/reference/session-messages#logon) | +| `D` | New Order Single | [New Order](/guides/crypto-brokerage/fix/reference/new-order) | +| `F` | Order Cancel Request | [Order Cancel](/guides/crypto-brokerage/fix/reference/order-cancel#order-cancel-request) | +| `H` | Order Status Request | [Order Status](/guides/crypto-brokerage/fix/reference/order-status#order-status-request) | +| `0` | Heartbeat | [Session Messages](/guides/crypto-brokerage/fix/reference/session-messages#heartbeat) | +| `2` | Resend Request | [Session Messages](/guides/crypto-brokerage/fix/reference/session-messages#replay-messages) | +| `8` | Execution Report | [New](/guides/crypto-brokerage/fix/reference/execution-report-new), [Fills](/guides/crypto-brokerage/fix/reference/execution-report-fills), [Cancels](/guides/crypto-brokerage/fix/reference/execution-report-cancels), [Reject & Expired](/guides/crypto-brokerage/fix/reference/execution-report-reject-expired) | +| `9` | Order Cancel Reject | [Order Cancel](/guides/crypto-brokerage/fix/reference/order-cancel#order-cancel-reject) | + +## ExecType (`150`) + +| Value | Description | Reference | +| --- | --- | --- | +| `0` | New | [Execution Report - New](/guides/crypto-brokerage/fix/reference/execution-report-new) | +| `1` | Partially Filled | [Execution Report - Partial Fill](/guides/crypto-brokerage/fix/reference/execution-report-fills) | +| `2` | Filled | [Execution Report - Filled](/guides/crypto-brokerage/fix/reference/execution-report-fills) | +| `3` | Done | | +| `4` | Canceled | [Execution Report - Canceled](/guides/crypto-brokerage/fix/reference/execution-report-cancels) | +| `6` | Pending Cancel | [Execution Report - Pending Cancel](/guides/crypto-brokerage/fix/reference/execution-report-cancels) | +| `8` | Rejected | [Execution Report - Order Reject](/guides/crypto-brokerage/fix/reference/execution-report-reject-expired#execution-report---order-reject) | +| `A` | Pending New Order | [Execution Report - Pending New](/guides/crypto-brokerage/fix/reference/execution-report-new) | +| `C` | Order Expired | [Execution Report - Expired](/guides/crypto-brokerage/fix/reference/execution-report-reject-expired#execution-report---expired) | +| `D` | Order Changed | | diff --git a/guides/crypto-brokerage/fix/reference/execution-report-cancels.mdx b/guides/crypto-brokerage/fix/reference/execution-report-cancels.mdx new file mode 100644 index 0000000..d598a05 --- /dev/null +++ b/guides/crypto-brokerage/fix/reference/execution-report-cancels.mdx @@ -0,0 +1,154 @@ +--- +title: "Execution Reports - Cancels" +description: "Pending cancel and canceled execution report message formats and fields." +--- + +## Execution Reports – Cancels + +After submitting an [Order Cancel Request](/guides/crypto-brokerage/fix/reference/order-cancel#order-cancel-request), Paxos sends two Execution Reports confirming the cancellation process: + +- **Pending Cancel** (**ExecType (`150`)** = `6`) — Acknowledgement that the cancel request was received. +- **Canceled** (**ExecType (`150`)** = `4`) — Confirmation that the order has been canceled. + + + +A Pending Cancel is **not** a guarantee of cancellation. The order may fill before the cancel is processed. If cancellation fails, an [Order Cancel Reject](/guides/crypto-brokerage/fix/reference/order-cancel#order-cancel-reject) is returned instead. + + + +### Standard FIX Fields + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `8` (Execution Report) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +### Response Fields + + + + +**ExecType (`150`)** = `6`, **OrdStatus (`39`)** = `6` (Pending Cancel). + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `54` | Side | Always | `1` = Buy, `2` = Sell | +| `150` | ExecType | Always | `6` (Pending Cancel) | +| `32` | lastShares | Always | `0` | +| `109` | ClientID | Always | | +| `1` | Account | Always | | +| `31` | LastPx | Always | `0` | +| `151` | LeavesQty | Always | Remaining unfilled quantity | +| `60` | TransactTime | Always | | +| `58` | Text | Always | `Order Cancel Pending` | +| `20` | ExecTransType | Always | `0` (New) | +| `55` | Symbol | Always | Currency pair | +| `17` | ExecID | Always | | +| `14` | CumQty | Always | Total filled quantity | +| `11` | ClOrdID | Always | ClOrdID from the cancel request | +| `44` | Price | Always | | +| `6` | AvgPx | Always | Average fill price | +| `41` | OrigClOrdID | Always | Original order ClOrdID | +| `40` | OrdType | Always | `1` = Market, `2` = Limit, `3` = Stop Market, `4` = Stop Limit | +| `39` | OrdStatus | Always | `6` (Pending Cancel) | +| `37` | OrderID | Always | | +| `381` | GrossTradeAmt | Always | **lastShares (`32`)** * **LastPx (`31`)** | +| `59` | TimeInForce | Always | `1` = GTC, `3` = IOC, `4` = FOK, `6` = GTT | + +**Conditional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `38` | OrderQty | Limit and market sell orders | Base quantity | +| `152` | CashOrderQty | Market buy orders | Fiat notional | +| `18` | ExecInst | Post-only orders | `6` (Post-Only) | +| `126` | ExpireTime | GTT orders | `YYYYMMDD-HH:MM:SS` format | + +**Brokerage Clients** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | +| `5000` | RecipientProfileId | Brokerage clients | ProfileID that receives settled currency | + +**Optional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `2362` | SelfMatchPreventionID | If enabled | Prevents self-matching. Up to 36 characters. Requires additional permissions. | + + + + +**ExecType (`150`)** = `4`, **OrdStatus (`39`)** = `4` (Canceled). + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `54` | Side | Always | `1` = Buy, `2` = Sell | +| `150` | ExecType | Always | `4` (Canceled) | +| `32` | lastShares | Always | `0` | +| `109` | ClientID | Always | | +| `1` | Account | Always | | +| `31` | LastPx | Always | `0` | +| `151` | LeavesQty | Always | Remaining unfilled quantity | +| `60` | TransactTime | Always | | +| `58` | Text | Always | `Cancelled Order` | +| `20` | ExecTransType | Always | `0` (New) | +| `55` | Symbol | Always | Currency pair | +| `17` | ExecID | Always | All zeros for canceled orders | +| `14` | CumQty | Always | Total filled quantity | +| `11` | ClOrdID | Always | ClOrdID from the cancel request | +| `44` | Price | Always | | +| `6` | AvgPx | Always | Average fill price | +| `41` | OrigClOrdID | Always | Original order ClOrdID | +| `40` | OrdType | Always | `1` = Market, `2` = Limit, `3` = Stop Market, `4` = Stop Limit | +| `39` | OrdStatus | Always | `4` (Canceled) | +| `37` | OrderID | Always | | +| `381` | GrossTradeAmt | Always | **lastShares (`32`)** * **LastPx (`31`)** | +| `59` | TimeInForce | Always | `1` = GTC, `3` = IOC, `4` = FOK, `6` = GTT | + +**Conditional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `38` | OrderQty | Limit and market sell orders | Base quantity | +| `152` | CashOrderQty | Market buy orders | Fiat notional | +| `18` | ExecInst | Post-only orders | `6` (Post-Only) | +| `126` | ExpireTime | GTT orders | `YYYYMMDD-HH:MM:SS` format | + +**Brokerage Clients** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | +| `5000` | RecipientProfileId | Brokerage clients | ProfileID that receives settled currency | + +**Optional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `2362` | SelfMatchPreventionID | If enabled | Prevents self-matching. Up to 36 characters. Requires additional permissions. | + + + + +> See also: [Order Cancel Request](/guides/crypto-brokerage/fix/reference/order-cancel#order-cancel-request) and [Order Cancel Reject](/guides/crypto-brokerage/fix/reference/order-cancel#order-cancel-reject). diff --git a/guides/crypto-brokerage/fix/reference/execution-report-fills.mdx b/guides/crypto-brokerage/fix/reference/execution-report-fills.mdx new file mode 100644 index 0000000..68f5156 --- /dev/null +++ b/guides/crypto-brokerage/fix/reference/execution-report-fills.mdx @@ -0,0 +1,159 @@ +--- +title: "Execution Reports - Fills" +description: "Partial fill and filled execution report message formats and fields." +--- + +## Execution Reports – Fills + +Paxos sends fill Execution Reports as orders match against the order book: + +- **Partial Fill** (**ExecType (`150`)** = `1`) — Sent for each individual fill. **lastShares (`32`)** and **LastPx (`31`)** contain the fill quantity and price. +- **Filled** (**ExecType (`150`)** = `2`) — Sent when the order is completely filled. **LeavesQty (`151`)** = `0`. + + + +Market buy order executions are captured in **Partial Fill** messages. The **Filled** message for market buys is a summary confirming the order is closed — it does not represent an additional execution. + + + +### Standard FIX Fields + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `8` (Execution Report) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +### Response Fields + + + + +**ExecType (`150`)** = `1`, **OrdStatus (`39`)** = `1` (Partially Filled). **LeavesQty (`151`)** > `0`. + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `54` | Side | Always | `1` = Buy, `2` = Sell | +| `150` | ExecType | Always | `1` (Partially Filled) | +| `32` | lastShares | Always | Fill quantity for this execution | +| `109` | ClientID | Always | | +| `1` | Account | Always | | +| `31` | LastPx | Always | Fill price for this execution | +| `151` | LeavesQty | Always | Remaining unfilled quantity | +| `60` | TransactTime | Always | | +| `58` | Text | Always | | +| `20` | ExecTransType | Always | `0` (New) | +| `55` | Symbol | Always | Currency pair | +| `17` | ExecID | Always | | +| `14` | CumQty | Always | Total filled quantity so far | +| `11` | ClOrdID | Always | | +| `44` | Price | Always | | +| `6` | AvgPx | Always | Average fill price | +| `40` | OrdType | Always | `1` = Market, `2` = Limit, `3` = Stop Market, `4` = Stop Limit | +| `39` | OrdStatus | Always | `1` (Partially Filled) | +| `37` | OrderID | Always | | +| `381` | GrossTradeAmt | Always | **lastShares (`32`)** * **LastPx (`31`)** | +| `59` | TimeInForce | Always | `1` = GTC, `3` = IOC, `4` = FOK, `6` = GTT | + +**Conditional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `12` | Commission | When charged | Commission paid | +| `13` | CommType | When charged | `3` (Absolute Value) | +| `38` | OrderQty | Limit and market sell orders | Base quantity | +| `152` | CashOrderQty | Market buy orders | Fiat notional | +| `18` | ExecInst | Post-only orders | `6` (Post-Only) | +| `5851` | LiquidityInd | When available | `1` = Add, `2` = Remove | +| `126` | ExpireTime | GTT orders | `YYYYMMDD-HH:MM:SS` format | + +**Brokerage Clients** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | +| `5000` | RecipientProfileId | Brokerage clients | ProfileID that receives settled currency | + +**Optional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `2362` | SelfMatchPreventionID | If enabled | Prevents self-matching. Up to 36 characters. Requires additional permissions. | + + + + +**ExecType (`150`)** = `2`, **OrdStatus (`39`)** = `2` (Filled). **LeavesQty (`151`)** = `0`. + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `54` | Side | Always | `1` = Buy, `2` = Sell | +| `150` | ExecType | Always | `2` (Filled) | +| `32` | lastShares | Always | Fill quantity for this execution | +| `109` | ClientID | Always | | +| `1` | Account | Always | | +| `31` | LastPx | Always | Fill price for this execution | +| `151` | LeavesQty | Always | `0` | +| `60` | TransactTime | Always | | +| `58` | Text | Always | | +| `20` | ExecTransType | Always | `0` (New) | +| `55` | Symbol | Always | Currency pair | +| `17` | ExecID | Always | | +| `14` | CumQty | Always | Total filled quantity | +| `11` | ClOrdID | Always | | +| `44` | Price | Always | | +| `6` | AvgPx | Always | Average fill price | +| `40` | OrdType | Always | `1` = Market, `2` = Limit, `3` = Stop Market, `4` = Stop Limit | +| `39` | OrdStatus | Always | `2` (Filled) | +| `37` | OrderID | Always | | +| `381` | GrossTradeAmt | Always | **lastShares (`32`)** * **LastPx (`31`)** | +| `59` | TimeInForce | Always | `1` = GTC, `3` = IOC, `4` = FOK, `6` = GTT | + +**Conditional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `12` | Commission | When charged | Commission paid | +| `13` | CommType | When charged | `3` (Absolute Value) | +| `38` | OrderQty | Limit and market sell orders | Base quantity | +| `152` | CashOrderQty | Market buy orders | Fiat notional | +| `18` | ExecInst | Post-only orders | `6` (Post-Only) | +| `99` | StopPx | Stop orders only | Only when OrdType is `3` or `4` | +| `5851` | LiquidityInd | When available | `1` = Add, `2` = Remove | +| `126` | ExpireTime | GTT orders | `YYYYMMDD-HH:MM:SS` format | + +**Brokerage Clients** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | +| `5000` | RecipientProfileId | Brokerage clients | ProfileID that receives settled currency | + +**Optional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `2362` | SelfMatchPreventionID | If enabled | Prevents self-matching. Up to 36 characters. Requires additional permissions. | + + + + +> See also: [Execution Reports - Cancels](/guides/crypto-brokerage/fix/reference/execution-report-cancels) and [Execution Reports - Rejected and Expired](/guides/crypto-brokerage/fix/reference/execution-report-reject-expired). diff --git a/guides/crypto-brokerage/fix/reference/execution-report-new.mdx b/guides/crypto-brokerage/fix/reference/execution-report-new.mdx new file mode 100644 index 0000000..1a631c8 --- /dev/null +++ b/guides/crypto-brokerage/fix/reference/execution-report-new.mdx @@ -0,0 +1,165 @@ +--- +title: "Execution Reports - New" +description: "Pending New and New execution report message formats and fields." +--- + +## Execution Reports – New + +After submitting a [New Order](/guides/crypto-brokerage/fix/reference/new-order), Paxos sends two Execution Reports confirming receipt and acceptance: + +- **Pending New** (**ExecType (`150`)** = `A`) — Acknowledgement that the order was received. +- **New** (**ExecType (`150`)** = `0`) — Confirmation that the order is active on the book. + +### Standard FIX Fields + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `8` (Execution Report) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +### Response Fields + + + + +**ExecType (`150`)** = `A`, **OrdStatus (`39`)** = `A` (Pending New). + + + +**OrderID (`37`)** is set to all zeros (`00000000-0000-0000-0000-000000000000`) for Pending New. The actual OrderID is assigned in the **New** execution report. + + + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `54` | Side | Always | `1` = Buy, `2` = Sell | +| `150` | ExecType | Always | `A` (Pending New) | +| `32` | lastShares | Always | `0` | +| `109` | ClientID | Always | | +| `1` | Account | Always | | +| `31` | LastPx | Always | `0` | +| `151` | LeavesQty | Always | Order quantity | +| `12` | Commission | Always | `0.0` | +| `13` | CommType | Always | `3` (Absolute Value) | +| `60` | TransactTime | Always | | +| `58` | Text | Always | `Pending New Order` | +| `20` | ExecTransType | Always | `0` (New) | +| `55` | Symbol | Always | Currency pair | +| `17` | ExecID | Always | `0` | +| `14` | CumQty | Always | `0` | +| `11` | ClOrdID | Always | | +| `44` | Price | Always | | +| `6` | AvgPx | Always | `0` | +| `41` | OrigClOrdID | Always | | +| `40` | OrdType | Always | `1` = Market, `2` = Limit, `3` = Stop Market, `4` = Stop Limit | +| `39` | OrdStatus | Always | `A` (Pending New) | +| `37` | OrderID | Always | All zeros for Pending New | +| `381` | GrossTradeAmt | Always | **lastShares (`32`)** * **LastPx (`31`)** | +| `59` | TimeInForce | Always | `1` = GTC, `3` = IOC, `4` = FOK, `6` = GTT | + +**Conditional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `38` | OrderQty | Limit and market sell orders | Base quantity | +| `152` | CashOrderQty | Market buy orders | Fiat notional | +| `18` | ExecInst | Post-only orders | `6` (Post-Only) | +| `99` | StopPx | Stop orders only | Only when OrdType is `3` or `4` | +| `126` | ExpireTime | GTT orders | `YYYYMMDD-HH:MM:SS` format | + +**Brokerage Clients** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | +| `5000` | RecipientProfileId | Brokerage clients | ProfileID that receives settled currency | + +**Optional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `2362` | SelfMatchPreventionID | If enabled | Prevents self-matching. Up to 36 characters. Requires additional permissions. | + + + + +**ExecType (`150`)** = `0`, **OrdStatus (`39`)** = `0` (New). + + + +When **ExecType (`150`)** = `D` and **ExecRestatementReason (`378`)** = `4`, a Stop Limit order has been triggered and is now active on the book. + + + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `54` | Side | Always | `1` = Buy, `2` = Sell | +| `150` | ExecType | Always | `0` (New) or `D` (Order Changed, for triggered stop limits) | +| `32` | lastShares | Always | `0` | +| `109` | ClientID | Always | | +| `1` | Account | Always | | +| `31` | LastPx | Always | `0` | +| `151` | LeavesQty | Always | Order quantity | +| `60` | TransactTime | Always | | +| `58` | Text | Always | `New Order` | +| `20` | ExecTransType | Always | `0` (New) | +| `55` | Symbol | Always | Currency pair | +| `17` | ExecID | Always | | +| `14` | CumQty | Always | `0` | +| `11` | ClOrdID | Always | | +| `44` | Price | Always | | +| `6` | AvgPx | Always | `0` | +| `41` | OrigClOrdID | Always | | +| `40` | OrdType | Always | `1` = Market, `2` = Limit, `3` = Stop Market, `4` = Stop Limit | +| `39` | OrdStatus | Always | `0` (New) | +| `37` | OrderID | Always | Assigned order ID | +| `381` | GrossTradeAmt | Always | **lastShares (`32`)** * **LastPx (`31`)** | +| `59` | TimeInForce | Always | `1` = GTC, `3` = IOC, `4` = FOK, `6` = GTT | + +**Conditional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `378` | ExecRestatementReason | Stop Limit triggers | `4` — Stop Limit order triggered (when ExecType = `D`) | +| `38` | OrderQty | Limit and market sell orders | Base quantity | +| `152` | CashOrderQty | Market buy orders | Fiat notional | +| `18` | ExecInst | Post-only orders | `6` (Post-Only) | +| `99` | StopPx | Stop orders only | Only when OrdType is `3` or `4` | +| `126` | ExpireTime | GTT orders | `YYYYMMDD-HH:MM:SS` format | + +**Brokerage Clients** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | +| `5000` | RecipientProfileId | Brokerage clients | ProfileID that receives settled currency | + +**Optional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `2362` | SelfMatchPreventionID | If enabled | Prevents self-matching. Up to 36 characters. Requires additional permissions. | + + + + +> See also: [Execution Reports - Fills](/guides/crypto-brokerage/fix/reference/execution-report-fills) for the next stage of the order lifecycle. diff --git a/guides/crypto-brokerage/fix/reference/execution-report-reject-expired.mdx b/guides/crypto-brokerage/fix/reference/execution-report-reject-expired.mdx new file mode 100644 index 0000000..fa3ae22 --- /dev/null +++ b/guides/crypto-brokerage/fix/reference/execution-report-reject-expired.mdx @@ -0,0 +1,246 @@ +--- +title: "Execution Reports - Rejected and Expired" +description: "Order reject and expired execution report message formats, rejection reason codes, and detailed failure messages." +--- + +## Execution Report - Order Reject + +If an order is rejected, Paxos returns an Execution Report with **ExecType (`150`)** = `8` and **OrdRejReason (`103`)** populated with the rejection reason. + +### Standard FIX Fields + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `8` (Execution Report) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +### Reject Response Fields + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `54` | Side | Always | `1` = Buy, `2` = Sell | +| `150` | ExecType | Always | `8` (Rejected) | +| `32` | lastShares | Always | `0` | +| `109` | ClientID | Always | | +| `1` | Account | Always | | +| `31` | LastPx | Always | `0` | +| `103` | OrdRejReason | Always | See [Rejection Reason Codes](#rejection-reason-codes--ordrejreason-103) | +| `151` | LeavesQty | Always | `0` | +| `60` | TransactTime | Always | | +| `58` | Text | Always | See [Detailed Rejection Messages](#detailed-rejection-messages--text-58) | +| `20` | ExecTransType | Always | `0` (New) | +| `55` | Symbol | Always | Currency pair | +| `17` | ExecID | Always | | +| `14` | CumQty | Always | `0` | +| `11` | ClOrdID | Always | | +| `44` | Price | Always | | +| `6` | AvgPx | Always | `0` | +| `41` | OrigClOrdID | Always | | +| `40` | OrdType | Always | `1` = Market, `2` = Limit, `3` = Stop Market, `4` = Stop Limit | +| `39` | OrdStatus | Always | `8` (Rejected) | +| `37` | OrderID | Always | | +| `381` | GrossTradeAmt | Always | `0` | +| `59` | TimeInForce | Always | `1` = GTC, `3` = IOC, `4` = FOK, `6` = GTT | + +**Conditional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `38` | OrderQty | Limit and market sell orders | Base quantity | +| `152` | CashOrderQty | Market buy orders | Fiat notional | +| `18` | ExecInst | Post-only orders | `6` (Post-Only) | +| `126` | ExpireTime | GTT orders | `YYYYMMDD-HH:MM:SS` format | + +**Brokerage Clients** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | +| `5000` | RecipientProfileId | Brokerage clients | ProfileID that receives settled currency | + +**Optional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `2362` | SelfMatchPreventionID | If enabled | Prevents self-matching. Up to 36 characters. Requires additional permissions. | + +### Rejection Reason Codes – OrdRejReason (`103`) + +| Value | Meaning | +| --- | --- | +| `0` | Broker option | +| `1` | Unknown symbol | +| `2` | Exchange closed | +| `3` | Order exceeds limit | +| `5` | Unknown order | +| `6` | Duplicate order | +| `8` | Stale order | + +### Detailed Rejection Messages – Text (`58`) + +**Validation Errors** + +| Text Value | Description | +| --- | --- | +| `ClientId Is required` | Missing ClientID field | +| `ClientOrderId Is required` | Missing ClOrdID field | +| `Account Is required` | Missing Account field | +| `Symbol Is required` | Missing Symbol field | +| `OriginalClientOrderId Is required` | Missing OrigClOrdID field | +| `HandlingInstructions Expected Value for this field is 1` | HandlInst must be `1` | +| `Side {value} is not an acceptable value for this field` | Invalid Side value | +| `OrderType {value} is not an acceptable value for this field` | Invalid OrdType value | +| `CashOrderQty Must be greater than zero` | CashOrderQty must be > 0 | +| `OrderQuantity Must be greater than zero` | OrderQty must be > 0 | +| `StopPrice Must be zero` | StopPx must be 0 for non-stop orders | +| `ExpirationTime must be of format YYYYMMDD-HH:MM:SS or YYYYMMDD-HH:MM:SS.sss` | Invalid ExpireTime format | +| `InvalidTimeInForce` | Invalid TimeInForce for this order type | +| `MissingExpirationDate` | ExpireTime required for GTT orders | +| `TimeInForce Not supported` | Unsupported TimeInForce for this order type | +| `Account Is not a GUID` | Account must be a valid GUID | +| `ClientId Is not a GUID` | ClientID must be a valid GUID | +| `Invalid Message Type` | Unsupported MsgType | + +**Business Rule Violations** + +| Text Value | Description | +| --- | --- | +| `InsufficientBalance` | Account lacks sufficient funds | +| `NotionalValueTooLarge` | Exceeds [maximum notional order size](/guides/crypto-brokerage/fix/reference/new-order#maximum-notional-order-size-by-type) | +| `InvalidPriceForTakerOrder` | Price deviates 15%+ from midpoint. See [Limit Order Taker Price Protection](/guides/crypto-brokerage/fix/reference/new-order#limit-order-taker-price-protection). | +| `MinimumCommissionExceedsNotional` | Order notional value is too small; minimum commission would exceed it | +| `InactiveInstrument` | Market is unavailable or in cancel-and-post-only mode | +| `MarketHalted` | Market is halted | +| `OrderIdentifierIsNotUniqueForUser` | Duplicate client order identifier for this user | +| `TooManyOpenOrders` | User has exceeded the maximum of 25,000 open orders. Contact your Paxos representative to request a different limit. | +| `UserNotAuthorizedForTrading` | User is not authorized to trade | +| `BlacklistedCountryForTrading` | User's country is blocked from trading | +| `UserNotExemptFromSelfMatchPrevention` | Self-match prevention triggered and user is not exempt | +| `MarketDataUnavailable` | Market data is unavailable for validation | +| `Market conditions have invalidated this order` | Market conditions prevent execution | +| `PaxAccountingUnknownError` | Internal processing error | + +**Identity and Account Errors** + +| Text Value | Description | +| --- | --- | +| `InvalidRecipientProfileId` | Invalid RecipientProfileId | +| `InvalidIdentityId` | Invalid IdentityId | +| `InvalidIdentityAccountId` | Invalid IdentityAccountId | +| `InvalidFundCommissionOption` | Invalid FundCommissionOption value | +| `DisabledIdentityId` | IdentityId is disabled | +| `DisabledIdentityAccountId` | IdentityAccountId is disabled | +| `PendingIdentityId` | IdentityId is pending approval | +| `PendingIdentityAccountId` | IdentityAccountId is pending approval | + +**Matching Engine Rejections** + +These rejections occur after the order reaches the matching engine. Unlike the enum-style values above, these use human-readable text strings. + +| Text Value | Description | +| --- | --- | +| `no open limit order on other side` | Market order rejected — no liquidity on the opposite side | +| `order marketable to existing quote/book` | Post-only order rejected — it would cross the book | +| `Stale Order` | Order became stale before it could be matched | + +--- + +## Execution Report - Expired + +Expired Execution Reports are returned for market buy orders that close with a small amount of unexecuted quote currency remaining. **ExecType (`150`)** = `C`, **OrdStatus (`39`)** = `C` (Expired). + + + +Market buy order executions are captured in [Partial Fill](/guides/crypto-brokerage/fix/reference/execution-report-fills) messages. The Expired message is a summary confirming the order is closed. + + + +### Standard FIX Fields + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `8` (Execution Report) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +### Expired Response Fields + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `54` | Side | Always | `1` = Buy, `2` = Sell | +| `150` | ExecType | Always | `C` (Expired) | +| `32` | lastShares | Always | | +| `109` | ClientID | Always | | +| `1` | Account | Always | | +| `31` | LastPx | Always | | +| `151` | LeavesQty | Always | `0` | +| `60` | TransactTime | Always | | +| `58` | Text | Always | `Expired Order` | +| `20` | ExecTransType | Always | `0` (New) | +| `55` | Symbol | Always | Currency pair | +| `17` | ExecID | Always | | +| `14` | CumQty | Always | Total filled quantity | +| `11` | ClOrdID | Always | | +| `44` | Price | Always | | +| `6` | AvgPx | Always | Average fill price | +| `40` | OrdType | Always | | +| `39` | OrdStatus | Always | `C` (Expired) | +| `37` | OrderID | Always | | +| `381` | GrossTradeAmt | Always | **lastShares (`32`)** * **LastPx (`31`)** | +| `59` | TimeInForce | Always | `1` = GTC, `3` = IOC, `4` = FOK, `6` = GTT | + +**Conditional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `12` | Commission | When charged | Commission paid | +| `13` | CommType | When charged | `3` (Absolute Value) | +| `38` | OrderQty | Limit and market sell orders | Base quantity | +| `152` | CashOrderQty | Market buy orders | Fiat notional | +| `18` | ExecInst | Post-only orders | `6` (Post-Only) | +| `5851` | LiquidityInd | When available | `1` = Add, `2` = Remove | +| `126` | ExpireTime | GTT orders | `YYYYMMDD-HH:MM:SS` format | + +**Brokerage Clients** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | +| `5000` | RecipientProfileId | Brokerage clients | ProfileID that receives settled currency | + +**Optional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `2362` | SelfMatchPreventionID | If enabled | Prevents self-matching. Up to 36 characters. Requires additional permissions. | + +> See also: [Execution Reports - Fills](/guides/crypto-brokerage/fix/reference/execution-report-fills) for fill details during the order lifecycle. diff --git a/guides/crypto-brokerage/fix/reference/index.mdx b/guides/crypto-brokerage/fix/reference/index.mdx new file mode 100644 index 0000000..cbd7337 --- /dev/null +++ b/guides/crypto-brokerage/fix/reference/index.mdx @@ -0,0 +1,36 @@ +--- +title: "FIX API Reference" +description: "Message types, required tags, and encoded values for Paxos FIX 4.2." +--- + +FIX (Financial Information eXchange) is an electronic messaging protocol widely adopted by financial institutions to transmit trading activity such as submitting or canceling orders and receiving execution information. The API is based on FIX 4.2 and modeled after common Forex FIX implementations. + + + +Just getting started? Review the [FIX onboarding guide](/guides/crypto-brokerage/fix/onboard), [FIX certification](/guides/crypto-brokerage/fix/certify), and [FIX best practices](/guides/crypto-brokerage/fix/best-practices). + + + +## Data Dictionary + +Download the Paxos FIX 4.2 data dictionary for use with [QuickFIX](https://quickfixengine.org/), [QuickFIX/J](https://www.quickfixj.org/), [QuickFIX/n](https://quickfixn.com/), and compatible FIX engines. This dictionary defines only the messages, fields, and values supported by the Paxos FIX interface, enabling strict message validation. + + + QuickFIX-compatible XML — messages, fields, and enum values for the Paxos FIX interface. + + +## Message Types + +- [Session Messages](/guides/crypto-brokerage/fix/reference/session-messages) +- [New Order](/guides/crypto-brokerage/fix/reference/new-order) +- [Order Cancel Messages](/guides/crypto-brokerage/fix/reference/order-cancel) +- [Order Status Messages](/guides/crypto-brokerage/fix/reference/order-status) +- [Execution Reports - New](/guides/crypto-brokerage/fix/reference/execution-report-new) +- [Execution Reports - Fills](/guides/crypto-brokerage/fix/reference/execution-report-fills) +- [Execution Reports - Cancels](/guides/crypto-brokerage/fix/reference/execution-report-cancels) +- [Execution Reports - Rejected and Expired](/guides/crypto-brokerage/fix/reference/execution-report-reject-expired) + +## Encoded Tags + +- [Encoded Tags](/guides/crypto-brokerage/fix/reference/encoded-tags) + diff --git a/guides/crypto-brokerage/fix/reference/new-order.mdx b/guides/crypto-brokerage/fix/reference/new-order.mdx new file mode 100644 index 0000000..2438929 --- /dev/null +++ b/guides/crypto-brokerage/fix/reference/new-order.mdx @@ -0,0 +1,247 @@ +--- +title: "New Order" +description: "New Order Single message format and fields." +--- + +## New Order + +Submit new orders as **New Order Single** with **MsgType (`35`)** set to `D`. + +### Identity Mapping + +| Paxos API Field | FIX Tag | +| --- | --- | +| `customer_id` | **Account (`1`)** | +| `profile_id` | **ClientID (`109`)** | + +### Key Field Rules + +- **Account (`1`)** is your Paxos `customer_id` and **ClientID (`109`)** is your Paxos `profile_id`. +- **Price (`44`)** must be omitted for **Market (`1`)** and **Stop Market (`3`)** orders. +- **CashOrderQty (`152`)** is required for market **buy** orders and represents the fiat notional to convert. +- **OrderQty (`38`)** is required for market **sell**, stop market sell, stop limit sell, and all limit orders. +- Send **only one** of **OrderQty (`38`)** or **CashOrderQty (`152`)**. +- **StopPx (`99`)** is required for stop market and stop limit orders. Currently only **sell stop loss** orders are supported. +- **HandlInst (`21`)** must be set to `1`. +- **Symbol (`55`)** must be the currency pair, and **SecurityType (`167`)** must be `FOR`. + +### Supported Order Types + +We support the following **OrdType (`40`)** values: + +| Order type | OrdType (`40`) | +| --- | --- | +| Market | `1` | +| Limit | `2` | +| Stop Market | `3` | +| Stop Limit | `4` | + +Post-only orders are **Limit (`2`)** orders with **ExecInst (`18`)** set to `6` (Post-Only). + +### Time In Force + +Time in force is set with **TimeInForce (`59`)**: + +| TimeInForce (`59`) | Meaning | +| --- | --- | +| `1` | Good Till Cancel (GTC) | +| `3` | Immediate or Cancel (IOC) | +| `4` | Fill or Kill (FOK) | +| `6` | Good Till Time (GTT) | + +| Order type (OrdType `40`) | Allowed TimeInForce (`59`) | Default | +| --- | --- | --- | +| Limit (`2`) | `1`, `3`, `4`, `6` | `1` (GTC) | +| Market (`1`) | `3` | `3` (IOC) | +| Stop Market (`3`) | `1`, `6` | `1` (GTC) | +| Stop Limit (`4`) | `1`, `6` | `1` (GTC) | + +For **GTT (`6`)**, include **ExpireTime (`126`)** in `YYYYMMDD-HH:MM:SS` or `YYYYMMDD-HH:MM:SS.sss` (milliseconds are ignored). + +### Tick Size Requirements + +**Price (`44`)** must align to market tick sizes for limit and stop limit orders: + +| Market | Tick size | Requirement | +| --- | --- | --- | +| XBT markets | 0.25 | **Price (`44`)** must be evenly divisible by 0.25 | +| ETH markets | 0.05 | **Price (`44`)** must be evenly divisible by 0.05 | +| All other markets | 0.01 | **Price (`44`)** must be evenly divisible by 0.01 | + +### Maximum Notional Order Size By Type + +Maximum notional limits are based on **OrdType (`40`)**: + +| Order type (OrdType `40`) | Markets | Max notional (USD) | +| --- | --- | --- | +| Limit (`2`) | XBTUSD, ETHUSD | 1,500,000 | +| Limit (`2`) | All other markets | 1,000,000 | +| Market (`1`) | All | 500,000 | + +### Limit Order Taker Price Protection + + + +Limit orders will be rejected if the order is taker and the **Price (`44`)** deviates by **15% or more** from the midpoint. + + + +For FIX/GFIX inbound orders, this rejection is returned as an **Execution Report** with: + +- **Text (`58`)** = `InvalidPriceForTakerOrder` +- **OrdRejReason (`103`)** = `0` (Broker option) + +See [Execution Report - Order Reject](/guides/crypto-brokerage/fix/reference/execution-report-reject-expired#execution-report---order-reject) for the full response format. + +### Message Format – Outgoing Message + +#### Standard FIX Fields (All Order Types) + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `D` (New Order Single) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +#### Common Order Fields (All Order Types) + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `11` | ClOrdID | Always | Client order ID (a-z, A-Z, 0-9, `.`, `-`, `_`, `$`, `:`) | +| `109` | ClientID | Always | Paxos `profile_id` | +| `1` | Account | Always | Paxos `customer_id` | +| `21` | HandlInst | Always | Must be `1` | +| `55` | Symbol | Always | Currency pair | +| `167` | SecurityType | Always | Must be `FOR` | +| `54` | Side | Always | `1` = Buy, `2` = Sell | +| `60` | TransactTime | Always | | + + + + +Set **OrdType (`40`)** to `1` (Market). **Price (`44`)** must be omitted. See [Time In Force](#time-in-force) and [Maximum Notional Order Size By Type](#maximum-notional-order-size-by-type). + +**Required** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `40` | OrdType | Always | `1` (Market) | + +**Conditional** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `152` | CashOrderQty | Market **buy** | Fiat notional to convert | +| `38` | OrderQty | Market **sell** | Base quantity | + +**Optional** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `59` | TimeInForce | To override default | Market orders default to `3` (IOC) | +| `2362` | SelfMatchPreventionID | If enabled | Requires additional permissions | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | + + + + +Set **OrdType (`40`)** to `2` (Limit). See [Tick Size Requirements](#tick-size-requirements), [Maximum Notional Order Size By Type](#maximum-notional-order-size-by-type), and [Limit Orders](#limit-orders). + +**Required** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `40` | OrdType | Always | `2` (Limit) | +| `44` | Price | Always | Must meet tick size | +| `38` | OrderQty | Always | Base quantity | + +**Conditional** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `18` | ExecInst | Post-only limit | Set to `6` | +| `126` | ExpireTime | If TimeInForce = `6` | See [Time In Force](#time-in-force) | + +**Optional** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `59` | TimeInForce | To override default | Limit orders default to `1` (GTC) | +| `2362` | SelfMatchPreventionID | If enabled | Requires additional permissions | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | + + + + +Set **OrdType (`40`)** to `3` (Stop Market). Only **sell stop loss** orders are supported. + +**Required** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `40` | OrdType | Always | `3` (Stop Market) | +| `99` | StopPx | Always | Stop price | +| `38` | OrderQty | Always | Stop Market **sell** quantity | + +**Conditional** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `126` | ExpireTime | If TimeInForce = `6` | See [Time In Force](#time-in-force) | + +**Optional** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `59` | TimeInForce | To override default | Stop Market defaults to `1` (GTC) | +| `2362` | SelfMatchPreventionID | If enabled | Requires additional permissions | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | + + + + +Set **OrdType (`40`)** to `4` (Stop Limit). See [Tick Size Requirements](#tick-size-requirements). + +**Required** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `40` | OrdType | Always | `4` (Stop Limit) | +| `44` | Price | Always | Must meet tick size | +| `99` | StopPx | Always | Stop price | +| `38` | OrderQty | Always | Base quantity | + +**Conditional** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `126` | ExpireTime | If TimeInForce = `6` | See [Time In Force](#time-in-force) | + +**Optional** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `59` | TimeInForce | To override default | Stop Limit defaults to `1` (GTC) | +| `2362` | SelfMatchPreventionID | If enabled | Requires additional permissions | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | + + + diff --git a/guides/crypto-brokerage/fix/reference/order-cancel.mdx b/guides/crypto-brokerage/fix/reference/order-cancel.mdx new file mode 100644 index 0000000..a8a99bf --- /dev/null +++ b/guides/crypto-brokerage/fix/reference/order-cancel.mdx @@ -0,0 +1,100 @@ +--- +title: "Order Cancel Messages" +description: "Order cancel request and reject message formats and fields." +--- + +## Order Cancel Request + +Submit cancel requests with **MsgType (`35`)** set to `F`. Orders can be canceled at any point by referencing the **ClOrdID (`11`)** used when submitting the order. See [Execution Report - Canceled](/guides/crypto-brokerage/fix/reference/execution-report-cancels) for the cancel confirmation response. + +### Message Format – Outgoing Message + +#### Standard FIX Fields + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `F` (Order Cancel Request) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +#### Cancel Request Fields + +**Required** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `41` | OrigClOrdID | Always | ClOrdID of the original order to cancel | +| `11` | ClOrdID | Always | New client order ID for this cancel request (a-z, A-Z, 0-9, `.`, `-`, `_`, `$`, `:`) | +| `1` | Account | Always | | +| `109` | ClientID | Always | | +| `55` | Symbol | Always | Currency pair | +| `167` | SecurityType | Always | Must be `FOR` | +| `54` | Side | Always | `1` = Buy, `2` = Sell | +| `60` | TransactTime | Always | | + +**Conditional** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `38` | OrderQty | Limit and market sell orders | Base quantity | +| `152` | CashOrderQty | Market buy orders | Fiat notional | + +--- + +## Order Cancel Reject + +If a cancel request cannot be processed, Paxos returns an **Order Cancel Reject** with **MsgType (`35`)** set to `9` and **CxlRejReason (`102`)** populated. + +### Message Format – Response Message + +#### Standard FIX Fields + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `9` (Order Cancel Reject) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +#### Cancel Reject Fields + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `434` | CxlRejResponseTo | Always | `1` = Order Cancel Request | +| `11` | ClOrdID | Always | ClOrdID from the cancel request | +| `39` | OrdStatus | Always | Current order status | +| `41` | OrigClOrdID | Always | Original order ClOrdID | +| `37` | OrderID | Always | | +| `1` | Account | Always | | +| `102` | CxlRejReason | Always | See rejection reasons below | + +### Rejection Reasons – CxlRejReason (`102`) + +| Value | Meaning | When | +| --- | --- | --- | +| `0` | Too late to cancel | Order is already filled, cancelled, or rejected | +| `1` | Unknown order | Order not found or invalid client order identifier | +| `2` | Broker option | General rejection (e.g., too early to cancel, invalid wallet) | +| `3` | Already pending cancel | A cancel request is already being processed for this order | +| `99` | Other | Market is unavailable | diff --git a/guides/crypto-brokerage/fix/reference/order-status.mdx b/guides/crypto-brokerage/fix/reference/order-status.mdx new file mode 100644 index 0000000..8e1cdf9 --- /dev/null +++ b/guides/crypto-brokerage/fix/reference/order-status.mdx @@ -0,0 +1,126 @@ +--- +title: "Order Status Messages" +description: "Order status request and status execution report message formats and fields." +--- + +## Order Status Request + +Query the current status of an order with **MsgType (`35`)** set to `H`. + +### Message Format – Outgoing Message + +#### Standard FIX Fields + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `H` (Order Status Request) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +#### Status Request Fields + +**Required** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `11` | ClOrdID | Always | Client order ID of the order to query (a-z, A-Z, 0-9, `.`, `-`, `_`, `$`, `:`) | +| `109` | ClientID | Always | | +| `1` | Account | Always | | +| `55` | Symbol | Always | Currency pair | +| `54` | Side | Always | `1` = Buy, `2` = Sell | + +--- + +## Execution Report - Order Status + +The response is an Execution Report containing the order's current state, with **ExecTransType (`20`)** set to `3` (Status). + + + +**lastShares (`32`)** and **LastPx (`31`)** contain the price and quantity of the most recent fill. A completed order has **LeavesQty (`151`)** = `0`. Note: lastShares was relabeled as lastQty in later FIX versions; the tag number and purpose are identical. + + + +### Message Format – Response Message + +#### Standard FIX Fields + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `8` (Execution Report) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +#### Order Status Fields + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `54` | Side | Always | `1` = Buy, `2` = Sell | +| `150` | ExecType | Always | Current execution type | +| `32` | lastShares | Always | Quantity of the latest fill (`0` if no fills) | +| `109` | ClientID | Always | | +| `1` | Account | Always | | +| `31` | LastPx | Always | Price of the latest fill (`0` if no fills) | +| `151` | LeavesQty | Always | Remaining quantity (`0` for completed orders) | +| `60` | TransactTime | Always | | +| `58` | Text | Always | | +| `20` | ExecTransType | Always | `3` (Status) | +| `55` | Symbol | Always | Currency pair | +| `17` | ExecID | Always | | +| `14` | CumQty | Always | Total filled quantity | +| `11` | ClOrdID | Always | | +| `44` | Price | Always | | +| `6` | AvgPx | Always | Average fill price | +| `41` | OrigClOrdID | Always | | +| `40` | OrdType | Always | `1` = Market, `2` = Limit, `3` = Stop Market, `4` = Stop Limit | +| `39` | OrdStatus | Always | Current order status | +| `37` | OrderID | Always | | +| `381` | GrossTradeAmt | Always | **lastShares (`32`)** * **LastPx (`31`)** | +| `59` | TimeInForce | Always | `1` = GTC, `3` = IOC, `4` = FOK, `6` = GTT | + +**Conditional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `38` | OrderQty | Limit and market sell orders | Base quantity | +| `152` | CashOrderQty | Market buy orders | Fiat notional | +| `18` | ExecInst | Post-only orders | `6` (Post-Only) | +| `99` | StopPx | Stop orders only | Only when OrdType is `3` or `4` | +| `126` | ExpireTime | GTT orders | `YYYYMMDD-HH:MM:SS` format | + +**Brokerage Clients** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `5047` | AllocBrokerAccountID | Brokerage clients | IdentityAccountId | +| `50` | SenderSubID | Brokerage clients | IdentityId | +| `5074` | FundCommissionOption | Brokerage clients | | +| `5000` | RecipientProfileId | Brokerage clients | ProfileID that receives settled currency | + +**Optional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `2362` | SelfMatchPreventionID | If enabled | Prevents self-matching. Up to 36 characters. Requires additional permissions. | diff --git a/guides/crypto-brokerage/fix/reference/session-messages.mdx b/guides/crypto-brokerage/fix/reference/session-messages.mdx new file mode 100644 index 0000000..ec80f15 --- /dev/null +++ b/guides/crypto-brokerage/fix/reference/session-messages.mdx @@ -0,0 +1,285 @@ +--- +title: "Session Messages" +description: "Logon, logout, heartbeat, replay, and reject message formats and fields." +--- + +## Logon + +Initiate a FIX session with a **Logon** message — **MsgType (`35`)** set to `A`. Set **EncryptMethod (`98`)** to `0` and **HeartBtInt (`108`)** to the desired interval (default: `30` seconds). + +### Message Format + +#### Standard FIX Fields + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `A` (Logon) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +#### Logon Fields + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `98` | EncryptMethod | Always | Must be `0` | +| `108` | HeartBtInt | Always | Heartbeat interval in seconds (default: `30`) | + + + + +Send the Logon message to initiate the session: + +| Tag | Field | Value | Notes | +| --- | --- | --- | --- | +| `49` | SenderCompID | Your client ID | | +| `56` | TargetCompID | `ITBIT` | | + + + + +Paxos responds with a matching Logon message: + +| Tag | Field | Value | Notes | +| --- | --- | --- | --- | +| `49` | SenderCompID | `ITBIT` | | +| `56` | TargetCompID | Your client ID | | + + + + +--- + +## Logon with Reset Sequence Number Flag + +Reset sequence numbers on both sides by sending a Logon with **ResetSeqNumFlag (`141`)** set to `Y`. + + + +Implement a [sequence number management](/guides/crypto-brokerage/fix/best-practices#sequence-number-management) strategy to promote a stable trading environment. + + + +### Message Format + +Uses the same [Standard FIX Fields](#standard-fix-fields) and [Logon Fields](#logon-fields) as a regular Logon, plus: + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `141` | ResetSeqNumFlag | Always | `Y` — reset sequence numbers on both sides | + + + + +Send the Logon with **ResetSeqNumFlag (`141`)** = `Y`. + + + + +Paxos responds with a matching Logon that also includes **ResetSeqNumFlag (`141`)** = `Y`. + + + + +--- + +## Replay Messages + +Request retransmission of messages with a **Resend Request** — **MsgType (`35`)** set to `2`. Use this when a gap in sequence numbers is detected, a message is lost, or higher-than-expected sequence numbers arrive from the counterparty. + +### Resend Scenarios + +| Scenario | BeginSeqNo (`7`) | EndSeqNo (`16`) | +| --- | --- | --- | +| Single message | N | N (same value) | +| Range of messages | First in range | Last in range | +| All subsequent messages | N | `0` | + +### Message Format + +#### Standard FIX Fields + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `2` (Resend Request) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + + + + +**Required** + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `7` | BeginSeqNo | Always | First message sequence number in range | +| `16` | EndSeqNo | Always | Last message sequence number in range (`0` for all subsequent) | + + + + +Paxos resends the requested messages sequentially. Resent messages include: + +**Required** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `7` | BeginSeqNo | Always | First message sequence number in range | +| `16` | EndSeqNo | Always | Last message sequence number in range | + +**Conditional** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `43` | PossDupFlag | Retransmitted messages | `Y` — indicates possible retransmission | +| `122` | OrigSendingTime | Retransmitted messages | Original time of message transmission | + + + + +--- + +## Heartbeat + +Monitor the FIX connection with **Heartbeat** messages — **MsgType (`35`)** set to `0`. The default **HeartBtInt (`108`)** interval is `30` seconds. + +### Key Behavior + +- Reset the heartbeat timer after **every transmitted message**, not just heartbeats. +- If no data is received within the heartbeat interval, send a **Test Request** (MsgType `1`) to verify the connection. +- Include **TestReqID (`112`)** to match Test Requests with Heartbeat responses. Any string can be used (a timestamp is recommended). +- If no Heartbeat response arrives in a reasonable time, consider the connection lost. + +### Message Format + +#### Standard FIX Fields + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `0` (Heartbeat) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +#### Heartbeat Fields + +| Tag | Field | When to Include | Notes | +| --- | --- | --- | --- | +| `112` | TestReqID | In response to a Test Request | Echoes the TestReqID from the Test Request | + + + + +Send a Heartbeat when no message has been sent within the **HeartBtInt** interval, or in response to a Test Request. + + + + +Paxos responds to Test Requests with a Heartbeat containing the matching **TestReqID (`112`)**. + + + + +--- + +## Reject + +A **Reject** message — **MsgType (`35`)** set to `3` — is sent when a message cannot be processed due to a session-level rule violation. + +### Message Format – Response Message + +#### Standard FIX Fields + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `3` (Reject) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +#### Reject Fields + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `45` | RefSeqNum | Always | Sequence number of the rejected message | +| `58` | Text | Always | Human-readable reason for the reject | +| `373` | SessionRejectReason | Always | Reject reason code | + +--- + +## Logout + +A **Logout** message — **MsgType (`35`)** set to `5` — initiates or confirms FIX session termination. + + + +Disconnection without exchanging Logout messages indicates an abnormal condition. An unsolicited Logout may indicate a connection or account issue — **Text (`58`)** contains a human-readable message. If you cannot reconnect with **ResetSeqNumFlag (`141`)** set to `Y`, contact [Support](https://support.paxos.com). + + + +### Message Format – Incoming Message + +#### Standard FIX Fields + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `8` | BeginString | Always | Standard FIX header | +| `9` | BodyLength | Always | Standard FIX header | +| `35` | MsgType | Always | `5` (Logout) | +| `49` | SenderCompID | Always | Standard FIX header | +| `56` | TargetCompID | Always | Standard FIX header | +| `34` | MsgSeqNum | Always | Standard FIX header | +| `52` | SendingTime | Always | Standard FIX header | + +#### Standard FIX Trailer + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `10` | CheckSum | Always | | + +#### Logout Fields + +**Always Present** + +| Tag | Field | When Present | Notes | +| --- | --- | --- | --- | +| `58` | Text | Always | Human-readable message indicating any issues | diff --git a/guides/crypto-brokerage/index.mdx b/guides/crypto-brokerage/index.mdx index d7d66c9..d700db1 100644 --- a/guides/crypto-brokerage/index.mdx +++ b/guides/crypto-brokerage/index.mdx @@ -9,7 +9,7 @@ description: "Add crypto to your application using REST, FIX and WebSocket APIs. - Leverage the [Paxos FIX API](https://developer.paxos.com/docs/itbit/fix/) to trade crypto. + Leverage the [Paxos FIX API](/guides/crypto-brokerage/fix/reference) to trade crypto. Learn more about [FIX](/guides/crypto-brokerage/fix/index) and check out the [onboarding](/guides/crypto-brokerage/fix/onboard) and [certification](/guides/crypto-brokerage/fix/certify) guides to get started. diff --git a/guides/crypto-brokerage/orders-precision-rounding.mdx b/guides/crypto-brokerage/orders-precision-rounding.mdx index 328db6f..a2e9a74 100644 --- a/guides/crypto-brokerage/orders-precision-rounding.mdx +++ b/guides/crypto-brokerage/orders-precision-rounding.mdx @@ -17,7 +17,7 @@ For information on other markets, [contact support](https://support.paxos.com). - For market buy orders, the minimum quantity is 0.01 USD for all assets. For market sell or limit orders, the minimum size is eight ticks: 0.00000001 (1e-8). - For market orders, the maximum notional value is 500,000 USD. For limit orders, the maximum notional value is 1,500,000 USD for XBTUSD and ETHUSD markets, and 1,000,000 USD for other markets. - A taker order will be rejected if its limit price is 15% or more from the midpoint of the best bid and best ask. -- For a comprehensive look at order constraints, please refer to our the documentation for the [Paxos v2 REST API docs](/api-reference) or the [Paxos FIX API Reference page](https://developer.paxos.com/docs/itbit/fix/) +- For a comprehensive look at order constraints, please refer to our the documentation for the [Paxos v2 REST API docs](/api-reference) or the [Paxos FIX API Reference page](/guides/crypto-brokerage/fix/reference) ## Tick and Decimal Precision for REST and WebSocket Clients