Skip to main content

Market liquidity proxies

Project description

Market Liquidity Proxies

This repository provides an overview of key market liquidity proxies and additional alternatives for crypto, bond, and stock markets. These proxies serve as indicators of market sentiment, risk appetite, and liquidity conditions.


Proxies Overview

Crypto Proxies

  1. Ethereum / Bitcoin (ETH / BTC): Reflects liquidity preference and risk sentiment within the cryptocurrency market. Barring idiosyncratic events it acts as a proxy for broader market liquidity.

Stock Market ETF Ratios

  1. QQQ / SPY Ratio: Reflects liquidity preference and risk sentiment within the US stock market. Shows the performance of high-beta QQQ (Nasdaq-100) vs. SPY (S&P 500).

Bond Market ETF Yield Spreads

Reflect funding stress in the broader market. When liquidity is ample, spreads tend to be tight, and they widen when liquidity is drained and stress builds in the system.

  1. HYG / LQD Spread: Measures the risk premium between high-yield (HYG) and investment-grade bonds (LQD).

  2. LQD / TNX Spread: Measures the risk premium between investment-grade bonds (LQD) and 10-year Treasury yields (UST-10Y).

Installation

Install package from PyPi: In order to install package use package manager of your choice, the most standard command is:

pip install liquidity

Retrieve API Key: Go to the Alphavantage.co website and retrieve free api-key. Set the api-key as an environment variable.

export ALPHAVANTAGE_API_KEY="<your-api-key>"

Usage

Here is example usage using python code, to display matrix chart with liquidity proxies:

from liquidity.models import YieldSpread, PriceRatio
from liquidity.visuals import ChartMatrix, Chart


liquidity_proxies = ChartMatrix(years=5)

# Define the data sources and charts
charts = [
    Chart(
        data=YieldSpread("HYG", "LQD").df,
        title="HYG - LQD Yield Spread",
        main_series="Spread",
        yaxis_name="Yield spread",
    ),
    Chart(
        data=YieldSpread("LQD", "UST-10Y").df,
        title="LQD - UST10Y Yield Spread",
        main_series="Spread",
        yaxis_name="Yield spread",
    ),
    Chart(
        data=PriceRatio("QQQ", "SPY").df,
        title="QQQ/SPY Price Ratio",
        main_series="Ratio",
        yaxis_name="Price ratio",
    ),
    Chart(
        data=PriceRatio("ETH", "BTC").df,
        title="ETH/BTC Price Ratio",
        main_series="Ratio",
        yaxis_name="Price ratio",
    ),
]

# Display the matrix grid of charts
liquidity_proxies.display_matrix(charts)

This will display example chart: Liquidity proxies

Data Sources

This repository is based on market data APIs providing free access to data.

Future Improvements

In the future I plan to add even more data providers and liquidity proxies.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

liquidity-0.2.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

liquidity-0.2.1-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file liquidity-0.2.1.tar.gz.

File metadata

  • Download URL: liquidity-0.2.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.11.9 Windows/10

File hashes

Hashes for liquidity-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b1dae2b9fc72acebe8523bdf8fd84648d2ff79234525555a736ee9bf657893ea
MD5 18cb0895c884317bd713a708fc39b667
BLAKE2b-256 a467d1b102890b31de1d85f4e89ba485ea9af7bc929e4931ee933291e1446315

See more details on using hashes here.

File details

Details for the file liquidity-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: liquidity-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.11.9 Windows/10

File hashes

Hashes for liquidity-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d89bbbd11531863f835e88a96a314c8422c34818345c74a024225bad153594e
MD5 aea2fc144fdc772ee2a78629a6cb4f44
BLAKE2b-256 485c210aba8d878192e989ad83f559239b534071749bc1be5fcd4165285a45da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page