Batch Trades
curl --request POST \
--url https://www.aionmarket.com/bvapi/markets/batch-trade \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orders": [
{
"marketConditionId": "0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e",
"marketQuestion": "Will Crude Oil (CL) hit (HIGH) $120 by end of March?",
"orderSize": 1,
"price": 0.54,
"order": {
"maker": "0x1111111111111111111111111111111111111111",
"signer": "0x1111111111111111111111111111111111111111",
"tokenId": "69136365945621600854789649488423522395843457249417452310260493085275775221076",
"makerAmount": "120000",
"takerAmount": "1000000",
"signature": "0x1234abcd",
"salt": 599228746038,
"taker": "0x0000000000000000000000000000000000000000",
"expiration": "0",
"nonce": "0",
"feeRateBps": "0",
"timestamp": "1713000000000",
"metadata": "0x0000000000000000000000000000000000000000000000000000000000000000",
"builder": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"venue": "polymarket",
"isLimitOrder": true,
"orderType": "GTC",
"walletAddress": "<string>",
"owner": "<string>",
"deferExec": false,
"negRisk": false,
"funderAddress": "<string>",
"postOnly": false,
"feeAmount": 0,
"reasoning": "<string>",
"source": "<string>",
"skillSlug": "<string>",
"expirationTime": 0
}
]
}
'import requests
url = "https://www.aionmarket.com/bvapi/markets/batch-trade"
payload = { "orders": [
{
"marketConditionId": "0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e",
"marketQuestion": "Will Crude Oil (CL) hit (HIGH) $120 by end of March?",
"orderSize": 1,
"price": 0.54,
"order": {
"maker": "0x1111111111111111111111111111111111111111",
"signer": "0x1111111111111111111111111111111111111111",
"tokenId": "69136365945621600854789649488423522395843457249417452310260493085275775221076",
"makerAmount": "120000",
"takerAmount": "1000000",
"signature": "0x1234abcd",
"salt": 599228746038,
"taker": "0x0000000000000000000000000000000000000000",
"expiration": "0",
"nonce": "0",
"feeRateBps": "0",
"timestamp": "1713000000000",
"metadata": "0x0000000000000000000000000000000000000000000000000000000000000000",
"builder": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"venue": "polymarket",
"isLimitOrder": True,
"orderType": "GTC",
"walletAddress": "<string>",
"owner": "<string>",
"deferExec": False,
"negRisk": False,
"funderAddress": "<string>",
"postOnly": False,
"feeAmount": 0,
"reasoning": "<string>",
"source": "<string>",
"skillSlug": "<string>",
"expirationTime": 0
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orders: [
{
marketConditionId: '0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e',
marketQuestion: 'Will Crude Oil (CL) hit (HIGH) $120 by end of March?',
orderSize: 1,
price: 0.54,
order: {
maker: '0x1111111111111111111111111111111111111111',
signer: '0x1111111111111111111111111111111111111111',
tokenId: '69136365945621600854789649488423522395843457249417452310260493085275775221076',
makerAmount: '120000',
takerAmount: '1000000',
signature: '0x1234abcd',
salt: 599228746038,
taker: '0x0000000000000000000000000000000000000000',
expiration: '0',
nonce: '0',
feeRateBps: '0',
timestamp: '1713000000000',
metadata: '0x0000000000000000000000000000000000000000000000000000000000000000',
builder: '0x0000000000000000000000000000000000000000000000000000000000000000'
},
venue: 'polymarket',
isLimitOrder: true,
orderType: 'GTC',
walletAddress: '<string>',
owner: '<string>',
deferExec: false,
negRisk: false,
funderAddress: '<string>',
postOnly: false,
feeAmount: 0,
reasoning: '<string>',
source: '<string>',
skillSlug: '<string>',
expirationTime: 0
}
]
})
};
fetch('https://www.aionmarket.com/bvapi/markets/batch-trade', 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://www.aionmarket.com/bvapi/markets/batch-trade",
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([
'orders' => [
[
'marketConditionId' => '0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e',
'marketQuestion' => 'Will Crude Oil (CL) hit (HIGH) $120 by end of March?',
'orderSize' => 1,
'price' => 0.54,
'order' => [
'maker' => '0x1111111111111111111111111111111111111111',
'signer' => '0x1111111111111111111111111111111111111111',
'tokenId' => '69136365945621600854789649488423522395843457249417452310260493085275775221076',
'makerAmount' => '120000',
'takerAmount' => '1000000',
'signature' => '0x1234abcd',
'salt' => 599228746038,
'taker' => '0x0000000000000000000000000000000000000000',
'expiration' => '0',
'nonce' => '0',
'feeRateBps' => '0',
'timestamp' => '1713000000000',
'metadata' => '0x0000000000000000000000000000000000000000000000000000000000000000',
'builder' => '0x0000000000000000000000000000000000000000000000000000000000000000'
],
'venue' => 'polymarket',
'isLimitOrder' => true,
'orderType' => 'GTC',
'walletAddress' => '<string>',
'owner' => '<string>',
'deferExec' => false,
'negRisk' => false,
'funderAddress' => '<string>',
'postOnly' => false,
'feeAmount' => 0,
'reasoning' => '<string>',
'source' => '<string>',
'skillSlug' => '<string>',
'expirationTime' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://www.aionmarket.com/bvapi/markets/batch-trade"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"marketConditionId\": \"0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e\",\n \"marketQuestion\": \"Will Crude Oil (CL) hit (HIGH) $120 by end of March?\",\n \"orderSize\": 1,\n \"price\": 0.54,\n \"order\": {\n \"maker\": \"0x1111111111111111111111111111111111111111\",\n \"signer\": \"0x1111111111111111111111111111111111111111\",\n \"tokenId\": \"69136365945621600854789649488423522395843457249417452310260493085275775221076\",\n \"makerAmount\": \"120000\",\n \"takerAmount\": \"1000000\",\n \"signature\": \"0x1234abcd\",\n \"salt\": 599228746038,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"nonce\": \"0\",\n \"feeRateBps\": \"0\",\n \"timestamp\": \"1713000000000\",\n \"metadata\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"builder\": \"0x0000000000000000000000000000000000000000000000000000000000000000\"\n },\n \"venue\": \"polymarket\",\n \"isLimitOrder\": true,\n \"orderType\": \"GTC\",\n \"walletAddress\": \"<string>\",\n \"owner\": \"<string>\",\n \"deferExec\": false,\n \"negRisk\": false,\n \"funderAddress\": \"<string>\",\n \"postOnly\": false,\n \"feeAmount\": 0,\n \"reasoning\": \"<string>\",\n \"source\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"expirationTime\": 0\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://www.aionmarket.com/bvapi/markets/batch-trade")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"marketConditionId\": \"0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e\",\n \"marketQuestion\": \"Will Crude Oil (CL) hit (HIGH) $120 by end of March?\",\n \"orderSize\": 1,\n \"price\": 0.54,\n \"order\": {\n \"maker\": \"0x1111111111111111111111111111111111111111\",\n \"signer\": \"0x1111111111111111111111111111111111111111\",\n \"tokenId\": \"69136365945621600854789649488423522395843457249417452310260493085275775221076\",\n \"makerAmount\": \"120000\",\n \"takerAmount\": \"1000000\",\n \"signature\": \"0x1234abcd\",\n \"salt\": 599228746038,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"nonce\": \"0\",\n \"feeRateBps\": \"0\",\n \"timestamp\": \"1713000000000\",\n \"metadata\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"builder\": \"0x0000000000000000000000000000000000000000000000000000000000000000\"\n },\n \"venue\": \"polymarket\",\n \"isLimitOrder\": true,\n \"orderType\": \"GTC\",\n \"walletAddress\": \"<string>\",\n \"owner\": \"<string>\",\n \"deferExec\": false,\n \"negRisk\": false,\n \"funderAddress\": \"<string>\",\n \"postOnly\": false,\n \"feeAmount\": 0,\n \"reasoning\": \"<string>\",\n \"source\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"expirationTime\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.aionmarket.com/bvapi/markets/batch-trade")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n {\n \"marketConditionId\": \"0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e\",\n \"marketQuestion\": \"Will Crude Oil (CL) hit (HIGH) $120 by end of March?\",\n \"orderSize\": 1,\n \"price\": 0.54,\n \"order\": {\n \"maker\": \"0x1111111111111111111111111111111111111111\",\n \"signer\": \"0x1111111111111111111111111111111111111111\",\n \"tokenId\": \"69136365945621600854789649488423522395843457249417452310260493085275775221076\",\n \"makerAmount\": \"120000\",\n \"takerAmount\": \"1000000\",\n \"signature\": \"0x1234abcd\",\n \"salt\": 599228746038,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"nonce\": \"0\",\n \"feeRateBps\": \"0\",\n \"timestamp\": \"1713000000000\",\n \"metadata\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"builder\": \"0x0000000000000000000000000000000000000000000000000000000000000000\"\n },\n \"venue\": \"polymarket\",\n \"isLimitOrder\": true,\n \"orderType\": \"GTC\",\n \"walletAddress\": \"<string>\",\n \"owner\": \"<string>\",\n \"deferExec\": false,\n \"negRisk\": false,\n \"funderAddress\": \"<string>\",\n \"postOnly\": false,\n \"feeAmount\": 0,\n \"reasoning\": \"<string>\",\n \"source\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"expirationTime\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"total": 123,
"succeeded": 123,
"failed": 123,
"results": [
{
"orderId": "<string>",
"status": "<string>",
"submittedAt": "2023-11-07T05:31:56Z"
}
]
}Trading
Batch Trades
Submit multiple trade orders in a single request. Each order is executed sequentially with the same logic as POST /markets/trade. Maximum 20 orders per batch.
POST
/
markets
/
batch-trade
Batch Trades
curl --request POST \
--url https://www.aionmarket.com/bvapi/markets/batch-trade \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orders": [
{
"marketConditionId": "0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e",
"marketQuestion": "Will Crude Oil (CL) hit (HIGH) $120 by end of March?",
"orderSize": 1,
"price": 0.54,
"order": {
"maker": "0x1111111111111111111111111111111111111111",
"signer": "0x1111111111111111111111111111111111111111",
"tokenId": "69136365945621600854789649488423522395843457249417452310260493085275775221076",
"makerAmount": "120000",
"takerAmount": "1000000",
"signature": "0x1234abcd",
"salt": 599228746038,
"taker": "0x0000000000000000000000000000000000000000",
"expiration": "0",
"nonce": "0",
"feeRateBps": "0",
"timestamp": "1713000000000",
"metadata": "0x0000000000000000000000000000000000000000000000000000000000000000",
"builder": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"venue": "polymarket",
"isLimitOrder": true,
"orderType": "GTC",
"walletAddress": "<string>",
"owner": "<string>",
"deferExec": false,
"negRisk": false,
"funderAddress": "<string>",
"postOnly": false,
"feeAmount": 0,
"reasoning": "<string>",
"source": "<string>",
"skillSlug": "<string>",
"expirationTime": 0
}
]
}
'import requests
url = "https://www.aionmarket.com/bvapi/markets/batch-trade"
payload = { "orders": [
{
"marketConditionId": "0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e",
"marketQuestion": "Will Crude Oil (CL) hit (HIGH) $120 by end of March?",
"orderSize": 1,
"price": 0.54,
"order": {
"maker": "0x1111111111111111111111111111111111111111",
"signer": "0x1111111111111111111111111111111111111111",
"tokenId": "69136365945621600854789649488423522395843457249417452310260493085275775221076",
"makerAmount": "120000",
"takerAmount": "1000000",
"signature": "0x1234abcd",
"salt": 599228746038,
"taker": "0x0000000000000000000000000000000000000000",
"expiration": "0",
"nonce": "0",
"feeRateBps": "0",
"timestamp": "1713000000000",
"metadata": "0x0000000000000000000000000000000000000000000000000000000000000000",
"builder": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"venue": "polymarket",
"isLimitOrder": True,
"orderType": "GTC",
"walletAddress": "<string>",
"owner": "<string>",
"deferExec": False,
"negRisk": False,
"funderAddress": "<string>",
"postOnly": False,
"feeAmount": 0,
"reasoning": "<string>",
"source": "<string>",
"skillSlug": "<string>",
"expirationTime": 0
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orders: [
{
marketConditionId: '0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e',
marketQuestion: 'Will Crude Oil (CL) hit (HIGH) $120 by end of March?',
orderSize: 1,
price: 0.54,
order: {
maker: '0x1111111111111111111111111111111111111111',
signer: '0x1111111111111111111111111111111111111111',
tokenId: '69136365945621600854789649488423522395843457249417452310260493085275775221076',
makerAmount: '120000',
takerAmount: '1000000',
signature: '0x1234abcd',
salt: 599228746038,
taker: '0x0000000000000000000000000000000000000000',
expiration: '0',
nonce: '0',
feeRateBps: '0',
timestamp: '1713000000000',
metadata: '0x0000000000000000000000000000000000000000000000000000000000000000',
builder: '0x0000000000000000000000000000000000000000000000000000000000000000'
},
venue: 'polymarket',
isLimitOrder: true,
orderType: 'GTC',
walletAddress: '<string>',
owner: '<string>',
deferExec: false,
negRisk: false,
funderAddress: '<string>',
postOnly: false,
feeAmount: 0,
reasoning: '<string>',
source: '<string>',
skillSlug: '<string>',
expirationTime: 0
}
]
})
};
fetch('https://www.aionmarket.com/bvapi/markets/batch-trade', 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://www.aionmarket.com/bvapi/markets/batch-trade",
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([
'orders' => [
[
'marketConditionId' => '0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e',
'marketQuestion' => 'Will Crude Oil (CL) hit (HIGH) $120 by end of March?',
'orderSize' => 1,
'price' => 0.54,
'order' => [
'maker' => '0x1111111111111111111111111111111111111111',
'signer' => '0x1111111111111111111111111111111111111111',
'tokenId' => '69136365945621600854789649488423522395843457249417452310260493085275775221076',
'makerAmount' => '120000',
'takerAmount' => '1000000',
'signature' => '0x1234abcd',
'salt' => 599228746038,
'taker' => '0x0000000000000000000000000000000000000000',
'expiration' => '0',
'nonce' => '0',
'feeRateBps' => '0',
'timestamp' => '1713000000000',
'metadata' => '0x0000000000000000000000000000000000000000000000000000000000000000',
'builder' => '0x0000000000000000000000000000000000000000000000000000000000000000'
],
'venue' => 'polymarket',
'isLimitOrder' => true,
'orderType' => 'GTC',
'walletAddress' => '<string>',
'owner' => '<string>',
'deferExec' => false,
'negRisk' => false,
'funderAddress' => '<string>',
'postOnly' => false,
'feeAmount' => 0,
'reasoning' => '<string>',
'source' => '<string>',
'skillSlug' => '<string>',
'expirationTime' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://www.aionmarket.com/bvapi/markets/batch-trade"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"marketConditionId\": \"0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e\",\n \"marketQuestion\": \"Will Crude Oil (CL) hit (HIGH) $120 by end of March?\",\n \"orderSize\": 1,\n \"price\": 0.54,\n \"order\": {\n \"maker\": \"0x1111111111111111111111111111111111111111\",\n \"signer\": \"0x1111111111111111111111111111111111111111\",\n \"tokenId\": \"69136365945621600854789649488423522395843457249417452310260493085275775221076\",\n \"makerAmount\": \"120000\",\n \"takerAmount\": \"1000000\",\n \"signature\": \"0x1234abcd\",\n \"salt\": 599228746038,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"nonce\": \"0\",\n \"feeRateBps\": \"0\",\n \"timestamp\": \"1713000000000\",\n \"metadata\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"builder\": \"0x0000000000000000000000000000000000000000000000000000000000000000\"\n },\n \"venue\": \"polymarket\",\n \"isLimitOrder\": true,\n \"orderType\": \"GTC\",\n \"walletAddress\": \"<string>\",\n \"owner\": \"<string>\",\n \"deferExec\": false,\n \"negRisk\": false,\n \"funderAddress\": \"<string>\",\n \"postOnly\": false,\n \"feeAmount\": 0,\n \"reasoning\": \"<string>\",\n \"source\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"expirationTime\": 0\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://www.aionmarket.com/bvapi/markets/batch-trade")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"marketConditionId\": \"0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e\",\n \"marketQuestion\": \"Will Crude Oil (CL) hit (HIGH) $120 by end of March?\",\n \"orderSize\": 1,\n \"price\": 0.54,\n \"order\": {\n \"maker\": \"0x1111111111111111111111111111111111111111\",\n \"signer\": \"0x1111111111111111111111111111111111111111\",\n \"tokenId\": \"69136365945621600854789649488423522395843457249417452310260493085275775221076\",\n \"makerAmount\": \"120000\",\n \"takerAmount\": \"1000000\",\n \"signature\": \"0x1234abcd\",\n \"salt\": 599228746038,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"nonce\": \"0\",\n \"feeRateBps\": \"0\",\n \"timestamp\": \"1713000000000\",\n \"metadata\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"builder\": \"0x0000000000000000000000000000000000000000000000000000000000000000\"\n },\n \"venue\": \"polymarket\",\n \"isLimitOrder\": true,\n \"orderType\": \"GTC\",\n \"walletAddress\": \"<string>\",\n \"owner\": \"<string>\",\n \"deferExec\": false,\n \"negRisk\": false,\n \"funderAddress\": \"<string>\",\n \"postOnly\": false,\n \"feeAmount\": 0,\n \"reasoning\": \"<string>\",\n \"source\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"expirationTime\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.aionmarket.com/bvapi/markets/batch-trade")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n {\n \"marketConditionId\": \"0xf64f880b571d7a70d858649d30f0843aa57307e304aeb617349df74ce34d044e\",\n \"marketQuestion\": \"Will Crude Oil (CL) hit (HIGH) $120 by end of March?\",\n \"orderSize\": 1,\n \"price\": 0.54,\n \"order\": {\n \"maker\": \"0x1111111111111111111111111111111111111111\",\n \"signer\": \"0x1111111111111111111111111111111111111111\",\n \"tokenId\": \"69136365945621600854789649488423522395843457249417452310260493085275775221076\",\n \"makerAmount\": \"120000\",\n \"takerAmount\": \"1000000\",\n \"signature\": \"0x1234abcd\",\n \"salt\": 599228746038,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"nonce\": \"0\",\n \"feeRateBps\": \"0\",\n \"timestamp\": \"1713000000000\",\n \"metadata\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"builder\": \"0x0000000000000000000000000000000000000000000000000000000000000000\"\n },\n \"venue\": \"polymarket\",\n \"isLimitOrder\": true,\n \"orderType\": \"GTC\",\n \"walletAddress\": \"<string>\",\n \"owner\": \"<string>\",\n \"deferExec\": false,\n \"negRisk\": false,\n \"funderAddress\": \"<string>\",\n \"postOnly\": false,\n \"feeAmount\": 0,\n \"reasoning\": \"<string>\",\n \"source\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"expirationTime\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"total": 123,
"succeeded": 123,
"failed": 123,
"results": [
{
"orderId": "<string>",
"status": "<string>",
"submittedAt": "2023-11-07T05:31:56Z"
}
]
}Submit multiple trade orders in a single request. Each order is executed sequentially using the same logic as the single Trade endpoint.
Overview
Use this endpoint when you need to place multiple orders at once — for example, entering positions across several markets in a single skill cycle or placing hedged entries on both sides of a market. Each order in the batch is processed independently. If one order fails, the remaining orders still execute. The response includes individual results for every order. Each embedded order follows the same schema asPOST /markets/trade (12-field EIP-712 Order struct, identical for V1 and V2). Deposit-wallet orders use signatureType=3. See the Place Trade reference for the full field list.
Maximum 20 orders per batch request. Each order undergoes the same validation and risk checks as the single trade endpoint.
Example
- curl
- Python SDK
curl -X POST "https://www.aionmarket.com/bvapi/markets/batch-trade" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"orders": [
{
"marketConditionId": "0xabc123...",
"marketQuestion": "Will BTC exceed $100k by June?",
"outcome": "YES",
"orderSize": 10,
"price": 0.65,
"isLimitOrder": true,
"orderType": "GTC",
"order": {
"maker": "0x1111111111111111111111111111111111111111",
"signer": "0x1111111111111111111111111111111111111111",
"taker": "0x0000000000000000000000000000000000000000",
"tokenId": "69136365945621600854789649488423522395843457249417452310260493085275775221076",
"makerAmount": "650000",
"takerAmount": "1000000",
"side": "BUY",
"expiration": "0",
"nonce": "0",
"feeRateBps": "0",
"signature": "0xabcdef...",
"salt": 599228746038,
"signatureType": 0
},
"reasoning": "BTC momentum signal positive",
"source": "sdk:my-skill"
},
{
"marketConditionId": "0xdef456...",
"marketQuestion": "Will ETH exceed $5k by June?",
"outcome": "NO",
"orderSize": 5,
"price": 0.40,
"isLimitOrder": true,
"orderType": "GTC",
"order": {
"maker": "0x1111111111111111111111111111111111111111",
"signer": "0x1111111111111111111111111111111111111111",
"taker": "0x0000000000000000000000000000000000000000",
"tokenId": "12345678901234567890123456789012345678901234567890123456789012345678",
"makerAmount": "400000",
"takerAmount": "1000000",
"side": "BUY",
"expiration": "0",
"nonce": "0",
"feeRateBps": "0",
"signature": "0x123456...",
"salt": 599228746039,
"signatureType": 0
},
"reasoning": "ETH overvalued based on model",
"source": "sdk:my-skill"
}
]
}'
from aion_sdk import AionMarketClient
client = AionMarketClient(api_key="YOUR_API_KEY", base_url="https://www.aionmarket.com/bvapi")
orders = [
{
"marketConditionId": "0xabc123...",
"marketQuestion": "Will BTC exceed $100k by June?",
"outcome": "YES",
"orderSize": 10,
"price": 0.65,
"isLimitOrder": True,
"orderType": "GTC",
"order": { ... }, # EIP712 signed order
"reasoning": "BTC momentum signal positive",
"source": "sdk:my-skill",
},
{
"marketConditionId": "0xdef456...",
"marketQuestion": "Will ETH exceed $5k by June?",
"outcome": "NO",
"orderSize": 5,
"price": 0.40,
"isLimitOrder": True,
"orderType": "GTC",
"order": { ... }, # EIP712 signed order
"reasoning": "ETH overvalued based on model",
"source": "sdk:my-skill",
},
]
result = client.batch_trade(orders)
print(f"Submitted: {result['total']}, Succeeded: {result['succeeded']}, Failed: {result['failed']}")
for r in result["results"]:
print(f" Order {r['orderId']}: {r['status']}")
Response
{
"total": 2,
"succeeded": 2,
"failed": 0,
"results": [
{
"success": true,
"orderId": "0xabc...",
"status": "live",
"makingAmount": "650000",
"takingAmount": "1000000",
"venue": "polymarket",
"isLimitOrder": true,
"walletAddress": "0x1111111111111111111111111111111111111111",
"signatureType": 0,
"aiAgentId": "10000001",
"userId": "26",
"syncedToMkOrder": true,
"syncedToStrategyLog": true,
"orderVersion": 1,
"collateralSymbol": "pUSD"
},
{
"success": true,
"orderId": "0xdef...",
"status": "live",
"makingAmount": "400000",
"takingAmount": "1000000",
"venue": "polymarket",
"isLimitOrder": true,
"walletAddress": "0x1111111111111111111111111111111111111111",
"signatureType": 0,
"aiAgentId": "10000001",
"userId": "26",
"syncedToMkOrder": true,
"syncedToStrategyLog": true,
"orderVersion": 1,
"collateralSymbol": "pUSD"
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
total | integer | Total number of orders submitted |
succeeded | integer | Number of successfully executed orders |
failed | integer | Number of failed orders |
results | array | Array of individual trade results (same schema as Trade response) |
Common Errors
| Code | Meaning |
|---|---|
400 | Invalid request body, empty orders array, or exceeds max |
401 | Missing or invalid API key |
500 | Server-side error |
Notes
- Orders are executed sequentially, not in parallel. Each order completes before the next begins.
- Each order undergoes independent risk checks and Polymarket API submission.
- A failed order does not stop subsequent orders from executing.
- The
ordersfield in each result matches the single trade response schema exactly.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Array of trade orders to execute in batch (max 20)
Required array length:
1 - 20 elementsShow child attributes
Show child attributes
⌘I