Post a New Order
Submits a signed order to the matching engine for processing. Depending on available liquidity, the order may rest on the book as a limit, fill immediately, or be rejected outright.
Endpoint
Section titled “Endpoint”POST /order
Base URL: https://api.openfish.fun
Authentication
Section titled “Authentication”L2 authentication required. All five OPENFISH_* headers must be present.
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
order | object | Yes | The signed order object (see below) |
owner | string | No | UUID of the API key owner |
orderType | string | No | Time in force: GTC, FOK, GTD, FAK. Default: GTC |
postOnly | boolean | No | If true, order is rejected if it would immediately match. Default: false |
deferExec | boolean | No | If true, order is inserted into the book but not submitted to the matching engine. Status is set to DEFERRED. Default: false |
Order Object
Section titled “Order Object”| Field | Type | Required | Description |
|---|---|---|---|
tokenId | string | Yes | Token ID (asset ID) for the order |
maker | string | Yes | Ethereum address of the maker (proxy address) |
signer | string | Yes | Ethereum address of the signer |
taker | string | Yes | Taker address (0x0 for open orders) |
side | string | Yes | BUY or SELL |
makerAmount | string | Yes | Amount maker provides (6-decimal fixed-point) |
takerAmount | string | Yes | Amount taker provides (6-decimal fixed-point) |
expiration | string | Yes | UNIX timestamp when the order expires |
nonce | string | Yes | Order nonce |
feeRateBps | string | Yes | Fee rate in basis points |
signature | string | Yes | Cryptographic signature of the order |
salt | integer | Yes | Random salt for order uniqueness |
signatureType | integer | Yes | 0 (EOA), 1 (OPENFISH_PROXY), 2 (GNOSIS_SAFE) |
Example Request
Section titled “Example Request”{ "order": { "tokenId": "0xabc123...", "maker": "0x1234567890123456789012345678901234567890", "signer": "0x1234567890123456789012345678901234567890", "taker": "0x0000000000000000000000000000000000000000", "side": "BUY", "makerAmount": "100000000", "takerAmount": "200000000", "expiration": "1735689600", "nonce": "0", "feeRateBps": "10", "signature": "0x1234abcd...", "salt": 1234567890, "signatureType": 2 }, "orderType": "GTC", "postOnly": false}Response
Section titled “Response”{ "success": true, "orderID": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "LIVE", "makingAmount": "100000000", "takingAmount": "200000000", "transactionsHashes": [], "tradeIds": [], "errorMsg": ""}| Field | Type | Description |
|---|---|---|
success | boolean | Indicates whether the engine accepted the order |
orderID | string | UUID assigned to the order |
status | string | LIVE, MATCHED, or CANCELED |
makingAmount | string | Maker amount in 6-decimal fixed-point |
takingAmount | string | Taker amount in 6-decimal fixed-point |
transactionsHashes | array | On-chain transaction hashes (populated when matched) |
tradeIds | array | Trade identifiers (populated when matched) |
errorMsg | string | Diagnostic message (empty when successful) |
Example
Section titled “Example”curl -X POST https://api.openfish.fun/order \ -H "Content-Type: application/json" \ -H "OPENFISH_ADDRESS: 0x..." \ -H "OPENFISH_SIGNATURE: ..." \ -H "OPENFISH_TIMESTAMP: 1700000000" \ -H "OPENFISH_API_KEY: ..." \ -H "OPENFISH_PASSPHRASE: ..." \ -d '{"order":{...},"orderType":"GTC"}'