スキル一覧に戻る
smith6jt-cop

crypto-pair-fee-optimization

by smith6jt-cop

Using skills repo for AI memory management.

0🍴 0📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


name: crypto-pair-fee-optimization description: "Analysis of crypto-to-crypto vs crypto-to-fiat (USD) trading on Alpaca for fee optimization and risk considerations" author: Claude Code date: 2026-01-01

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

スコア

総合スコア

40/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です