Kalshi Quote
curl --request POST \
--url https://www.aionmarket.com/bvapi/kalshi/agent/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"marketTicker": "KXHIGHNY-26FEB19-T70",
"amount": 10,
"shares": 5,
"userPublicKey": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1",
"destinationWallet": "<string>"
}
'import requests
url = "https://www.aionmarket.com/bvapi/kalshi/agent/quote"
payload = {
"marketTicker": "KXHIGHNY-26FEB19-T70",
"amount": 10,
"shares": 5,
"userPublicKey": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1",
"destinationWallet": "<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',
amount: 10,
shares: 5,
userPublicKey: '8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1',
destinationWallet: '<string>'
})
};
fetch('https://www.aionmarket.com/bvapi/kalshi/agent/quote', 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/quote",
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',
'amount' => 10,
'shares' => 5,
'userPublicKey' => '8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1',
'destinationWallet' => '<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/quote"
payload := strings.NewReader("{\n \"marketTicker\": \"KXHIGHNY-26FEB19-T70\",\n \"amount\": 10,\n \"shares\": 5,\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"destinationWallet\": \"<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/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"marketTicker\": \"KXHIGHNY-26FEB19-T70\",\n \"amount\": 10,\n \"shares\": 5,\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"destinationWallet\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.aionmarket.com/bvapi/kalshi/agent/quote")
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 \"amount\": 10,\n \"shares\": 5,\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"destinationWallet\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"quoteId": "<string>",
"expiresAt": "<string>",
"unsignedTransaction": "<string>",
"previewOnly": true,
"kycRequired": true,
"geoblocked": true,
"venue": "<string>",
"marketId": "<string>",
"side": "<string>",
"action": "<string>",
"amount": "<string>",
"shares": "<string>"
}Kalshi
Kalshi Quote
Get an unsigned Kalshi transaction from DFlow. Step 1 of the quote → sign → submit BYOW flow.
POST
/
kalshi
/
agent
/
quote
Kalshi Quote
curl --request POST \
--url https://www.aionmarket.com/bvapi/kalshi/agent/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"marketTicker": "KXHIGHNY-26FEB19-T70",
"amount": 10,
"shares": 5,
"userPublicKey": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1",
"destinationWallet": "<string>"
}
'import requests
url = "https://www.aionmarket.com/bvapi/kalshi/agent/quote"
payload = {
"marketTicker": "KXHIGHNY-26FEB19-T70",
"amount": 10,
"shares": 5,
"userPublicKey": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1",
"destinationWallet": "<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',
amount: 10,
shares: 5,
userPublicKey: '8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1',
destinationWallet: '<string>'
})
};
fetch('https://www.aionmarket.com/bvapi/kalshi/agent/quote', 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/quote",
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',
'amount' => 10,
'shares' => 5,
'userPublicKey' => '8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1',
'destinationWallet' => '<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/quote"
payload := strings.NewReader("{\n \"marketTicker\": \"KXHIGHNY-26FEB19-T70\",\n \"amount\": 10,\n \"shares\": 5,\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"destinationWallet\": \"<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/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"marketTicker\": \"KXHIGHNY-26FEB19-T70\",\n \"amount\": 10,\n \"shares\": 5,\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"destinationWallet\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.aionmarket.com/bvapi/kalshi/agent/quote")
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 \"amount\": 10,\n \"shares\": 5,\n \"userPublicKey\": \"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1\",\n \"destinationWallet\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"quoteId": "<string>",
"expiresAt": "<string>",
"unsignedTransaction": "<string>",
"previewOnly": true,
"kycRequired": true,
"geoblocked": true,
"venue": "<string>",
"marketId": "<string>",
"side": "<string>",
"action": "<string>",
"amount": "<string>",
"shares": "<string>"
}Returns an unsigned Solana transaction from DFlow. The agent signs it locally and submits via
POST /kalshi/agent/submit. Your private key never leaves your machine.
Notes
- Agent-only endpoint. Requires Bearer API key in
Authorizationheader. - Supports
BUY(amount in USDC) andSELL(shares). - Server resolves market token mints from DFlow metadata automatically.
- Response is raw JSON (not wrapped by global ApiResponse interceptor).
- If
quoteErrorCodeis present, the quote is degraded — no unsigned transaction is available.
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 | No | Solana wallet address (overrides agent’s sol_address) |
destinationWallet | string | No | Destination wallet for received tokens |
Example
- curl
- Python SDK
curl -X POST "https://www.aionmarket.com/bvapi/kalshi/agent/quote" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"marketTicker": "KXHIGHNY-26FEB19-T70",
"side": "YES",
"action": "BUY",
"amount": 10,
"userPublicKey": "8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1"
}'
from aion_sdk import AionMarketClient
client = AionMarketClient(
api_key="YOUR_API_KEY",
base_url="https://www.aionmarket.com/bvapi",
)
quote = client.kalshi_quote(
market_ticker="KXHIGHNY-26FEB19-T70",
side="YES",
action="BUY",
amount=10,
user_public_key="8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1",
)
# Check for quote errors before proceeding
if quote.get("quoteErrorCode"):
print(f"Quote error: {quote['quoteErrorCode']} - {quote.get('quoteErrorMessage', '')}")
else:
quote_id = quote["quoteId"]
unsigned_tx = quote["unsignedTransaction"]
Quotes expire in ~2 minutes. Sign and call
POST /kalshi/agent/submit promptly.
If the quote expires, request a new one.Response
{
"marketTicker": "KXHIGHNY-26FEB19-T70",
"title": "Will NYC high be above 70F on Feb 19?",
"status": "active",
"side": "YES",
"action": "BUY",
"yesPrice": "0.6500",
"noPrice": "0.3500",
"yesMint": "6JYgs7EJFc5oQZiWAH1mMzEFEfAdCBGnM4y7rD3P6dS4",
"noMint": "7NykYSMXd3QxjxeRgp3TD1MmwhNwhebZcxes9T2uYLMV",
"inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"outputMint": "6JYgs7EJFc5oQZiWAH1mMzEFEfAdCBGnM4y7rD3P6dS4",
"scaledAmount": "10000000",
"quoteId": "quote_1713604800000_42",
"unsignedTransaction": "AQAB...",
"expiresAt": 1713604920000,
"inAmount": "10000000",
"outAmount": "15384615",
"minOutAmount": "14615384"
}
| Response field | Type | Description |
|---|---|---|
marketTicker | string | Echoed market ticker |
title | string | Market question title |
status | string | Market status (e.g. active, settled) |
side | string | YES or NO |
action | string | BUY or SELL |
yesPrice | string | Current YES price |
noPrice | string | Current NO price |
yesMint | string | YES outcome token mint address |
noMint | string | NO outcome token mint address |
inputMint | string | Input token mint for this trade (USDC or outcome token) |
outputMint | string | Output token mint for this trade (outcome token or USDC) |
scaledAmount | string | Trade amount in atomic units (6 decimals) |
quoteId | string | Server-generated quote ID — pass to /kalshi/agent/submit |
unsignedTransaction | string | Base64-encoded unsigned Solana transaction from DFlow |
expiresAt | number | Quote expiry timestamp in milliseconds |
inAmount | string | DFlow actual input amount (scaled, 6 decimals). Optional |
outAmount | string | DFlow estimated output amount (scaled). Optional |
minOutAmount | string | DFlow minimum output with slippage protection. Optional |
quoteErrorCode | string | Error code when DFlow cannot build transaction. Optional |
quoteErrorMessage | string | Human-readable error message. Optional |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Kalshi market ticker
Maximum string length:
120Example:
"KXHIGHNY-26FEB19-T70"
Trade direction
Available options:
YES, NO, yes, no Order action
Available options:
BUY, SELL, buy, sell BUY order amount in USDC (required when action=BUY, min 0.000001)
Example:
10
SELL share quantity (required when action=SELL, min 0.000001)
Example:
5
User Solana wallet address
Maximum string length:
128Example:
"8Yj7Dfp8oS3wkt2uP12xMz9VfF7ZzBv4qfB8Zbe8vXJ1"
Destination wallet for received tokens
Maximum string length:
128⌘I