Skip to main content

Index values published onchain

What are index values published onchain?

Index values published onchain are the levels of a benchmark or reference index written to a contract on the chain, so tokenized funds, structured products and markets that track the index can read it; the contract is often called an index oracle.

Index providers publish them because a product can only settle against the index on the chain it runs on, and each chain has to show the same value.

A Goldsky Compose task reads each new value from your API on a schedule and writes it to every chain you serve; calculating the index stays with you.

Who uses index values published onchain?

Index and benchmark providers that license indices to tokenized funds, onchain markets and structured products.

How index values get onchain

The diagram follows one index value from your calculation engine to the products that read it on each chain, and shows who does each step. Your setup may differ.

Your business, steps 1–2: Calculate the indexYour index engine produces a new value
Goldsky, step 3: ComposeFetch the valueYour task reads your API on schedule
Goldsky, steps 4–5: ComposePublish to each chainThe same value on every chain you serve
Blockchains, step 6: Products read the indexFunds and markets tracking it update
  • Goldsky

How to publish index values onchain

A TypeScript task that you write and Goldsky hosts runs on a schedule, reads each new index value from your API and writes the same value to the index contract on every chain you serve. Each call it makes is retried and logged.

What you’ll need

  • Goldsky Compose
  • An index calculation engine with an API that returns the latest value
  • An index contract on each chain you serve
  • A process for pausing publication when a value is wrong
  1. Calculate the index

    The index value comes from your methodology, and only your calculation engine produces it.

    Your engine calculates each new value and makes it available through your API with the time it applies to. A value published without its time can’t be told apart from the one before it.

  2. Set up a contract for the index value on each chain

    Apps can only read the index value from a contract on their own chain, so each chain needs one that stores it.

    Deploy a contract on each chain that stores the latest index value and its date, and lets only your publishing wallet update it. If anyone can write to it, anyone can change the index value the apps read.

  3. Fetch the value on schedule

    Handled by Goldsky Compose

    The chain shows the index only when someone writes it there, so a job has to pick up each new value.

    The job runs as often as products need the index refreshed and has to cope with your API being briefly unavailable. If a run fails and nobody is alerted, products keep settling against an old value.

    With Goldsky, a Compose task with a cron trigger reads your API through context.fetch, which retries a failed call with backoff.

    Call external APIs from a task (opens in a new tab)
  4. Publish the same value to each chain

    Handled by Goldsky Compose

    A product on one chain and a product on another should settle against the same index value.

    Each chain is written separately, so a failing chain doesn’t hold up the rest, and the next run catches it up. Every chain gets the same value and timestamp.

    Compose sends one wallet.writeContract call per chain from the same task, run together with Promise.allSettled, and with onReorg set to replay it resends an update a reorg drops.

    Handle confirmations and reorgs (opens in a new tab)
  5. Keep a record of every update

    Handled by Goldsky Compose

    If an app or an auditor asks why a value was on the chain, the answer has to come from records of what was read and written.

    The record ties each value on the chain to the source response it came from, the time it was read and the transaction that wrote it. Without it, rebuilding one update means searching logs on each side by hand.

    Every call a Compose task makes, including each fetch from your source and each transaction it sends, is logged for auditing. If a run is interrupted, calls that already finished aren’t repeated, so a write isn’t sent twice.

    How Compose logs each call (opens in a new tab)
  6. Products read the index

    Funds, markets and structured products that track the index read it from the contract on their chain.

    Each product reads the latest value and its time and applies its own rules. Products should treat a value older than they expect as stale.

What you control

Your team
  • Calculate the index
  • Set up a contract for the index value on each chain

Security and deployment

  • SOC 2 Type IIIndependently audited security controls.
  • Dedicated infrastructureSingle-tenant options for production workloads.
  • Data residencyCloud, on-premises or co-located.

Publish index values 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.

© Endless Sky Inc. All rights reserved.

PrivacyTermsSecurity

System status