Skip to content

Correlation

Compute pairwise Pearson correlation coefficients for any combination of crypto assets and traditional finance instruments. The resulting NxN matrix is built from daily log returns and supports lookback periods from 30 days to 3 years. Use it for portfolio diversification analysis, regime detection, or cross-asset risk monitoring.


Get correlation matrix

Returns a symmetric correlation matrix for the requested assets and period. The matrix is computed from daily log returns with a minimum data coverage threshold of 80% -- asset pairs with insufficient overlapping data return null coefficients.

Query parameters

  • Name
    period
    Type
    string
    Description

    Lookback period. One of 30d, 90d, 1y, 3y. Defaults to 30d.

  • Name
    ids
    Type
    string
    Description

    Comma-separated asset identifiers. Crypto assets use canonical IDs (e.g., bitcoin, ethereum, solana). TradFi assets use short IDs (e.g., sp500, gold, dxy, aapl, nvda). Maximum 10 assets. Defaults to bitcoin,ethereum,solana,sp500,gold.

Response fields

  • Name
    assets
    Type
    array
    Description

    Ordered array of asset metadata matching the matrix dimensions.

  • Name
    assets[].id
    Type
    string
    Description

    Asset identifier (canonical crypto ID or TradFi short ID).

  • Name
    assets[].name
    Type
    string
    Description

    Display name (e.g., Bitcoin, S&P 500).

  • Name
    assets[].symbol
    Type
    string
    Description

    Ticker symbol (e.g., BTC, SPY).

  • Name
    assets[].type
    Type
    string
    Description

    "crypto" or "tradfi".

  • Name
    assets[].logoUrl
    Type
    string
    Description

    URL to the asset logo, if available.

  • Name
    matrix
    Type
    (number | null)[][]
    Description

    NxN array of Pearson correlation coefficients. matrix[i][j] is the correlation between assets[i] and assets[j]. Values are in [-1, 1], or null when fewer than 80% of the period's days are present in both series. Self-correlations on the diagonal are 1.

  • Name
    dataPoints
    Type
    number[][]
    Description

    NxN array of integers. dataPoints[i][j] is the number of overlapping daily observations used to compute matrix[i][j]. TradFi-only pairs use trading-day counts (≈252/year), so a 90-day period yields fewer points than a crypto-only pair over the same window.

  • Name
    period
    Type
    string
    Description

    The period that was applied.

  • Name
    computedAt
    Type
    string
    Description

    ISO 8601 timestamp of the last matrix computation, or null.

Request

GET
/v1/correlation/matrix
curl -G https://www.sharpe.ai/api/v1/correlation/matrix \
  -H "Authorization: Bearer sk_live_your_key_here" \
  -d period=90d \
  -d ids=bitcoin,ethereum,solana,sp500,gold
{
  "data": {
    "assets": [
      {
        "id": "bitcoin",
        "name": "Bitcoin",
        "symbol": "BTC",
        "type": "crypto",
        "logoUrl": "https://assets.sharpe.ai/coins/bitcoin.png"
      },
      {
        "id": "ethereum",
        "name": "Ethereum",
        "symbol": "ETH",
        "type": "crypto",
        "logoUrl": "https://assets.sharpe.ai/coins/ethereum.png"
      },
      {
        "id": "solana",
        "name": "Solana",
        "symbol": "SOL",
        "type": "crypto",
        "logoUrl": "https://assets.sharpe.ai/coins/solana.png"
      },
      {
        "id": "sp500",
        "name": "S&P 500",
        "symbol": "SPY",
        "type": "tradfi",
        "logoUrl": "/tradfi-logos/spy.svg"
      },
      {
        "id": "gold",
        "name": "Gold",
        "symbol": "GLD",
        "type": "tradfi",
        "logoUrl": "/tradfi-logos/gld.svg"
      }
    ],
    "matrix": [
      [1.0,   0.87,  0.82,  0.45,  0.12],
      [0.87,  1.0,   0.91,  0.41, -0.03],
      [0.82,  0.91,  1.0,   0.38, -0.08],
      [0.45,  0.41,  0.38,  1.0,   0.15],
      [0.12, -0.03, -0.08,  0.15,  1.0]
    ],
    "dataPoints": [
      [90, 90, 90, 64, 64],
      [90, 90, 90, 64, 64],
      [90, 90, 90, 64, 64],
      [64, 64, 64, 64, 64],
      [64, 64, 64, 64, 64]
    ],
    "period": "90d",
    "computedAt": "2026-03-28T04:00:00Z"
  },
  "meta": {
    "request_id": "req_abc123def456ghij",
    "timestamp": "2026-03-28T12:00:00Z"
  }
}

Available TradFi assets

The following TradFi asset IDs are supported in the ids parameter. Crypto assets use their canonical ID (e.g., bitcoin, ethereum, solana, dogecoin).

Indices and commodities

IDNameSymbol
sp500S&P 500SPY
nasdaqNasdaq 100QQQ
goldGoldGLD
dxyUS Dollar IndexDXY

US stocks

IDNameSymbol
aaplAppleAAPL
msftMicrosoftMSFT
nvdaNVIDIANVDA
tslaTeslaTSLA
amznAmazonAMZN
googlAlphabetGOOGL
metaMetaMETA
brkBerkshireBRK.B
jpmJPMorganJPM
vVisaV

Additional stocks are available on demand: amd, nflx, crm, dis, ba, ko, pep, wmt, cost, intc, pypl, coin, mstr, pltr, uber, sq, snow, sofi, hood, spot.

Request — mixed assets

GET
/v1/correlation/matrix?ids=bitcoin,nvda,sp500
curl -G https://www.sharpe.ai/api/v1/correlation/matrix \
  -H "Authorization: Bearer sk_live_your_key_here" \
  -d period=1y \
  -d ids=bitcoin,nvda,sp500
{
  "data": {
    "assets": [
      {
        "id": "bitcoin",
        "name": "Bitcoin",
        "symbol": "BTC",
        "type": "crypto"
      },
      {
        "id": "nvda",
        "name": "NVIDIA",
        "symbol": "NVDA",
        "type": "tradfi",
        "logoUrl": "/tradfi-logos/nvda.svg"
      },
      {
        "id": "sp500",
        "name": "S&P 500",
        "symbol": "SPY",
        "type": "tradfi",
        "logoUrl": "/tradfi-logos/spy.svg"
      }
    ],
    "matrix": [
      [1.0,  0.52, 0.48],
      [0.52, 1.0,  0.89],
      [0.48, 0.89, 1.0]
    ],
    "dataPoints": [
      [365, 252, 252],
      [252, 252, 252],
      [252, 252, 252]
    ],
    "period": "1y",
    "computedAt": "2026-03-28T04:00:00Z"
  },
  "meta": {
    "request_id": "req_def456ghi789jklm",
    "timestamp": "2026-03-28T12:00:00Z"
  }
}

Interpreting correlation values

RangeInterpretation
0.8 to 1.0Strong positive correlation -- assets move together
0.5 to 0.8Moderate positive correlation
0.0 to 0.5Weak positive correlation
-0.5 to 0.0Weak negative correlation
-0.8 to -0.5Moderate negative correlation
-1.0 to -0.8Strong negative correlation -- assets move opposite

Was this page helpful?