Onchain interest rate, funding rate and volatility feeds
What it is
Onchain rate and volatility feeds publish benchmarks such as lending rates, perpetual funding rates and asset volatility to smart contracts, so lending and derivatives protocols can settle against a value everyone can read.
Oracle networks, index providers and DeFi protocols run them because a contract can only use data that’s been written onchain, and a wrong or stale value moves money.
Goldsky streams the onchain rate updates to a scheduled task that also fetches your offchain inputs, applies your methodology and writes the result to each chain, recording every input it used; the methodology and the contracts that consume the feed stay with you.
Who it’s for
Oracle networks, index and benchmark providers, and lending and perpetuals protocols that publish their own reference rates.
How an onchain rate or volatility feed gets published
The diagram follows one update from the rate changes on lending and perpetuals markets to the contracts that settle against the published benchmark. Your setup may differ.
Let the markets move
Lending rates and perpetual funding rates change onchain whenever traders and borrowers act.
Lending markets emit an event each time their borrow or supply rate updates, and perpetuals exchanges emit one when funding is settled. These events are the onchain inputs to your benchmark.
Stream the rate updates to your task
Handled by Goldsky ComposeYour methodology needs the latest onchain rates on hand when it runs.
Each rate update has to be decoded and stored where the task can read it, with its block number. If updates are missed, the benchmark is worked out from stale rates.
A Compose task can declare its own Turbo Pipelines pipeline as an onchain trigger: a
Trigger a task from a pipeline (opens in a new tab)compose_tasksink delivers each decoded rate update to the task, which stores it in the app’s database withctx.db.Gather every input on a schedule
Handled by Goldsky ComposeA benchmark is published at a set rhythm, so each run collects all of its inputs at once.
The run reads the stored onchain rates and fetches offchain inputs such as exchange prices or option quotes. Every input has to be kept with the run that used it, so anyone can check later how a published value was reached.
Goldsky Compose runs the task on a cron trigger, and each
Make auditable HTTP requests (opens in a new tab)ctx.fetchcall, with its URL and response, is recorded on the run, so the inputs behind every value can be audited afterwards.Calculate the benchmark
Your methodology turns the inputs into one number, such as an average rate or a volatility index.
The calculation is code you write and own, including what happens when an input is missing or looks wrong. A run that publishes anyway with bad inputs can move money on every protocol that reads the feed, so decide in advance when to skip.
Publish the benchmark to each chain
Handled by Goldsky ComposeContracts can only read values written onchain, so the benchmark is sent to a feed contract on every chain that uses it.
Each write is a signed transaction that has to confirm, and one chain failing shouldn’t block the others. A write undone by a reorg has to be sent again, or contracts on that chain read an older value.
With Goldsky Compose, the task writes to each chain’s contract from a managed wallet and waits for the confirmations you set, resending if a reorg drops the transaction.
Wait for confirmations and reorgs (opens in a new tab)Let contracts read the feed
Lending and perpetuals protocols read the latest value when they settle interest, funding or liquidations.
The feed contract exposes the value and the time it was updated. Consumers should check that time and refuse a value older than they accept, because a stale rate settles positions at the wrong price.
What you control
- Your team
- Calculate the benchmark
Security and deployment
- SOC 2 Type IIIndependently audited security controls.
- Dedicated infrastructureSingle-tenant options for production workloads.
- Data residencyCloud, on-premises or co-located.
More use cases that run protocol automation
- Run your own oracle price feedPush prices and other data to contracts on many chains.
- Smart contract automation and keepersRun recurring or event-driven contract calls a protocol needs to keep working.
- Onchain circuit breakersPause a token, market or payout when a rule is breached.
- Cross-chain automationAct on one chain when an event happens on another.
- VRF and verifiable randomness for smart contractsDeliver signed random values to contracts for prize draws, lottery allocations and random selection, checkable by anyone.
Use cases built the same way
- Continuous proof of reservesCompare onchain supply with reported reserves on a schedule, then publish the ratio or alert on a gap.
- Wrapped bitcoin reserve monitoringCheck a wrapped bitcoin token’s supply on every chain against the BTC at its custodian’s reserve addresses, and alert on any gap.
- Tokenized securities venue disclosuresPublish trading notices, enforce volume caps and sync halts with the listing exchange.
Publish rate and volatility feeds onchain with Goldsky
We’ll map it to your systems and show you what Goldsky runs, so your team builds the product, not the pipelines underneath it.