Guides

End-to-end recipes that string the primitives together. Each is copy-paste ready — drop in your API key and a mint or wallet address.

Track a wallet live

Backfill the current book over REST, then keep it current over WebSocket — the zero-gap pattern from the REST + Streaming Model.

Fetch the snapshot

GET /v1/wallet/{address}/positions?status=open for the wallet’s open lots.

Subscribe to the streams

Open wss://api.conyr.ai/ws and subscribe to wallet:{address}:pnl and wallet:{address}:positions.

Apply events on top

Realized PnL arrives when a trade closes; position deltas arrive as buys and sells land.

import asyncio, json, requests, websockets
 
API_KEY = "YOUR_API_KEY"
WALLET = "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
headers = {"Authorization": f"Bearer {API_KEY}"}
 
# 1. Snapshot
positions = requests.get(
    f"https://api.conyr.ai/v1/wallet/{WALLET}/positions",
    headers=headers, params={"status": "open"},
).json()["positions"]
print(f"Holding {len(positions)} open positions")
 
# 2 + 3. Stream and apply
async def track():
    url = f"wss://api.conyr.ai/ws?api_key={API_KEY}"
    async with websockets.connect(url) as ws:
        await ws.send(json.dumps({
            "op": "subscribe",
            "channels": [f"wallet:{WALLET}:pnl", f"wallet:{WALLET}:positions"],
        }))
        async for msg in ws:
            evt = json.loads(msg)
            ch = evt.get("channel", "")
            if ch.endswith(":pnl"):
                print(f"Trade closed: ${evt['data'].get('realized_pnl_usd', 0):.2f}")
            elif ch.endswith(":positions"):
                print(f"Position update: {evt['data']}")
 
asyncio.run(track())
⚠️

First-class unrealized PnL (REST + a wallet:{addr}:unrealized-pnl stream) is on the roadmap. Until it ships, derive it from the open positions above and the latest price from GET /v1/token/{mint}/price.

Vet a token before you trade

Three calls answer “is this organic, or manufactured?” — and bundles/summary and buyer-quality are free tier.

import requests
 
API_KEY = "YOUR_API_KEY"
headers = {"Authorization": f"Bearer {API_KEY}"}
MINT = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
base = f"https://api.conyr.ai/v1/token/{MINT}"
 
summary = requests.get(f"{base}/bundles/summary", headers=headers).json()   # free
buyers  = requests.get(f"{base}/buyer-quality",   headers=headers).json()   # free
score   = requests.get(f"{base}/score",           headers=headers).json()   # Layer 2
 
print(f"Bundled supply: {summary.get('bundled_supply_pct', 0):.1f}%  "
      f"(dominant: {summary.get('dominant_bundle_type')})")
print(f"Smart-money signal: {buyers.get('smart_money_signal')}")
print(f"Health score: {score.get('composite_score')}/100")

Go deeper with Funding Abuse (was the early-buyer cohort farm-seeded?) and the full Bundles roster to see the exact coordinated wallets.

Build a token dashboard

Fetch metadata, price, candles, and the trade tape in parallel, then keep the chart and tape live over WebSocket.

const API_KEY = "YOUR_API_KEY";
const MINT = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
const headers = { Authorization: `Bearer ${API_KEY}` };
const base = `https://api.conyr.ai/v1/token/${MINT}`;
 
const [info, price, ohlcv, trades] = await Promise.all([
  fetch(`${base}/info`, { headers }).then((r) => r.json()),
  fetch(`${base}/price`, { headers }).then((r) => r.json()),
  fetch(`${base}/ohlcv?timeframe=5m&view=filtered&limit=200`, { headers }).then((r) => r.json()),
  fetch(`${base}/trades?limit=50`, { headers }).then((r) => r.json()),
]);
 
console.log(`${info.symbol}  $${price.price_usd}  status=${info.status}`);
console.log(`${ohlcv.candles.length} candles, ${trades.trades.length} recent trades`);
 
// Then go live: subscribe to token:{MINT}:ohlcv:filtered:5m and token:{MINT}:trades

Use the filtered OHLCV view for clean price discovery (bot/wash trades removed) — see OHLCV Candles.

Find genuinely skilled wallets

The leaderboard ranks by PnL, but big PnL can be luck or size. Wallet Quality corrects for it — position_win_rate_pct is the position-level truth, and raw_exit_win_rate_pct is the commodity number every other API reports.

import requests
 
API_KEY = "YOUR_API_KEY"
headers = {"Authorization": f"Bearer {API_KEY}"}
 
board = requests.get(
    "https://api.conyr.ai/v1/leaderboard",
    headers=headers, params={"window": "7d", "sort": "pnl_usd", "limit": 10},
).json()["leaderboard"]
 
for e in board:
    w = e["wallet_address"]
    q = requests.get(f"https://api.conyr.ai/v1/wallet/{w}/quality", headers=headers).json()
    if not q or not q.get("rated"):
        continue
    print(f"{w[:8]}…  skill {q['skill_score']:.0f}/100  "
          f"position WR {q['position_win_rate_pct']:.1f}%  "
          f"(commodity shows {q['raw_exit_win_rate_pct']:.1f}%)")
💡

Found a wallet you like? Pull its behavioral look-alikes to find more that trade the same way.