Batch Trades
curl --request POST \
--url https://api.simmer.markets/api/sdk/trades/batch \
--header 'Content-Type: application/json' \
--data '
{
"trades": [
{
"market_id": "<string>",
"amount": 123
}
],
"venue": "sim",
"source": "<string>",
"dry_run": false,
"atomic": false,
"max_slippage": 0.02
}
'import requests
url = "https://api.simmer.markets/api/sdk/trades/batch"
payload = {
"trades": [
{
"market_id": "<string>",
"amount": 123
}
],
"venue": "sim",
"source": "<string>",
"dry_run": False,
"atomic": False,
"max_slippage": 0.02
}
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({
trades: [{market_id: '<string>', amount: 123}],
venue: 'sim',
source: '<string>',
dry_run: false,
atomic: false,
max_slippage: 0.02
})
};
fetch('https://api.simmer.markets/api/sdk/trades/batch', 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.simmer.markets/api/sdk/trades/batch",
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([
'trades' => [
[
'market_id' => '<string>',
'amount' => 123
]
],
'venue' => 'sim',
'source' => '<string>',
'dry_run' => false,
'atomic' => false,
'max_slippage' => 0.02
]),
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.simmer.markets/api/sdk/trades/batch"
payload := strings.NewReader("{\n \"trades\": [\n {\n \"market_id\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"venue\": \"sim\",\n \"source\": \"<string>\",\n \"dry_run\": false,\n \"atomic\": false,\n \"max_slippage\": 0.02\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.simmer.markets/api/sdk/trades/batch")
.header("Content-Type", "application/json")
.body("{\n \"trades\": [\n {\n \"market_id\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"venue\": \"sim\",\n \"source\": \"<string>\",\n \"dry_run\": false,\n \"atomic\": false,\n \"max_slippage\": 0.02\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.simmer.markets/api/sdk/trades/batch")
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 \"trades\": [\n {\n \"market_id\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"venue\": \"sim\",\n \"source\": \"<string>\",\n \"dry_run\": false,\n \"atomic\": false,\n \"max_slippage\": 0.02\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"results": [
{
"market_id": "<string>",
"success": true,
"trade_id": "<string>",
"error": "<string>",
"cost": 0,
"shares": 123,
"price": 123,
"dry_run_price": 123,
"slippage": 123,
"aborted": false
}
],
"total_cost": 123,
"failed_count": 123,
"warnings": [],
"execution_time_ms": 123,
"dry_run": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Trading
Batch Trades
Execute multiple trades in a single request with PARALLEL execution.
Trades are executed concurrently using asyncio.gather() for maximum speed. This is NOT atomic - failures don’t rollback other trades.
Parameters:
- trades: List of trade items (max 30, supports 26-leg NegRisk arb)
- venue: “sim” or “polymarket” (default: sim)
- source: Optional source tag for all trades (e.g., “sdk:copytrading”)
- dry_run: If true, validate and calculate without executing (default: false) Returns estimated shares, price, and cost for each trade.
Deprecated: venue=“sandbox”/“simmer” are deprecated, use venue=“sim” instead.
Requires API key in Authorization header (rate limited: 30/minute).
POST
/
api
/
sdk
/
trades
/
batch
Batch Trades
curl --request POST \
--url https://api.simmer.markets/api/sdk/trades/batch \
--header 'Content-Type: application/json' \
--data '
{
"trades": [
{
"market_id": "<string>",
"amount": 123
}
],
"venue": "sim",
"source": "<string>",
"dry_run": false,
"atomic": false,
"max_slippage": 0.02
}
'import requests
url = "https://api.simmer.markets/api/sdk/trades/batch"
payload = {
"trades": [
{
"market_id": "<string>",
"amount": 123
}
],
"venue": "sim",
"source": "<string>",
"dry_run": False,
"atomic": False,
"max_slippage": 0.02
}
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({
trades: [{market_id: '<string>', amount: 123}],
venue: 'sim',
source: '<string>',
dry_run: false,
atomic: false,
max_slippage: 0.02
})
};
fetch('https://api.simmer.markets/api/sdk/trades/batch', 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.simmer.markets/api/sdk/trades/batch",
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([
'trades' => [
[
'market_id' => '<string>',
'amount' => 123
]
],
'venue' => 'sim',
'source' => '<string>',
'dry_run' => false,
'atomic' => false,
'max_slippage' => 0.02
]),
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.simmer.markets/api/sdk/trades/batch"
payload := strings.NewReader("{\n \"trades\": [\n {\n \"market_id\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"venue\": \"sim\",\n \"source\": \"<string>\",\n \"dry_run\": false,\n \"atomic\": false,\n \"max_slippage\": 0.02\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.simmer.markets/api/sdk/trades/batch")
.header("Content-Type", "application/json")
.body("{\n \"trades\": [\n {\n \"market_id\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"venue\": \"sim\",\n \"source\": \"<string>\",\n \"dry_run\": false,\n \"atomic\": false,\n \"max_slippage\": 0.02\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.simmer.markets/api/sdk/trades/batch")
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 \"trades\": [\n {\n \"market_id\": \"<string>\",\n \"amount\": 123\n }\n ],\n \"venue\": \"sim\",\n \"source\": \"<string>\",\n \"dry_run\": false,\n \"atomic\": false,\n \"max_slippage\": 0.02\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"results": [
{
"market_id": "<string>",
"success": true,
"trade_id": "<string>",
"error": "<string>",
"cost": 0,
"shares": 123,
"price": 123,
"dry_run_price": 123,
"slippage": 123,
"aborted": false
}
],
"total_cost": 123,
"failed_count": 123,
"warnings": [],
"execution_time_ms": 123,
"dry_run": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
⌘I
