Place Order
curl --request POST \
--url https://api.hotstuff.trade/exchange \
--header 'Content-Type: application/json' \
--data '
{
"action": {
"data": {
"orders": [
{
"instrumentId": 1,
"side": "b",
"positionSide": "BOTH",
"price": "92291",
"size": "0.00597",
"tif": "IOC",
"ro": false,
"po": false,
"cloid": "9c29fda4-79b4-47da-a788-568703333134",
"triggerPx": "",
"isMarket": true,
"tpsl": "",
"grouping": ""
}
],
"expiresAfter": 1769690725903,
"nonce": 1769687125903
},
"type": "placeOrder"
},
"signature": "0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...",
"nonce": 1769687125903
}
'import requests
url = "https://api.hotstuff.trade/exchange"
payload = {
"action": {
"data": {
"orders": [
{
"instrumentId": 1,
"side": "b",
"positionSide": "BOTH",
"price": "92291",
"size": "0.00597",
"tif": "IOC",
"ro": False,
"po": False,
"cloid": "9c29fda4-79b4-47da-a788-568703333134",
"triggerPx": "",
"isMarket": True,
"tpsl": "",
"grouping": ""
}
],
"expiresAfter": 1769690725903,
"nonce": 1769687125903
},
"type": "placeOrder"
},
"signature": "0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...",
"nonce": 1769687125903
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
action: {
data: {
orders: [
{
instrumentId: 1,
side: 'b',
positionSide: 'BOTH',
price: '92291',
size: '0.00597',
tif: 'IOC',
ro: false,
po: false,
cloid: '9c29fda4-79b4-47da-a788-568703333134',
triggerPx: '',
isMarket: true,
tpsl: '',
grouping: ''
}
],
expiresAfter: 1769690725903,
nonce: 1769687125903
},
type: 'placeOrder'
},
signature: '0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...',
nonce: 1769687125903
})
};
fetch('https://api.hotstuff.trade/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hotstuff.trade/exchange",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => [
'data' => [
'orders' => [
[
'instrumentId' => 1,
'side' => 'b',
'positionSide' => 'BOTH',
'price' => '92291',
'size' => '0.00597',
'tif' => 'IOC',
'ro' => false,
'po' => false,
'cloid' => '9c29fda4-79b4-47da-a788-568703333134',
'triggerPx' => '',
'isMarket' => true,
'tpsl' => '',
'grouping' => ''
]
],
'expiresAfter' => 1769690725903,
'nonce' => 1769687125903
],
'type' => 'placeOrder'
],
'signature' => '0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...',
'nonce' => 1769687125903
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hotstuff.trade/exchange"
payload := strings.NewReader("{\n \"action\": {\n \"data\": {\n \"orders\": [\n {\n \"instrumentId\": 1,\n \"side\": \"b\",\n \"positionSide\": \"BOTH\",\n \"price\": \"92291\",\n \"size\": \"0.00597\",\n \"tif\": \"IOC\",\n \"ro\": false,\n \"po\": false,\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"triggerPx\": \"\",\n \"isMarket\": true,\n \"tpsl\": \"\",\n \"grouping\": \"\"\n }\n ],\n \"expiresAfter\": 1769690725903,\n \"nonce\": 1769687125903\n },\n \"type\": \"placeOrder\"\n },\n \"signature\": \"0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...\",\n \"nonce\": 1769687125903\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hotstuff.trade/exchange")
.header("Content-Type", "application/json")
.body("{\n \"action\": {\n \"data\": {\n \"orders\": [\n {\n \"instrumentId\": 1,\n \"side\": \"b\",\n \"positionSide\": \"BOTH\",\n \"price\": \"92291\",\n \"size\": \"0.00597\",\n \"tif\": \"IOC\",\n \"ro\": false,\n \"po\": false,\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"triggerPx\": \"\",\n \"isMarket\": true,\n \"tpsl\": \"\",\n \"grouping\": \"\"\n }\n ],\n \"expiresAfter\": 1769690725903,\n \"nonce\": 1769687125903\n },\n \"type\": \"placeOrder\"\n },\n \"signature\": \"0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...\",\n \"nonce\": 1769687125903\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hotstuff.trade/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": {\n \"data\": {\n \"orders\": [\n {\n \"instrumentId\": 1,\n \"side\": \"b\",\n \"positionSide\": \"BOTH\",\n \"price\": \"92291\",\n \"size\": \"0.00597\",\n \"tif\": \"IOC\",\n \"ro\": false,\n \"po\": false,\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"triggerPx\": \"\",\n \"isMarket\": true,\n \"tpsl\": \"\",\n \"grouping\": \"\"\n }\n ],\n \"expiresAfter\": 1769690725903,\n \"nonce\": 1769687125903\n },\n \"type\": \"placeOrder\"\n },\n \"signature\": \"0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...\",\n \"nonce\": 1769687125903\n}"
response = http.request(request)
puts response.read_body{
"tx_hash": "0x0651207eef3271391dba93b96bb7d961a6d7b490fdfe9ee7a22b8c5f842b5867",
"tx_type": 1301,
"error": "",
"data": {
"status": {
"oid": 77738308
}
},
"address": "0x9908658A316D743159F001026F1ef08aa8F0b55B"
}{
"error": "<string>"
}Trading
Place Order
Send POST request to /exchange, or use the ExchangeClient SDKs.
POST
https://api.hotstuff.trade
/
exchange
Place Order
curl --request POST \
--url https://api.hotstuff.trade/exchange \
--header 'Content-Type: application/json' \
--data '
{
"action": {
"data": {
"orders": [
{
"instrumentId": 1,
"side": "b",
"positionSide": "BOTH",
"price": "92291",
"size": "0.00597",
"tif": "IOC",
"ro": false,
"po": false,
"cloid": "9c29fda4-79b4-47da-a788-568703333134",
"triggerPx": "",
"isMarket": true,
"tpsl": "",
"grouping": ""
}
],
"expiresAfter": 1769690725903,
"nonce": 1769687125903
},
"type": "placeOrder"
},
"signature": "0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...",
"nonce": 1769687125903
}
'import requests
url = "https://api.hotstuff.trade/exchange"
payload = {
"action": {
"data": {
"orders": [
{
"instrumentId": 1,
"side": "b",
"positionSide": "BOTH",
"price": "92291",
"size": "0.00597",
"tif": "IOC",
"ro": False,
"po": False,
"cloid": "9c29fda4-79b4-47da-a788-568703333134",
"triggerPx": "",
"isMarket": True,
"tpsl": "",
"grouping": ""
}
],
"expiresAfter": 1769690725903,
"nonce": 1769687125903
},
"type": "placeOrder"
},
"signature": "0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...",
"nonce": 1769687125903
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
action: {
data: {
orders: [
{
instrumentId: 1,
side: 'b',
positionSide: 'BOTH',
price: '92291',
size: '0.00597',
tif: 'IOC',
ro: false,
po: false,
cloid: '9c29fda4-79b4-47da-a788-568703333134',
triggerPx: '',
isMarket: true,
tpsl: '',
grouping: ''
}
],
expiresAfter: 1769690725903,
nonce: 1769687125903
},
type: 'placeOrder'
},
signature: '0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...',
nonce: 1769687125903
})
};
fetch('https://api.hotstuff.trade/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hotstuff.trade/exchange",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => [
'data' => [
'orders' => [
[
'instrumentId' => 1,
'side' => 'b',
'positionSide' => 'BOTH',
'price' => '92291',
'size' => '0.00597',
'tif' => 'IOC',
'ro' => false,
'po' => false,
'cloid' => '9c29fda4-79b4-47da-a788-568703333134',
'triggerPx' => '',
'isMarket' => true,
'tpsl' => '',
'grouping' => ''
]
],
'expiresAfter' => 1769690725903,
'nonce' => 1769687125903
],
'type' => 'placeOrder'
],
'signature' => '0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...',
'nonce' => 1769687125903
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hotstuff.trade/exchange"
payload := strings.NewReader("{\n \"action\": {\n \"data\": {\n \"orders\": [\n {\n \"instrumentId\": 1,\n \"side\": \"b\",\n \"positionSide\": \"BOTH\",\n \"price\": \"92291\",\n \"size\": \"0.00597\",\n \"tif\": \"IOC\",\n \"ro\": false,\n \"po\": false,\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"triggerPx\": \"\",\n \"isMarket\": true,\n \"tpsl\": \"\",\n \"grouping\": \"\"\n }\n ],\n \"expiresAfter\": 1769690725903,\n \"nonce\": 1769687125903\n },\n \"type\": \"placeOrder\"\n },\n \"signature\": \"0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...\",\n \"nonce\": 1769687125903\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hotstuff.trade/exchange")
.header("Content-Type", "application/json")
.body("{\n \"action\": {\n \"data\": {\n \"orders\": [\n {\n \"instrumentId\": 1,\n \"side\": \"b\",\n \"positionSide\": \"BOTH\",\n \"price\": \"92291\",\n \"size\": \"0.00597\",\n \"tif\": \"IOC\",\n \"ro\": false,\n \"po\": false,\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"triggerPx\": \"\",\n \"isMarket\": true,\n \"tpsl\": \"\",\n \"grouping\": \"\"\n }\n ],\n \"expiresAfter\": 1769690725903,\n \"nonce\": 1769687125903\n },\n \"type\": \"placeOrder\"\n },\n \"signature\": \"0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...\",\n \"nonce\": 1769687125903\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hotstuff.trade/exchange")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": {\n \"data\": {\n \"orders\": [\n {\n \"instrumentId\": 1,\n \"side\": \"b\",\n \"positionSide\": \"BOTH\",\n \"price\": \"92291\",\n \"size\": \"0.00597\",\n \"tif\": \"IOC\",\n \"ro\": false,\n \"po\": false,\n \"cloid\": \"9c29fda4-79b4-47da-a788-568703333134\",\n \"triggerPx\": \"\",\n \"isMarket\": true,\n \"tpsl\": \"\",\n \"grouping\": \"\"\n }\n ],\n \"expiresAfter\": 1769690725903,\n \"nonce\": 1769687125903\n },\n \"type\": \"placeOrder\"\n },\n \"signature\": \"0xe39195212e76aa39cb8d91ebbd0da51aa3c9f540c5a121f6ae57fd682458a44b...\",\n \"nonce\": 1769687125903\n}"
response = http.request(request)
puts response.read_body{
"tx_hash": "0x0651207eef3271391dba93b96bb7d961a6d7b490fdfe9ee7a22b8c5f842b5867",
"tx_type": 1301,
"error": "",
"data": {
"status": {
"oid": 77738308
}
},
"address": "0x9908658A316D743159F001026F1ef08aa8F0b55B"
}{
"error": "<string>"
}