Claude-skill-registry crypto-pair-fee-optimization

Analysis of crypto-to-crypto vs crypto-to-fiat (USD) trading on Alpaca for fee optimization and risk considerations

install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/crypto-pair-fee-optimization" ~/.claude/skills/majiayu000-claude-skill-registry-crypto-pair-fee-optimization && rm -rf "$T"
manifest: skills/data/crypto-pair-fee-optimization/SKILL.md
source content

Crypto Pair Fee Optimization - Research Notes

Experiment Overview

ItemDetails
Date2026-01-01
GoalDetermine if crypto-to-crypto trading is advantageous vs crypto-to-fiat given Alpaca fee schedule and risk factors
EnvironmentAlpaca Crypto LLC, Fee schedule as of Aug 2023
StatusSuccess

Context

When rebalancing crypto portfolios or rotating between assets, there are two approaches:

  1. Crypto-to-USD route: Sell asset A for USD, buy asset B with USD (2 trades)
  2. Crypto-to-crypto route: Trade asset A directly for asset B (1 trade)

The question: Does Alpaca's fee structure favor one approach over the other?

Key Finding: Fee Structure is Identical

Per

docs/rules_and_fees/AlpacaCryptoLLCFeeDisclosure.pdf
, Alpaca uses the same maker/taker fees regardless of pair type:

Tier30D Volume (USD)MakerTaker
1$0 - 100K0.15%0.25%
2$100K - 500K0.12%0.22%
3$500K - 1M0.10%0.20%
4$1M - 10M0.08%0.18%
5$10M - 25M0.05%0.15%
6$25M - 50M0.02%0.13%
7$50M - 100M0.02%0.12%
8$100M+0.00%0.10%

No per-trade fee advantage exists between pair types.

Verified Advantage: Trade Count Reduction

The only fee advantage comes from reducing the number of trades:

ScenarioCrypto-to-USD RouteCrypto-to-Crypto RouteSavings
Rotate ETH → BTCETH→USD + USD→BTC = 2×0.25% = 0.50%ETH→BTC = 0.25%50%
Rebalance 3 assetsUp to 6 tradesUp to 3 trades50%
# Fee calculation for portfolio rotation
def calculate_rotation_fees(num_assets: int, fee_rate: float = 0.0025) -> dict:
    """Compare fees for crypto rotation strategies."""
    # Via USD: sell all to USD, buy new positions
    usd_route_trades = num_assets * 2  # sell + buy for each
    usd_route_fee = usd_route_trades * fee_rate

    # Via crypto pairs: direct swaps where available
    crypto_route_trades = num_assets  # direct swaps
    crypto_route_fee = crypto_route_trades * fee_rate

    return {
        'usd_route_trades': usd_route_trades,
        'usd_route_fee_pct': usd_route_fee * 100,
        'crypto_route_trades': crypto_route_trades,
        'crypto_route_fee_pct': crypto_route_fee * 100,
        'savings_pct': (1 - crypto_route_fee / usd_route_fee) * 100
    }

When Crypto-to-Crypto is Advantageous

  1. Portfolio rebalancing - Rotating between crypto assets you intend to hold
  2. Stablecoin parking - Using USDC/USDT pairs to avoid USD conversion delays
  3. Tax strategy - Potentially avoiding USD realization events (jurisdiction-dependent, consult tax advisor)

When Crypto-to-USD is Better

  1. Profit realization - Converting to USD for withdrawal/spending
  2. Risk-off moves - USD doesn't fluctuate while waiting to re-enter
  3. Simpler accounting - USD basis is clearer for tax reporting
  4. Wider liquidity - USD pairs typically have tighter spreads

Failed Attempts (Critical)

AttemptWhy it FailedLesson Learned
Assuming crypto pairs have lower feesFee schedule is identical per tradeAdvantage is only in trade count reduction
Looking for spread differences in docsAlpaca doesn't publish spread dataWould need live testing to compare actual execution costs

Risk Considerations

# Risk factors for crypto-to-crypto pairs
double_volatility_exposure: true  # Both sides of trade can move
liquidity_variance: "USD pairs typically deeper"
spread_risk: "Exotic pairs may have wider spreads"
implementation_complexity: "Requires broker/backtest updates"

Available Alpaca Crypto Pairs

# Base currencies for crypto-to-crypto
BTC_pairs: [BCH, ETH, LTC, UNI]
USDT_pairs: [AAVE, BCH, BTC, DOGE, ETH, LINK, LTC, SUSHI, UNI, YFI]
USDC_pairs: [AAVE, AVAX, BAT, BCH, BTC, CRV, DOGE, DOT, ETH, GRT, LINK, LTC, SHIB, SKY, SUSHI, UNI, XTZ, YFI]
USD_pairs: "20+ assets including all USDC/USDT options plus XRP"

Implementation Notes

Current codebase trades crypto/USD only (e.g.,

BTC/USD
). To implement crypto-to-crypto:

  1. Update
    alpaca_trading/trading/broker.py
    to handle non-USD quote currencies
  2. Modify backtest infrastructure for multi-base accounting
  3. Add fee calculation that tracks the "credited side" denomination
  4. Consider liquidity/spread modeling for exotic pairs

Key Insights

  • Fee percentages are identical across all pair types on Alpaca
  • The only fee advantage is reducing trade count (50% savings on rotations)
  • Crypto-to-crypto exposes you to volatility on both sides of the trade
  • Stablecoin pairs (USDC/USDT) offer a middle ground: crypto liquidity with USD-like stability
  • Implementation requires non-trivial changes to broker and backtest systems

References