curl --request POST \
--url https://www.aionmarket.com/bvapi/kalshi/agent/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"marketTicker": "KXHIGHNY-26FEB19-T70",
"userPublicKey": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1",
"signedTransaction": "<string>",
"quoteId": "<string>",
"amount": 123,
"shares": 123,
"destinationWallet": "<string>",
"inAmount": "<string>",
"outAmount": "<string>",
"minOutAmount": "<string>",
"skillSlug": "<string>",
"source": "<string>",
"reasoning": "<string>"
}
'import requests
url = "https://www.aionmarket.com/bvapi/kalshi/agent/submit"
payload = {
"marketTicker": "KXHIGHNY-26FEB19-T70",
"userPublicKey": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1",
"signedTransaction": "<string>",
"quoteId": "<string>",
"amount": 123,
"shares": 123,
"destinationWallet": "<string>",
"inAmount": "<string>",
"outAmount": "<string>",
"minOutAmount": "<string>",
"skillSlug": "<string>",
"source": "<string>",
"reasoning": "<string>"
}
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({
marketTicker: 'KXHIGHNY-26FEB19-T70',
userPublicKey: '8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1',
signedTransaction: '<string>',
quoteId: '<string>',
amount: 123,
shares: 123,
destinationWallet: '<string>',
inAmount: '<string>',
outAmount: '<string>',
minOutAmount: '<string>',
skillSlug: '<string>',
source: '<string>',
reasoning: '<string>'
})
};
fetch('https://www.aionmarket.com/bvapi/kalshi/agent/submit', 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/kalshi/agent/submit",
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([
'marketTicker' => 'KXHIGHNY-26FEB19-T70',
'userPublicKey' => '8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1',
'signedTransaction' => '<string>',
'quoteId' => '<string>',
'amount' => 123,
'shares' => 123,
'destinationWallet' => '<string>',
'inAmount' => '<string>',
'outAmount' => '<string>',
'minOutAmount' => '<string>',
'skillSlug' => '<string>',
'source' => '<string>',
'reasoning' => '<string>'
]),
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/kalshi/agent/submit"
payload := strings.NewReader("{\n \"marketTicker\": \"KXHIGHNY-26FEB19-T70\",\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"amount\": 123,\n \"shares\": 123,\n \"destinationWallet\": \"<string>\",\n \"inAmount\": \"<string>\",\n \"outAmount\": \"<string>\",\n \"minOutAmount\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"source\": \"<string>\",\n \"reasoning\": \"<string>\"\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/kalshi/agent/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"marketTicker\": \"KXHIGHNY-26FEB19-T70\",\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"amount\": 123,\n \"shares\": 123,\n \"destinationWallet\": \"<string>\",\n \"inAmount\": \"<string>\",\n \"outAmount\": \"<string>\",\n \"minOutAmount\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"source\": \"<string>\",\n \"reasoning\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.aionmarket.com/bvapi/kalshi/agent/submit")
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 \"marketTicker\": \"KXHIGHNY-26FEB19-T70\",\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"amount\": 123,\n \"shares\": 123,\n \"destinationWallet\": \"<string>\",\n \"inAmount\": \"<string>\",\n \"outAmount\": \"<string>\",\n \"minOutAmount\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"source\": \"<string>\",\n \"reasoning\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "<string>",
"venueOrderId": "<string>",
"status": "<string>",
"filledSize": "<string>",
"avgPrice": "<string>",
"txHash": "<string>",
"syncedToMkOrder": true,
"syncedToStrategyLog": true,
"venue": "<string>",
"aiAgentId": "<string>",
"userId": "<string>"
}Kalshi Submit
Submit a locally signed Kalshi transaction to Solana RPC. Step 3 of the quote → sign → submit BYOW flow.
curl --request POST \
--url https://www.aionmarket.com/bvapi/kalshi/agent/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"marketTicker": "KXHIGHNY-26FEB19-T70",
"userPublicKey": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1",
"signedTransaction": "<string>",
"quoteId": "<string>",
"amount": 123,
"shares": 123,
"destinationWallet": "<string>",
"inAmount": "<string>",
"outAmount": "<string>",
"minOutAmount": "<string>",
"skillSlug": "<string>",
"source": "<string>",
"reasoning": "<string>"
}
'import requests
url = "https://www.aionmarket.com/bvapi/kalshi/agent/submit"
payload = {
"marketTicker": "KXHIGHNY-26FEB19-T70",
"userPublicKey": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1",
"signedTransaction": "<string>",
"quoteId": "<string>",
"amount": 123,
"shares": 123,
"destinationWallet": "<string>",
"inAmount": "<string>",
"outAmount": "<string>",
"minOutAmount": "<string>",
"skillSlug": "<string>",
"source": "<string>",
"reasoning": "<string>"
}
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({
marketTicker: 'KXHIGHNY-26FEB19-T70',
userPublicKey: '8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1',
signedTransaction: '<string>',
quoteId: '<string>',
amount: 123,
shares: 123,
destinationWallet: '<string>',
inAmount: '<string>',
outAmount: '<string>',
minOutAmount: '<string>',
skillSlug: '<string>',
source: '<string>',
reasoning: '<string>'
})
};
fetch('https://www.aionmarket.com/bvapi/kalshi/agent/submit', 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/kalshi/agent/submit",
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([
'marketTicker' => 'KXHIGHNY-26FEB19-T70',
'userPublicKey' => '8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1',
'signedTransaction' => '<string>',
'quoteId' => '<string>',
'amount' => 123,
'shares' => 123,
'destinationWallet' => '<string>',
'inAmount' => '<string>',
'outAmount' => '<string>',
'minOutAmount' => '<string>',
'skillSlug' => '<string>',
'source' => '<string>',
'reasoning' => '<string>'
]),
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/kalshi/agent/submit"
payload := strings.NewReader("{\n \"marketTicker\": \"KXHIGHNY-26FEB19-T70\",\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"amount\": 123,\n \"shares\": 123,\n \"destinationWallet\": \"<string>\",\n \"inAmount\": \"<string>\",\n \"outAmount\": \"<string>\",\n \"minOutAmount\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"source\": \"<string>\",\n \"reasoning\": \"<string>\"\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/kalshi/agent/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"marketTicker\": \"KXHIGHNY-26FEB19-T70\",\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"amount\": 123,\n \"shares\": 123,\n \"destinationWallet\": \"<string>\",\n \"inAmount\": \"<string>\",\n \"outAmount\": \"<string>\",\n \"minOutAmount\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"source\": \"<string>\",\n \"reasoning\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.aionmarket.com/bvapi/kalshi/agent/submit")
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 \"marketTicker\": \"KXHIGHNY-26FEB19-T70\",\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"amount\": 123,\n \"shares\": 123,\n \"destinationWallet\": \"<string>\",\n \"inAmount\": \"<string>\",\n \"outAmount\": \"<string>\",\n \"minOutAmount\": \"<string>\",\n \"skillSlug\": \"<string>\",\n \"source\": \"<string>\",\n \"reasoning\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "<string>",
"venueOrderId": "<string>",
"status": "<string>",
"filledSize": "<string>",
"avgPrice": "<string>",
"txHash": "<string>",
"syncedToMkOrder": true,
"syncedToStrategyLog": true,
"venue": "<string>",
"aiAgentId": "<string>",
"userId": "<string>"
}mk_kalshi_order. Also writes to mk_ai_agent_strategy_log and updates mk_ai_agent.sol_address. Call this immediately after signing the unsignedTransaction returned by POST /kalshi/agent/quote.
Notes
- Agent-only endpoint. Requires Bearer API key in
Authorizationheader. - Signature must be produced on client/agent side.
- Server does not store or process private keys.
- Transaction is broadcast directly to Solana mainnet RPC.
- Order status is tracked via DFlow
order-statusAPI in a background cron. - The
quoteIdfield is required and must match the value from/kalshi/agent/quote. - Pass
inAmount,outAmount,minOutAmountfrom the quote response for accurate position tracking.
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
marketTicker | string | Yes | Kalshi market ticker, e.g. KXHIGHNY-26FEB19-T70 |
side | string | Yes | YES or NO |
action | string | Yes | BUY or SELL |
amount | number | BUY required | Buy amount in USDC (min 0.000001) |
shares | number | SELL required | Sell shares (min 0.000001) |
userPublicKey | string | Yes | Signing Solana wallet address |
signedTransaction | string | Yes | Base64-encoded signed transaction |
quoteId | string | Yes | Quote ID from /kalshi/agent/quote response |
destinationWallet | string | No | Destination wallet for received tokens |
inAmount | string | No | DFlow input amount from quote response (scaled integer) |
outAmount | string | No | DFlow output amount from quote response (scaled integer) |
minOutAmount | string | No | DFlow minimum output from quote response (scaled integer) |
skillSlug | string | No | Skill identifier for strategy logging |
source | string | No | Source tag for strategy logging |
reasoning | string | No | Strategy reasoning text (max 1000 chars) |
Example
- curl
- Python SDK
curl -X POST "https://www.aionmarket.com/bvapi/kalshi/agent/submit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"marketTicker": "KXHIGHNY-26FEB19-T70",
"side": "YES",
"action": "BUY",
"amount": 10,
"signedTransaction": "BASE64_SIGNED_TX",
"quoteId": "quote_1713604800000_42",
"userPublicKey": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1",
"inAmount": "10000000",
"outAmount": "15384615",
"minOutAmount": "14615384",
"source": "sdk:kalshi-weather",
"skillSlug": "kalshi-weather-trader",
"reasoning": "NOAA forecast indicates edge"
}'
result = client.kalshi_submit(
market_ticker="KXHIGHNY-26FEB19-T70",
side="YES",
action="BUY",
amount=10,
signed_transaction="BASE64_SIGNED_TX",
quote_id="quote_1713604800000_42",
user_public_key="8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1",
in_amount="10000000",
out_amount="15384615",
min_out_amount="14615384",
source="sdk:kalshi-weather",
skill_slug="kalshi-weather-trader",
reasoning="NOAA forecast indicates edge",
)
order_id = result["orderId"]
tx_sig = result["txSignature"]
print(f"Order {order_id} | tx={tx_sig}")
Response
{
"orderId": "100001",
"txSignature": "5Uj9xK2m...",
"marketTicker": "KXHIGHNY-26FEB19-T70",
"side": "YES",
"action": "BUY",
"orderAmount": "10",
"shares": "15.384615",
"orderStatus": 1
}
| Response field | Type | Description |
|---|---|---|
orderId | string | Primary key in mk_kalshi_order table |
txSignature | string | Solana transaction signature |
marketTicker | string | Echoed market ticker |
side | string | YES or NO |
action | string | BUY or SELL |
orderAmount | string | Order amount in USDC |
shares | string | Calculated order shares |
orderStatus | number | 1 = pending. Updated by cron via DFlow order-status API |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Kalshi market ticker
120"KXHIGHNY-26FEB19-T70"
Trade direction
YES, NO, yes, no Order action
BUY, SELL, buy, sell Signing Solana wallet address
128"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1"
Base64-encoded signed Solana transaction
Quote ID returned by /kalshi/agent/quote
100BUY order amount in USDC (required when action=BUY)
SELL share quantity (required when action=SELL)
Destination wallet for received tokens
128DFlow actual input amount (scaled integer) — from /kalshi/agent/quote
30DFlow estimated output amount (scaled integer) — from /kalshi/agent/quote
30DFlow minimum output amount (scaled integer) — from /kalshi/agent/quote
30Skill identifier
100Strategy source tag
100Strategy reasoning text (max 1000 chars)
1000