Getting Started

Quickstart

This guide walks through placing a trade via the REST API. You need a Solana wallet with USDC and an API key.

1. Get an API key

Follow the Authentication guide to create one. You should have a key like stld_02119e5f....

2. Find a market

curl https://api.settled.pro/v1/series?limit=5 \
  -H "X-API-Key: stld_YOUR_KEY"

Pick a series with status: "open" in its current_round. Note the market id from current_round.id.

3. Place a trade

Buy 10 USDC of YES shares:

curl -X POST https://api.settled.pro/v1/markets/MARKET_ID/trade \
  -H "X-API-Key: stld_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"side": "yes", "usdc_amount": "10.00"}'
const res = await fetch(`https://api.settled.pro/v1/markets/${marketId}/trade`, {
  method: 'POST',
  headers: {
    'X-API-Key': 'stld_YOUR_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ side: 'yes', usdc_amount: '10.00' })
})
const { data } = await res.json()
console.log(`Bought ${data.shares} shares at ${data.price_per_share} each`)
import requests

res = requests.post(
    f'https://api.settled.pro/v1/markets/{market_id}/trade',
    headers={'X-API-Key': 'stld_YOUR_KEY'},
    json={'side': 'yes', 'usdc_amount': '10.00'}
)
trade = res.json()['data']
print(f"Bought {trade['shares']} shares at {trade['price_per_share']} each")

Response:

{
  "data": {
    "trade_id": "a1b2c3d4-...",
    "side": "yes",
    "shares": "13.698630",
    "price_per_share": "0.730000",
    "cost_usdc": "10.000000",
    "fee_usdc": "0.100000",
    "new_yes_price": "0.742000",
    "new_no_price": "0.258000"
  }
}

You now hold 13.7 YES shares. If the funding rate is positive at settlement, each share pays $1. Your payout: $13.70. Your profit: $3.60 (after $0.10 fee).

4. Check your position

curl https://api.settled.pro/v1/users/me/positions \
  -H "X-API-Key: stld_YOUR_KEY"

5. Wait for settlement

The market auto-resolves at the scheduled settlement time. The oracle fetches the actual funding rate from the exchange, achieves consensus, and pays winners.

Check the outcome:

curl https://api.settled.pro/v1/markets/MARKET_ID

Your USDC balance updates automatically if you won. No claim needed.

Build a Trading Bot

Automate your strategy with the full API

← PreviousAuthenticationNext →Overview