How Point-in-Time Crypto Prices Work Under the Hood
Accurate prices aren't magic - they're a pipeline. This post walks through how a price goes from an on-chain Chainlink feed to a single number you can query for any exact moment, and how you authenticate to get it. If you're building anything around Polymarket 5/15/30/60-minute trades, the moment-level precision is the entire game: the open and the close are just two timestamps, and you need the right number at both.
The pipeline in one diagram
On-chain price feed ──▶ live listener ──▶ crypto_price table ──▶ REST API ──▶ you
(Chainlink) (auto-reconnect) (append-only) (X-API-Key)
1. The live listener
A long-running WebSocket client - we call it the RTDS listener - subscribes to the on-chain Chainlink price feed and writes every update into the crypto_price table. It runs as its own process, separate from the web server, and it auto-reconnects: if the socket drops, it re-establishes and keeps ingesting. That's what keeps the price history continuous instead of full of holes, which is exactly the property you need when a market resolves on a single second and you can't afford a missing tick.
In our stack the listener and the API are two services sharing one image, so they scale and restart independently. The ingest path never blocks the read path.
2. Point-in-time lookups
Two read patterns cover almost every need:
# Everything we have (latest per ticker)
# The price as of a precise instant - RFC3339 timestamp
The get_price_at action is the important one for settlement and backtesting: you hand it an exact timestamp and it returns the correct price as of that moment - not "now," and not a rolling average. Want the starting price of a 5-minute window? Pass the open timestamp. Want to know what it closed at? Pass the close. Because ingestion is continuous, the answer reflects what the feed actually reported then - the same number a fair settlement would use.
3. Authentication
There's no anonymous access. Every request must carry a valid, in-scope key in the X-API-Key header:
- Keys are created from /account/ and shown exactly once.
- They're hashed at rest - we never store the raw key.
- You can attach an origin/IP allowlist to a key, so a leaked key is useless from anywhere you didn't authorize.
- A missing or out-of-scope key gets a
401.
# No key, or wrong scope:
The tickers
The feed covers the five tickers that dominate crypto prediction markets: BTC, ETH, SOL, XRP, DOGE. Same endpoints, same auth, one consistent shape for all of them - so a client you write for Bitcoin works unchanged for Dogecoin.
Try it against the live docs
The service ships an OpenAPI/Swagger UI at /openapi/ and an interactive /playground/, so you can explore the schema and fire real requests before writing a single line of integration code. Pull a timestamp you care about, eyeball the response shape, then wire it in.
That's the whole system: ingest continuously, query precisely, authenticate strictly. Accurate Polymarket crypto prices, by construction.