DIA Nexus Documentation
  • Nexus Overview
  • Intro to Nexus
    • How it works
    • Nexus vs. Lumina
    • Integrated Chains
  • Data products
    • Token Price Feeds
    • RWA Price Feeds
    • Randomness
    • Fair-value Feeds
  • How-to Guides
    • Fetch Price Data
      • Solidity
      • Vyper
      • Demo Oracles
      • Chain-specific Guide
        • Aleph Zero
        • Alephium
        • Edu Chain
        • Hydration
        • Kadena
        • LUKSO
        • Somnia
        • Stacks
        • Superseed
        • XRP Ledger (XRPL)
    • Generate Randomness
      • Solidity
      • WASM
      • Demo Oracles
      • Chain-specific Guide
        • Alephium
    • Migrate to DIA
    • Fund the Oracle
    • Build a Scraper
      • Development Cluster Stack
      • DIA Test‐Space with Docker Compose
      • DIA Test‐Space with Minikube
      • Add a new exchange scraper
      • Add a new foreign scraper
      • Add a new liquidity scraper
      • Additional notes
  • Request a Custom Oracle
  • Reference
    • Architecture
      • Data sourcing
      • Data computation
      • Data delivery
    • APIs
      • Token prices
        • RestAPI
          • Request Samples
        • GraphQL
          • Request Samples
      • RWA prices
    • Pricing Methodologies
      • IR: Interquartile Range Filter
      • MAIR: Moving Average with Interquartile Range Filter
      • VWAP: Volume Weighted Average Price
      • VWAPIR: Volume Weighted Average Price with Interquartile Range Filter
      • LST fair price
    • Data Sources
      • CEXes Data
      • DEXes Data
    • Smart Contracts
      • DIAOracleV2.sol
      • DIARandomOracle.sol
    • Randomness Protocol
  • Resources
    • Audits
    • Community & Support
    • Security Bounty Program
    • Research
      • Return Rates in Crypto Farming
      • Crypto Volatility Index
      • Compounded Rates
      • Polkadot Medianizer
    • T&C
      • Licence Agreement
      • Contributor Covenant Code of Conduct
      • Disclaimer
Powered by GitBook
On this page
  • Standard Methodology
  • DIA Methodology
Export as PDF
  1. Resources
  2. Research

Compounded Rates

PreviousCrypto Volatility IndexNextPolkadot Medianizer

In order to reduce the impact of outliers in daily fluctuations of financial markets, many financial products use simple or compounded averages of a given reference rate. For instance, on every business day the New York Federal Reserve Bank publishes the average rate of the Secured Overnight Financing Rate, compounded over the last 30 calendar days under the name of SOFR30.

Standard Methodology

Here, we present the methodology of compounded rates that is used by large banks such as the New York Federal Reserve Bank (compounded SOFR) and the Bank of England (compounded SONIA).

Consider a unit investment over a time period of dcd_cdc​ calendar days containing db≤dcd_b\leq d_cdb​≤dc​ business days. Let rir_iri​ be an interest rate that is published once every business day and assume that the business day convention is such that the year has NNN days. Then, the compounded gain GGG over the whole interest period results to

\begin{equation} G= \prod_{i=1}^{d_b}\left( 1 + \frac{r_i \times n_i}{N} \right) \end{equation} .

We remark that for constant interest rates ri=rr_i = rri​=r and ni=1n_i = 1ni​=1 this simplifies to the well-known compounded gain formula G=(1+rN)dbG=\left(1+\frac{r}{N}\right)^{d_b}G=(1+Nr​)db​. However, in general, the rate factor nin_ini​ is an integer value that accounts for iii being a business day or a non-business day. More precisely, if iii is a business day followed by kkk non-business days, we set ni=k+1n_i = k+1ni​=k+1. For instance, if iii is followed by a business day, i.e., k=0k=0k=0, we have ni=1n_i=1ni​=1. For a friday, which is usually followed by two non-business days, we would have ni=3n_i = 3ni​=3. Now, in order to get the average interest III from the compounded gain GGG, we subtract the original investment and normalize, thus obtaining

I=Ndc[∏i=1db(1+ri×niN)−1]I = \frac{N}{d_c}\left[\prod_{i=1}^{d_b}\left( 1 + \frac{r_i \times n_i}{N} \right) -1\right]I=dc​N​[∏i=1db​​(1+Nri​×ni​​)−1]

which is the formulation of compounded rates used by the FED and the BOE amongst others.

Sources:

DIA Methodology

The methodology from the previous section has a special feature in that it mixes compounded and non-compounded rates. More precisely, investments are not compounded for weekends and holidays. This behaviour is reflected in the rate factor nin_ini​. In the Index IDIAI_{DIA}IDIA​ presented below, investments are compounded over all calendar days in the respective interest period.

Consider a unit investment over a time period of dcd_cdc​ calendar days. Let rir_iri​ be an interest rate that is published once every business day and assume that the business day convention is such that the year has NNN days. We define an interest rate r~i\tilde{r}_ir~i​ such that r~i\tilde{r}_ir~i​ coincides with rir_iri​ on business days and is set to the rate of the previous business day if iii is a holiday or a weekend. In this straightforward manner we obtain an interest rate for all calendar days and can now set

IDIA=Ndc[∏j=1dc(1+r~jN)−1].I_{DIA}=\frac{N}{dc}\left[\prod_{j=1}^{d_c}\left( 1 + \frac{\tilde{r}_j}{N} \right) -1\right].IDIA​=dcN​[∏j=1dc​​(1+Nr~j​​)−1].

Link to API documentation: Coming soon!

https://www.newyorkfed.org/medialibrary/Microsites/arrc/files/2019/Users_Guide_to_SOFR.pdf
https://www.bankofengland.co.uk/paper/2020/supporting-risk-free-rate-transition-through-the-provision-of-compounded-sonia