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[]=9d4294bbcd1174d6f2003ec365831e64cc31d9f6f15a2b85399db8d5000960f6&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": "9d4294bbcd1174d6f2003ec365831e64cc31d9f6f15a2b85399db8d5000960f6",
      "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([
  '9d4294bbcd1174d6f2003ec365831e64cc31d9f6f15a2b85399db8d5000960f6',
  '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