Custom Oracle Infrastructure: When to Build vs Buy
Chainlink and Stork cover liquid assets. A team needs a custom oracle when its asset, calculation, or decision rule has no published feed. This guide shows when that applies and how to run one on Goldsky Compose.

Software Engineer
A custom oracle publishes a team's own data or logic onchain, instead of a shared feed such as Chainlink or Stork. Shared feeds cover liquid, widely traded assets. A team needs a custom oracle when the asset, calculation, or decision rule it needs has no published feed. Goldsky Compose runs that kind of first-party oracle in TypeScript on Goldsky's infrastructure.

When a standard feed covers the need
A standard feed fits a liquid asset with many existing consumers. Chainlink and Stork already publish feeds for the common pairs, at the scale the table below shows. If a published feed matches the asset and the update speed a team needs, subscribing is faster than building. A shared feed also draws on many independent data sources.
| Provider | Coverage |
|---|---|
| Chainlink | Secures tens of billions of dollars across more than 500 protocols |
| Stork | More than 500 assets across more than 70 chains, with aggregators that refresh at least every 500 milliseconds |
For those assets, a team can still use Compose to read the shared feed and run its own logic on top. The last section shows how Polymarket does this.
When a team needs a custom oracle
A team needs a custom oracle when any of these is true:
- The asset or metric has no published feed. Examples include a fund's net asset value, a long-tail token, or an internal risk score.
- The resolution logic is specific to the application, such as how a prediction market decides an outcome.
- The oracle update is one step inside a larger workflow, such as a reserve check that also pauses minting below a threshold.
- The data source is a team's own system, such as a custodian API or an internal ledger, not a market price.
A tokenized fund's NAV oracle often meets the first and third conditions at once. No public feed exists for that fund, and the update can also stop publication when a reserve check fails.
The oracle logic is one part of the work. A production oracle must also retry failed calls, manage nonces and gas, handle reorgs, and keep a record of every write. Compose runs those parts on Goldsky's infrastructure, and the team writes only the task.
Building a custom oracle with Goldsky Compose
Compose is Goldsky's onchain execution framework for onchain finance operations. A Compose task runs on a trigger, such as a cron schedule, an onchain event, or an API call. The task reads data from any source, computes a result, and writes it onchain. Goldsky publishes eight build guides for oracles and automation.
| Guide | What it does |
|---|---|
| Bitcoin price oracle (opens in a new tab) | Publishes the BTC/USD price onchain every minute, fetched from CoinGecko |
| Randomness system (opens in a new tab) | Relays randomness from the drand network to a requesting contract |
| NAV oracle (opens in a new tab) | Publishes a tokenized fund's net asset value to multiple chains on a cron schedule, with an operator kill switch |
| Compliance oracle (opens in a new tab) | Screens a wallet against an AML API before it releases an escrowed USDC payment |
| Binary prediction market (opens in a new tab) | Creates and resolves a 5-minute BTC/USD market on Gnosis ConditionalTokens |
| Polymarket copy-trader (opens in a new tab) | Copies a Polymarket wallet's trades through a webhook from a Turbo pipeline |
| Corporate-actions distributor (opens in a new tab) | Pays token holders a pro-rata distribution from a holder snapshot |
| Solana transactions (opens in a new tab) | Builds, signs, and sends a Solana transaction from a Compose task |
The NAV oracle contract implements Chainlink's reader interface, so an existing Chainlink consumer can read it unchanged. If the data source reports a fault, the task skips the publish and does not write bad data. The corporate-actions distributor records which holders it already paid, so a retried task cannot pay twice. Both guides show the same design rule: a custom oracle must stay safe when its source fails or a task runs again.
Compose runs on Goldsky's Scale plan, with usage-based pricing (opens in a new tab). Each fetch, contract read, and contract write counts as one function call.
| Compose cost | Scale plan |
|---|---|
| Free worker allowance | 1 worker (720 hours) a month |
| Free function calls | 10,000 calls a month |
| After the free allowance | $0.05 per worker-hour and $6.00 per 1,000 calls |
Compose creates and resolves more than 80,000 Polymarket markets a month. Goldsky's Polymarket case study reports zero resolutions lost to Polygon reorgs since the system went live. A custom oracle that settles markets or payments must handle reorgs, not only fetch a value.
Choosing between Chainlink, Stork, and Compose
Three paths cover most teams: subscribe to a standard feed, build a custom oracle, or combine both.
| Choice | When it fits |
|---|---|
| Standard feed (Chainlink or Stork) | The asset is liquid and widely traded, and a published feed matches the update speed needed |
| Custom oracle (Compose) | The asset, metric, or resolution rule has no published feed, or the update is one step inside a larger workflow |
| Both | A standard feed supplies the market price, and Compose runs the application-specific resolution or settlement on top |
Polymarket uses both. Chainlink supplies the reference price, and Compose creates and resolves the markets around it.
Switchboard is no longer an option for a new build. Switchboard Technology Labs announced its closure on September 19, 2026, and ended all support on September 25, 2026. It named Pyth and RedStone as replacements for standard price feeds. A team that ran custom logic on a Switchboard feed must rebuild that logic, and Compose covers that part.
Why build on Goldsky
A Compose task reads Goldsky's own indexed chain data (opens in a new tab) directly, across more than 150 chains. A custom oracle therefore does not need a separate indexer, and it reads the same data as the rest of the team's application. Compose traces every external call and every state-changing call, and task code runs in an isolated sandbox. Delivery is at-least-once with managed nonces, so an onchain write lands once even after a retry.
Goldsky is SOC 2 Type II attested for security, availability, and confidentiality. A team that runs a NAV oracle or a compliance-gated payment can share that report with its own customers.
FAQ
Is a custom oracle more expensive than a standard feed?
It depends on the use case. A Compose oracle costs the time to write the task plus Compose usage. The comparison matters only when a standard feed already covers the asset.
Can a custom oracle replace Chainlink or Stork?
Not for standard market prices. Chainlink and Stork are networks that publish shared feeds. A Compose oracle runs a team's own logic on Goldsky. Polymarket uses a standard feed for the price and Compose for the market logic.
Does Goldsky Compose provide a randomness network like Chainlink VRF?
No. Goldsky publishes a guide that relays randomness from the drand network through a Compose task.
What happens to a Switchboard-based oracle today?
Switchboard ended all support on September 25, 2026, so a contract that still reads a Switchboard feed reads stale data. Pyth and RedStone are the named replacements for standard feeds. Compose can run the custom logic a team built around the old feed.
How does a team start building a custom oracle on Goldsky?
Create a Goldsky account and install the Compose CLI. Pick the build guide closest to the use case, such as the NAV oracle or compliance oracle guide. Then adapt its TypeScript task and contract to the team's own data source.