← library app

7. Crypto

Algo-wide warnings.

  1. 24/7 market, no close. No daily settlement/session boundary — "daily" bars are exchange-defined (usually 00:00 UTC). Annualize with 365 days, not 252.
  2. Fragmented venues. Price/liquidity differ per exchange; a "BTC price" is venue-specific. Account for fees, funding, and withdrawal limits per venue.
  3. Perp funding is a real cash flow every few hours — ignoring it corrupts perp backtests.
  4. On-chain ≠ price data. On-chain metrics have their own latency, reorg risk, and definitional differences across providers.

Market Structure

Spot vs Perpetual vs Dated Futures

Def. Spot = own the asset; perpetual ("perp") = futures with no expiry, pegged via funding; dated future = expiring contract. Formula. Perps stay near spot through the funding mechanism (below). Signal. Perps dominate crypto volume & price discovery; basis between them encodes leverage/sentiment. Algo. Most crypto algo trading is on perps — you must model funding and liquidation, not just price.

Funding Rate

Def. Periodic payment between perp longs and shorts that tethers the perp to spot. Formula. , paid every 8h (varies). Positive → longs pay shorts. Signal. Persistently positive funding → crowded longs (leverage, often a top warning); negative → crowded shorts. Algo. Cash flow = each interval. Funding-arb (long spot / short perp) harvests positive funding market-neutrally. Annualize: .

Basis

Def. Gap between futures/perp and spot. Formula. , annualized for dated futures via time to expiry. Signal. High positive basis → bullish leverage demand; cash-and-carry yield opportunity. Algo. Carry trade = long spot + short dated future, locking the basis to expiry — a core "crypto yield" source.

Open Interest

Def. Total outstanding derivative contracts. Formula. Sum of open positions (notional or contract count). Signal. Rising OI + rising price → new money / trend conviction; rising OI + flat price → building leverage (squeeze risk). Algo. Combine OI changes with funding & price to infer positioning; spikes precede liquidation cascades.

Liquidations

Def. Forced closure of leveraged positions when margin is breached. Formula. Triggered at the liquidation price set by leverage & maintenance margin. Signal. Liquidation cascades cause violent wicks; clustered liq levels act as magnets. Algo. Model your own liquidation price; liquidation-feed data helps anticipate cascade zones. High leverage = tight liq distance.


On-Chain Metrics

Realized Cap & MVRV

Def. Realized cap values each coin at the price it last moved (cost basis); MVRV compares market to realized value. Formula. , . Signal. MVRV >3.5 historically → overheated/top zone; <1 → market below aggregate cost basis (capitulation/bottom). Algo. Slow macro/cycle signal, not a timing trigger; provider definitions vary (MVRV-Z normalizes it).

NVT Ratio

Def. "P/E for crypto": market cap vs on-chain transaction volume. Formula. , NVT Signal smooths the denominator. Signal. High NVT → price outpacing network usage (rich); low → usage supports valuation. Algo. Tx-volume measurement is noisy (change outputs, internal transfers) — use a vetted provider's adjusted volume.

SOPR (Spent Output Profit Ratio)

Def. Whether coins moving on-chain are realizing profit or loss. Formula. for spent outputs. Signal. >1 → holders realizing profit; crossing 1 from above = potential support break (loss-taking). Algo. Useful sentiment/cycle feature; aggregate vs short-term-holder variants differ.

Active Addresses / Network Activity

Def. Count of unique active addresses; a usage/adoption proxy. Signal. Diverging from price → unsustainable move; growth confirms network health. Algo. Address ≠ user (one entity can hold many) — treat as a relative trend, not an absolute count.

Exchange Net Flows

Def. Net coin movement onto/off exchanges. Signal. Inflows → potential selling pressure; outflows → accumulation/self-custody (bullish). Algo. Depends on accurate exchange-wallet labeling (provider-specific, imperfect).


Yield & Tokenomics

Staking Yield

Def. Reward for locking tokens to secure a proof-of-stake chain. Formula. , APY compounds it. Signal. Base "risk-free-ish" yield of a PoS chain; but denominated in a volatile asset. Algo. Real yield = staking yield − token inflation. Account for lock-up/unbonding periods (illiquidity risk) and slashing.

Token Inflation / Emission

Def. Rate of new token supply creation. Formula. (annualized). Signal. High emission → sell pressure / dilution; halvings (BTC) cut emission and historically precede cycles. Algo. Nominal staking yield can be < inflation → negative real yield. Always net it out.

Circulating vs Total vs Fully-Diluted Supply

Def. Circulating = liquid now; total = minted; FDV = price × max supply. Formula. , . Signal. Large FDV/MktCap gap → big future unlocks (overhang/dilution risk). Algo. Compare valuations on FDV, not just market cap, when supply schedules differ. Track unlock calendars.

DeFi Yield (APR/APY, TVL)

Def. Yield from lending/LP/farming; TVL = total value locked in a protocol. Formula. , LP yield includes fees + incentives − impermanent loss. Signal. Very high APY usually = high risk (token incentives, low TVL, exploit risk). Algo. Subtract impermanent loss for AMM LPs; yields are quoted optimistically — model net of IL, gas, and token-price decay.

Impermanent Loss

Def. LP underperformance vs holding, from price divergence of pooled assets. Formula. For a 50/50 constant-product pool, , . Signal. Grows with divergence; only "impermanent" if prices revert. Algo. Must net IL against fee income to judge real LP return; large for volatile/uncorrelated pairs.


Crypto-specific Risk

Stablecoin Peg

Def. Token designed to track $1 (fiat-backed like USDC/USDT, or algorithmic). Signal. Depeg (e.g. UST→0, USDC briefly to $0.88 in SVB) = systemic stress; funding/basis spike around depegs. Algo. Monitor peg deviation as a risk-off trigger; algorithmic stables carry reflexive collapse risk — treat differently from collateralized ones.

Volatility & Correlation Regime

Def. Crypto vol >> equities; correlations spike toward 1 in crashes. Signal. Diversification within crypto vanishes in stress (everything sells off together). Algo. Don't assume stable correlations; stress-test with crash-correlation = ~1. Use 365-day annualization for vol/Sharpe.

Counterparty / Custody Risk

Def. Exchange insolvency, withdrawal halts, smart-contract exploits. Signal. "Not your keys, not your coins"; CeFi blowups (FTX) and DeFi hacks are recurring. Algo. A backtest assumes you can always exit at the quoted price — in crypto that fails during venue failures. Discount for venue/protocol risk.