Oracle Feeds API

Composite pricing from Pyth + Switchboard + PLX synthetic feed. Includes confidence and variance to tune bots and risk checks.

Endpoints

  • GET /oracle/latest?symbol=SOL/USD

  • GET /oracle/history/{symbol}?from=...&to=...

curl

curl -s "https://api.plx.fi/v1/oracle/latest?symbol=SOL/USD"
{
  "symbol":"SOL/USD",
  "price":187.34,
  "confidence":0.997,
  "variance":0.0021,
  "sources":[
    {"name":"pyth","price":187.31,"weight":0.5},
    {"name":"switchboard","price":187.35,"weight":0.4},
    {"name":"plx-synth","price":187.37,"weight":0.1}
  ],
  "ts":1735698259
}
curl -s "https://api.plx.fi/v1/oracle/history/SOL%2FUSD?from=1735694000&to=1735698200&interval=60"
{
  "symbol":"SOL/USD",
  "interval_sec":60,
  "points":[
    {"t":1735694100,"p":186.92,"var":0.0029},
    {"t":1735694160,"p":187.02,"var":0.0026}
  ]
}

TypeScript (polling helper)

const o = await api("/oracle/latest?symbol=SOL/USD");
if (o.variance > 0.005) {
  console.warn("High oracle variance; widen rebalance bands.");
}

Last updated