Skip to content

PeggyJV/ymax-yield-analysis

Repository files navigation

Ymax Cross-Chain Yield Analysis

Backtesting cross-chain stablecoin yield strategies across protocols and chains that Ymax supports. All data sourced from DefiLlama's public yields API -- no API keys needed.

Quick Start

npm install
npm run backtest:all

Backtests

1. ymax-backtest.ts -- Ymax Instruments Only

Tests only the 12 USDC instruments Ymax currently supports:

  • Protocols: Aave V3, Compound V3, Morpho curator vaults
  • Chains: Ethereum, Arbitrum, Base, Optimism, Avalanche
  • Asset: USDC only
npm run backtest:ymax

Key finding: Cross-chain beats every single chain by +114bps before bridge costs. After conservative 5bps bridge costs, within -19bps of the best single chain (Base). The best chain rotated 7 times across 10 quarters -- Arbitrum (2024), Base (mid-2024), Ethereum (2025) via Morpho vaults.

2. usdc-4chain-backtest.ts -- Expanded USDC Protocols

Adds protocols beyond what Ymax currently supports to show the broader USDC yield landscape:

  • Protocols: Aave V3, Compound V3, Fluid, Dolomite, SparkLend, Euler V2, Silo V2, Moonwell, Benqi, DeltaPrime, Folks Finance
  • Chains: Ethereum, Arbitrum, Base, Avalanche
  • Asset: USDC only
npm run backtest:usdc-4chain

Key finding: Cross-chain beats best single chain by +66bps after costs. DeltaPrime on Avalanche provided 52% of best-yield days. Adding more protocols widens the cross-chain advantage.

3. cross-chain-backtest.ts -- Multi-Asset, Multi-Protocol

The full analysis including non-USDC stablecoins:

  • Protocols: Aave V3, Compound V3, Fluid, Euler V2, Dolomite, SparkLend, Sky, Ethena, Pendle, Moonwell, Spark
  • Chains: Ethereum, Base, Arbitrum, Avalanche, Plasma
  • Assets: USDC, USDT, sUSDe (Ethena), sUSDS (Sky), Pendle SY underlying yield
npm run backtest:multi-asset

Key finding: Three asset types each dominated different eras -- USDC (57%), sUSDe (25%), Pendle (18%). Multi-asset allocation matters as much as multi-chain.

Methodology

  • Period: January 1, 2024 - present (~27 months)
  • Data source: DefiLlama Yields API (free, no auth, daily granularity)
  • Initial capital: $100,000
  • Rebalancing: Weekly (every 7 days, evaluate cross-chain)
  • Bridge cost: 5 basis points per cross-chain move (conservative; CCTP is roughly free for USDC)
  • Compounding: Daily (value *= (1 + bestDailyApy / 365))

For each day, we identify the best available yield on each chain across all protocols with data, then simulate single-chain vs cross-chain strategies.

Output

Each backtest prints a formatted report to stdout and saves detailed JSON results to output/:

File Backtest
output/ymax-backtest.json Ymax instruments only
output/usdc-4chain-backtest.json Expanded USDC
output/backtest-results-v4.json Multi-asset

Older iterations are preserved in output/backtest-results-v[1-3].json.

Full Report

See cross-chain-yield-analysis.md for the complete analysis with investor framing.

Data Sources

All yield data from DefiLlama's public API:

GET https://yields.llama.fi/chart/{poolId}

Returns daily {timestamp, apy, tvlUsd}. Pool IDs are hardcoded in each script -- they're stable UUIDs tied to specific protocol/chain/asset combinations. No API key or authentication needed.

Requirements

  • Node.js 18+ (for native fetch)
  • npm

About

Cross-chain stablecoin yield analysis for Ymax (backtests, data, reports)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors