6 methods · solana-agent-kit + MCP skill

Agent API

sports-workbench exposes 6 methods on the SolanaAgentKit interface. Each method returns a Verifiable Settlement Receipt alongside its payload — agents can read the result, present it to a user, and ship the proof.

01

install

Add the plugin to your SolanaAgentKit instance. The plugin auto-registers all 6 methods on the agent.

import { TxlinePlugin } from "@srivtx/sports-workbench";
import { SolanaAgentKit } from "solana-agent-kit";

const agent = new SolanaAgentKit({ wallet, network: "devnet" });
agent.use(new TxlinePlugin({ apiToken: process.env.TXLINE_API_TOKEN }));
02

backtestOdds

READ

Replay historical TxLINE odds against any of the 4 strategies. Returns a list of signals plus aggregate PnL, hit rate, and a Verifiable Settlement Receipt per signal.

try it →
agent.methods.backtestOdds({
  strategy: "sharpDetector",
  threshold: 0.5,
  fixtureId: 17588234,
  "kw">from: 1782400000000,
  to: 1782500000000,
}): Promise<BacktestResult>
strategyenum
sharpDetector | momentum | meanReversion | custom
fixtureIdu64
Single fixture or omit for all
fromu64
Unix ms start
tou64
Unix ms end
thresholdf64
Signal threshold (default 0.5)
{
  "range": { "from": "2026-06-24 12: 00: 00Z", "to": "2026-06-25 12: 00: 00Z" },
  "filter": { "strategy": "sharpDetector", "threshold": 0.5, "fixtureId": 17588234 },
  "signals": 3,
  "hitRate": 0.67,
  "pnl": 1.24,
  "signals_detail": [
    {
      "id": "sig_001",
      "fixtureId": 17588234,
      "market": "1X2 home",
      "deltaPct": 40.61,
      "receipt": { "verified": true, "merkleRoot": "0x7a9f3b..." }
    }
  ]
}
{ signals: Signal[], pnl: f64, hitRate: f64, receipts: Receipt[] }
03

findSharpMove

READ

Scan the live TxLINE SSE feed for a single fixture and emit signals the moment a threshold move is detected. Persists receipts to .sports-workbench-state.json.

try it →
agent.methods.findSharpMove({
  fixtureId: 17588234,
  strategy: "sharpDetector",
  threshold: 0.5,
}): Promise<{ signals: Signal[], fired: number }>
fixtureIdu64
Required
strategyenum
Default: sharpDetector
thresholdf64
Default 0.5
{
  "strategy": "sharpDetector",
  "fixtureId": 17588234,
  "fired": 3,
  "signals": [
    {
      "id": "sig_001",
      "market": "O/U 1.5 home goals",
      "deltaPct": 40.61,
      "oddsBefore": 1.85,
      "oddsAfter": 2.60,
      "receipt": { "verified": true }
    }
  ]
}
Stream<Signal>
04

getOdds

READ

Fetch the current canonical odds for a fixture across all market types. Each call includes a Merkle proof so callers can verify the data on Solana.

try it →
agent.methods.getOdds({
  fixtureId: 17588234,
  marketType: "MATCH_RESULT_3WAY",
}): Promise<{ fixture: Fixture, markets: Market[] }>
fixtureIdu64
Required
marketTypesstring[]
Optional filter
{
  "fixtureId": 17588234,
  "competition": "UEFA World Cup 2026 Qualifier",
  "home": "BRA", "away": "ARG", "status": "live", "score": { "home": 0, "away": 0 },
  "markets": [
    { "type": "MATCH_RESULT_3WAY", "home": 2.10, "draw": 3.40, "away": 3.60, "deltaPct": 12.4 }
  ],
  "receipt": { "verified": true, "merkleRoot": "0x7a9f3b..." }
}
{ fixtureId, markets: Market[], receipt: Receipt }
05

getFixtures

READ

List fixtures for a competition (or all 8 leagues + World Cup). Free tier covers 8 soccer leagues; 7-day replay available for paid.

try it →
agent.methods.getFixtures({
  competition: "worldcup",
  status: "live",
}): Promise<{ count: number, fixtures: Fixture[] }>
competitionstring
Optional - default all
statusenum
live | upcoming | finished
{
  "count": 6,
  "live": 3,
  "upcoming": 2,
  "fixtures": [
    { "id": 18172280, "home": "GER", "away": "ESP", "status": "live", "score": { "home": 1, "away": 1 }, "minute": 67 }
  ]
}
Fixture[]
06

proveOdds

PROOF

Resolve a (fixture, messageId) pair against the on-chain Merkle root. Returns a signed attestation suitable for downstream use (settlement, audit, dispute).

try it →
agent.methods.proveOdds({
  fixtureId: 17588234,
  messageId: "1835131630:00003:000063-10021-stab",
}): Promise<Receipt>
fixtureIdu64
Required
messageIdstring
TxLINE MessageId
{
  "messageId": "1835131630: 00003: 000063-10021-stab",
  "fixtureId": 17588234,
  "programId": "6pW64gN1s2uqjHkn1unFeEjAwJkPGHoppGvS715wyP2J",
  "subTreeRoot": "0x4a8f...",
  "merkleRoot": "0x7a9f3b...",
  "batchRootsPda": "ABC4…WXYZ (epochDay=20364)",
  "subTreeProof": "6 sibling hashes · SHA-256",
  "mainTreeProof": "12 ancestor hashes",
  "verifyCall": "txoracle::validate_odds · compute=1,384,291",
  "verified": true
}
Receipt (programId, batchRootsPda, subTreeProof, mainTreeProof)
07

describeStrategy

READ

Return the natural-language + mathematical definition of a strategy. Useful for agent planning, prompt engineering, and audit trails.

try it →
agent.methods.describeStrategy({
  strategy: "sharpDetector",
}): Promise<{ name, summary, math, params }>
strategyenum
sharpDetector | momentum | meanReversion | custom
{
  "name": "sharpDetector",
  "summary": "Fires when max |deltaPct| across any market exceeds the threshold.",
  "math": "if max(|Δprice_i|) over window W > threshold: emit signal",
  "params": { "threshold": "f64 (default 0.5)", "window": "u64 ticks (default 50)" }
}
{ name, summary, math, params: Param[] }