Tenor

Build On Tenor

Three ways to read a forward. Off-chain over HTTP, from a browser or server, or from another contract on Base.

HTTP
curl "https://tenor.example/api/forward?pair=USD/CAD&tenor=1M"
JavaScript
const r = await fetch("https://tenor.example/api/forward?pair=USD/CAD&tenor=1M");
const { rate, confidence, count, publishers } = await r.json();
// rate       1.37345   median across fresh publishers
// confidence 0.00012   max minus min across publishers
// count      3         publishers behind the number
// publishers [{ name, rate, signature, ... }]
Solidity (Base Sepolia)
interface ITenorOracle {
    /// pair = bytes32("USD/CAD"); tenor: 0 SPOT, 1 ON, 2 1W, 3 1M, 4 3M, 5 6M, 6 1Y
    /// rate and confidence are scaled by 1e8
    function getForward(bytes32 pair, uint8 tenor)
        external view
        returns (int256 rate, int256 confidence, uint256 count, uint64 updatedAt);
}

(int256 fwd, , uint256 n, ) = ITenorOracle(TENOR).getForward("USD/CAD", 3);
require(n >= 1, "no fresh forward");

How A Number Gets Here

  1. A publisher builds a spot rate and a forward curve from its own sources.
  2. It signs each value with its private key. The signature proves who said it and that nothing changed.
  3. Anyone relays the signed values to the oracle contract, which checks the signature and stores them.
  4. Readers get the median across fresh publishers and a band showing how far apart they were.