{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Hibachi API","description":"The first provable exchange","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":""},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"trade-websocket-api"},"children":["Trade Websocket API"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This endpoint is used for order managements."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"authorization"},"children":["Authorization"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To use the trade websocket api you must connect with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," header set to your ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["apikey"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"\"Authorization\": \"YOURAPIKEY\"\n"},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Connect websocket to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.hibachi.xyz/ws/trade?accountId={YOUR_ACCOUNT_ID}"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"usage"},"children":["Usage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The server will reply with exactly one message for each request you send."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The request and response format will be identical to the REST API: ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/accountapi/trade/create%20order"},"children":["/trade/order"]}," and ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/accountapi/trade/get%20orders"},"children":["/trade/orders"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"optional-ws-query-parameters"},"children":["Optional WS Query Parameters"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["accountId"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"supported-methods"},"children":["Supported methods"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order.place"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order.cancel"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order.modify"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order.status"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["orders.status"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"order-place"},"children":["Order Place"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 123,\n    \"method\": \"order.place\",\n    \"params\": {\n        \"accountId\": 273,\n        \"symbol\": \"ETH/USDT-P\",\n        \"orderType\": \"LIMIT\",\n        \"side\": \"BID\",\n        \"quantity\": \"0.01\",\n        \"price\": \"2345.01\",\n        \"nonce\": 1714701600000000,\n        \"maxFeesPercent\": \"0.00045\",\n        \"orderFlags\": \"POST_ONLY\"\n    },\n    \"signature\": \"0000000000000000000000000000000000000000000000000000000000000000\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": \"<accountId>\",\n    \"result\": {\n        \"orderId\": 578721673790138368\n    },\n    \"status\": 200\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"order-cancel"},"children":["Order Cancel"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 123,\n    \"method\": \"order.cancel\",\n    \"params\": {\n        \"orderId\": 578404507400316928,\n        \"accountId\": <accountId>,\n        \"nonce\": 1714701600000000\n    },\n    \"signature\": \"0000000000000000000000000000000000000000000000000000000000000000\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 123,\n    \"status\": 200\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"order-modify"},"children":["Order Modify"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 123,\n    \"method\": \"order.modify\",\n    \"params\": {\n        \"orderId\": \"586504376442422272\",\n        \"accountId\": 273,\n        \"symbol\": \"ETH/USDT-P\",\n        \"quantity\": \"0.998\",\n        \"price\": \"2228.3\",\n        \"maxFeesPercent\": \"0.00045\",\n        \"nonce\": 1\n    },\n    \"signature\": \"0000000000000000000000000000000000000000000000000000000000000000\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 123,\n    \"status\": 200\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"order-status"},"children":["Order Status"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 123,\n    \"method\": \"order.status\",\n    \"params\": {\n        \"orderId\": \"578744951878232075\",\n        \"accountId\": <accountId>\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 123,\n    \"result\": {\n        \"accountId\": 128,\n        \"availableQuantity\": \"8689.981394\",\n        \"orderId\": 578744951878232075,\n        \"orderType\": \"LIMIT\",\n        \"price\": \"0.230104060\",\n        \"side\": \"BID\",\n        \"status\": \"PENDING\",\n        \"symbol\": \"DDNG/USDT-P\",\n        \"totalQuantity\": \"8689.981394\"\n    },\n    \"status\": 200\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"orders-status"},"children":["Orders Status"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 124,\n    \"method\": \"orders.status\",\n    \"params\": {\n        \"accountId\": 273\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 123,\n    \"result\": [\n        {\n            \"accountId\": 128,\n            \"availableQuantity\": \"0.0856034087\",\n            \"orderId\": 578744886208014338,\n            \"orderType\": \"LIMIT\",\n            \"price\": \"70048.61242\",\n            \"side\": \"BID\",\n            \"status\": \"PENDING\",\n            \"symbol\": \"BTC/USDT-P\",\n            \"totalQuantity\": \"0.0856034087\"\n        },\n        {\n            \"accountId\": 128,\n            \"availableQuantity\": \"4.538826542\",\n            \"orderId\": 578744886209849345,\n            \"orderType\": \"LIMIT\",\n            \"price\": \"3530.780445\",\n            \"side\": \"ASK\",\n            \"status\": \"PENDING\",\n            \"symbol\": \"ETH/USDT-P\",\n            \"totalQuantity\": \"4.538826542\"\n        }\n    ],\n    \"status\": 200\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"orders-cancel"},"children":["Orders Cancel"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 123,\n    \"method\": \"orders.cancel\",\n    \"params\": {\n        \"accountId\": <accountId>,\n        \"nonce\": \"<nonce>\",\n        \"contractId\": 1 // optional, if use it is canceling all orders for the contract\n    },\n    \"signature\": \"0000000000000000000000000000000000000000000000000000000000000000\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 123,\n    \"status\": 200\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"orders-batch"},"children":["Orders Batch"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Request Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{ \n    \"accountId\": <accountId>, \n    \"method\": \"orders.batch\",\n    \"params\": {\n        \"accountId\": 126,\n        \"orders\": [\n            {\n                \"action\": \"place\",\n                \"nonce\": 1714701600000000,\n                \"symbol\": \"ETH/USDT-P\",\n                \"orderType\": \"LIMIT\",\n                \"side\": \"BID\",\n                \"quantity\": \"1.01\",\n                \"price\": \"3500.1\",\n                \"maxFeesPercent\": \"0.00045\",\n                \"signature\": \"0000000000000000000000000000000000000000000000000000000000000000\"\n            },\n            {\n                \"action\": \"modify\",\n                \"orderId\": \"578721673790138369\",\n                \"nonce\": 1714701600000002,\n                \"updatedQuantity\": \"0.1\",\n                \"updatedPrice\": \"3500.1\",\n                \"maxFeesPercent\": \"0.00045\",\n                \"signature\": \"0000000000000000000000000000000000000000000000000000000000000000\"\n            }, \n            {\n                \"action\": \"cancel\",\n                \"orderId\": \"578721673790138370\",\n                \"signature\": \"0000000000000000000000000000000000000000000000000000000000000000\"\n            }\n        ]\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"id\": 123,\n    \"status\": 200\n}\n","lang":"json"},"children":[]}]},"headings":[{"value":"","id":null,"depth":1},{"value":"Trade Websocket API","id":"trade-websocket-api","depth":1},{"value":"Authorization","id":"authorization","depth":2},{"value":"Usage","id":"usage","depth":2},{"value":"Optional WS Query Parameters","id":"optional-ws-query-parameters","depth":4},{"value":"Supported methods","id":"supported-methods","depth":5},{"value":"Order Place","id":"order-place","depth":1},{"value":"Order Cancel","id":"order-cancel","depth":1},{"value":"Order Modify","id":"order-modify","depth":1},{"value":"Order Status","id":"order-status","depth":1},{"value":"Orders Status","id":"orders-status","depth":1},{"value":"Orders Cancel","id":"orders-cancel","depth":1},{"value":"Orders Batch","id":"orders-batch","depth":1}],"frontmatter":{"seo":{"title":""}},"lastModified":"2025-05-16T08:32:47.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/wsapi/trade","userData":{"isAuthenticated":false,"teams":["anonymous"]}}