AymarData
Backtest · Solana

Solana Backtest Data: Tick-Level Order Books & Trades

Backtest Solana with Polymarket sol-updown windows — L2 imbalance, trades and settlements over the AymarData REST API.

SOL Up/Down books move quickly when spot is volatile. An imbalance or microprice signal needs reconstructed depth, not last trade alone.

Polymarket coverage (~207.0M messages since 2025-06-01) includes SOL at 5m–24h. Pair this page with the SOL data leaves for schema and sample rows.

Inputs

What you need to backtest Solana properly

What a serious backtest needs beyond candles.

Depth, not just mid

Top-of-book size on SOL windows can be thin. Cap synthetic fills by displayed size and track spread.

Imbalance / microprice features

Pull depth≥5 from /v1/book. Last trade alone is a poor fair-value proxy when the spread is wide.

Settlement for terminal value

Close P&L with /v1/settlement on each concrete window slug.

Coverage

Live Solana coverage

Family-level SOL stats are on each /data/polymarket/sol-updown-* page.

Polymarket platform total

~207.0M

Includes SOL Up/Down · from 2025-06-01

SOL 15m data page

Event rates

/data/polymarket/sol-updown-15m

As of

2026-10-25

Code

End-to-end Solana backtest (REST + requests)

Screens sol-updown-15m for bid-heavy books and records ask entries.

import os
import requests

API = "https://api.aymardata.com/v1"
KEY = os.environ["AYMARDATA_API_KEY"]  # export AYMARDATA_API_KEY=ad_live_…
H = {"Authorization": f"Bearer {KEY}", "User-Agent": "aymardata-backtest/1.0"}

def list_windows(q="sol-updown-15m", interval="15m", limit=30):
    r = requests.get(
        f"{API}/markets",
        headers=H,
        params={"source": "polymarket", "q": q, "interval": interval, "limit": limit},
        timeout=30,
    )
    r.raise_for_status()
    seen, out = set(), []
    for row in r.json()["data"]:
        if row["market"] in seen:
            continue
        seen.add(row["market"])
        out.append(row)
    return out

def book(market, at, outcome="up"):
    r = requests.get(
        f"{API}/book",
        headers=H,
        params={"source": "polymarket", "market": market, "outcome": outcome, "at": at, "depth": 5},
        timeout=30,
    )
    r.raise_for_status()
    return r.json()

def imbalance(snap):
    bids, asks = snap.get("bids") or [], snap.get("asks") or []
    bid_sz = sum(x["size"] for x in bids[:3]) if bids else 0
    ask_sz = sum(x["size"] for x in asks[:3]) if asks else 0
    if bid_sz + ask_sz == 0:
        return None
    return (bid_sz - ask_sz) / (bid_sz + ask_sz)

rows = []
for w in list_windows():
    market, hist = w["market"], w.get("history_from")
    if not hist:
        continue
    snap = book(market, hist)
    imb = imbalance(snap)
    if imb is None:
        continue
    # Long Up when book is bid-heavy
    if imb > 0.25 and snap.get("asks"):
        rows.append({
            "market": market,
            "imbalance": round(imb, 3),
            "ask": snap["asks"][0]["price"],
            "spread": snap.get("spread"),
        })

# Counts only — label any P&L/win-rate/edge you add:
# "Illustrative output — not a real result"
print(f"sol_signals={len(rows)} sample={rows[:3]}")

API base https://api.aymardata.com. Set AYMARDATA_API_KEY from your dashboard. Examples use requests. Any P&L, win-rate, or edge figure derived from these snippets is illustrative output — not a real result.

Free samples

Download sample CSV / Parquet

No key required — small files for schema and local smoke tests.

FAQ

Common questions

Why Polymarket instead of a SOL perpetual here?

Polymarket SOL Up/Down currently has the densest REST book + settlement loop for short-horizon SOL experiments. Perp pages remain available under the data catalog as coverage expands.

Related

Data pages and guides

Catalog leaves for schema and samples; guides for longer walkthroughs.

Run your first backtest with real ticks

Get a key, paste the snippet above, then expand to the full catalog.

Educational content, not trading or investment advice. Past data doesn't predict future results.