Skip to content

Latest Prices

GET /v2/updates/price/latest

Fetch the most recent cached prices in a single HTTP request. Useful for one-shot price lookups or seeding a UI before connecting to the SSE stream.

Request

bash
# Get specific feeds
curl "https://mainnet.proxy.ryze.pro/v2/updates/price/latest?ids[]=ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace&ids[]=eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a"

# Get all cached prices (no ids filter)
curl "https://mainnet.proxy.ryze.pro/v2/updates/price/latest"

Query Parameters

ParameterTypeRequiredDescription
ids[]stringNoPyth hex feed ID (repeatable). If omitted, returns all feeds.

Response

json
{
  "parsed": [
    {
      "id": "ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
      "price": {
        "price": "160025000000",
        "conf": "0",
        "expo": -8,
        "publish_time": 1713200000
      },
      "ema_price": {
        "price": "160025000000",
        "conf": "0",
        "expo": -8,
        "publish_time": 1713200000
      },
      "blend": {
        "token": "0x4200000000000000000000000000000000000006",
        "pythPrice": "1600250000000000000000",
        "cexPrice": "1600300000000000000000",
        "blendFactor": "500000000000000000",
        "blendedPrice": "1600275000000000000000"
      }
    },
    {
      "id": "eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
      "price": {
        "price": "99990000",
        "conf": "0",
        "expo": -8,
        "publish_time": 1713200000
      },
      "ema_price": {
        "price": "99990000",
        "conf": "0",
        "expo": -8,
        "publish_time": 1713200000
      }
    }
  ]
}

Price Object Fields

FieldTypeDescription
idstringPyth hex feed ID
price.pricestringRaw price integer
price.confstringConfidence interval (always "0" from proxy)
price.exponumberExponent (e.g., -8). Actual price = price * 10^expo
price.publish_timenumberUnix timestamp (seconds)
ema_priceobjectExponential moving average (same format as price)
blendobjectBlend metadata (present when blending is active)

Blend Fields

FieldTypeDescription
tokenstringToken contract address
pythPricestringPyth oracle price in WAD
cexPricestringCEX reference price in WAD
blendFactorstringBlend ratio in WAD (0 = Pyth, 1e18 = CEX)
blendedPricestringFinal execution price in WAD

Example: Seed Prices Before SSE

javascript
// Fetch once on page load, then switch to SSE for live updates
async function seedPrices(feedIds) {
  const params = feedIds.map(id => `ids[]=${id}`).join('&');
  const res = await fetch(
    `https://mainnet.proxy.ryze.pro/v2/updates/price/latest?${params}`
  );
  const data = await res.json();

  const prices = {};
  for (const update of data.parsed) {
    prices[update.id] = Number(update.price.price) * Math.pow(10, update.price.expo);
  }
  return prices;
}

// Use immediately, then connect SSE for updates
const prices = await seedPrices([
  'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
  'eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
]);

Converting Prices

javascript
// Raw Pyth format to USD
const raw = "160025000000";
const expo = -8;
const usd = Number(BigInt(raw)) * Math.pow(10, expo);
// = 1600.25

// WAD format to USD (blend fields)
const wad = "1600275000000000000000";
const usdFromWad = Number(BigInt(wad)) / 1e18;
// = 1600.275