Trading Strategy Guide

Understanding how the Wealth bot generates profits through funding rate arbitrage


Overview

The Wealth bot implements a funding rate arbitrage strategy that profits from differences in funding rates across cryptocurrency exchanges while maintaining delta-neutral positions (no exposure to price movements).

What Are Funding Rates?

Funding rates are periodic payments exchanged between traders holding long and short positions in perpetual futures contracts. They keep the perpetual futures price aligned with the spot price.

  • Positive funding rate: Longs pay shorts
  • Negative funding rate: Shorts pay longs
  • Payment frequency: Every 8 hours (3 times daily) on most exchanges

How the Strategy Works

The Arbitrage Opportunity

Different exchanges often have different funding rates for the same asset. The bot exploits this by:

  1. Opening a LONG position on the exchange with the lower (or negative) funding rate
  2. Opening a SHORT position on the exchange with the higher funding rate
  3. Collecting the spread between the two rates every funding period

Delta-Neutral = Market-Neutral

Because you hold equal and opposite positions:

  • If BTC price goes up: Your long profits, your short loses → net zero
  • If BTC price goes down: Your long loses, your short profits → net zero
  • Your only P&L comes from the funding rate difference

Visual Example

Exchange A (Binance):    Funding Rate = +0.01%  → You go LONG  (receive 0.01%)
Exchange B (HyperLiquid): Funding Rate = +0.05% → You go SHORT (pay 0.05%)

Your position:
┌─────────────────────────────────────────────────────────────┐
│  LONG 0.1 BTC on Binance    ←→    SHORT 0.1 BTC on HyperLiquid  │
│  (Receive funding)                (Pay funding)                 │
└─────────────────────────────────────────────────────────────┘

Net result per 8-hour period:
  Receive: +0.01% on Binance
  Pay:     -0.05% on HyperLiquid
  ────────────────────────────
  Wait... that's negative!

Actually, you want the OPPOSITE - go SHORT where rates are HIGH:
  Pay:     -0.01% on Binance (you're long, you pay positive funding)
  Receive: +0.05% on HyperLiquid (you're short, you receive positive funding)
  ────────────────────────────
  Net: +0.04% profit per 8 hours

Profit Calculation Example

Position size: $10,000 per side
Funding spread: 0.04% (4 basis points)
Leverage: 10x

Per funding period (every 8 hours):
  Profit = $10,000 × 0.0004 = $4.00

Daily (3 funding periods):
  Profit = $4.00 × 3 = $12.00

Monthly:
  Profit = $12.00 × 30 = $360.00

Annualized APY:
  APY = 0.04% × 3 × 365 = 43.8%

When Does the Bot Open Positions?

The bot continuously monitors funding rates and opens positions when:

  1. Spread exceeds threshold: The funding rate difference meets your configured minimum (default: 0.04%)
  2. Sufficient balance: You have enough collateral on both exchanges
  3. Position limits not reached: You haven't hit your maximum concurrent positions
  4. Positive expected value: After accounting for fees and slippage, the trade is profitable

When Does the Bot Close Positions?

Positions are closed automatically when:

  1. Target profit reached: Default 5% profit on position
  2. Spread reverses: The funding rate advantage disappears or reverses
  3. Trailing stop triggered: Profit retraces too much from peak (protects gains)
  4. Manual shutdown: You stop the bot gracefully

Risk Management Features

Delta-Neutral Protection

  • Equal position sizes on both exchanges
  • No exposure to price movements
  • Profit comes only from funding rate spread

Slippage Protection

  • Uses limit orders with timeout
  • Falls back to market orders if needed
  • Configurable maximum slippage tolerance

Trailing Stop Loss

  • Activates after reaching profit threshold (default: 3%)
  • Locks in minimum profit (default: 2%)
  • Closes if profit retraces too much from peak

Atomic Execution

  • Opens both legs simultaneously
  • If one leg fails, the other is rolled back
  • Prevents unhedged (risky) positions

Position Size Limits

  • Maximum position size cap (USD)
  • Maximum percentage of balance per trade
  • Maximum concurrent positions

Configuring the Strategy

Key parameters in config.toml:

[trading]
# Minimum spread to open a position (0.04% = 4 basis points)
min_funding_spread = 0.0004

# Position sizing
position_size_percent = 0.30    # Use 30% of available balance
max_position_usd = 10000        # Cap at $10,000 per position
max_concurrent_positions = 5    # Maximum open positions

# Profit targets
target_profit_percent = 0.05    # Close at 5% profit

[risk]
# Trailing stop configuration
trailing_stops_enabled = true
trailing_stop_activation = 0.03  # Activate at 3% profit
trailing_stop_distance = 0.40    # Allow 40% retracement
trailing_stop_min_lock = 0.02    # Lock in minimum 2%

# Slippage protection
max_slippage_bps = 50           # Maximum 0.5% slippage

Understanding Expected Value (EV)

Before opening a position, the bot calculates the expected value - whether the trade will be profitable after costs:

Expected Value = (Funding Spread × Time Weight) - (Entry Fees + Exit Fees + Slippage)
  • Funding Spread: The rate difference between exchanges
  • Time Weight: Reduced value if close to next funding payment
  • Fees: Trading fees on both exchanges (entry and exit)
  • Slippage: Expected price impact

The bot only opens positions with positive expected value.

Supported Exchanges

ExchangeTypeFunding IntervalMax Leverage
Binance FuturesPerpetual8 hours125x
Bybit PerpetualsPerpetual8 hours100x
HyperLiquidPerpetual8 hours50x

Frequently Asked Questions

What happens if one exchange goes down?

The bot monitors connectivity and will:

  • Alert you to connection issues
  • Prevent new positions from opening
  • Existing positions remain open (both legs on different exchanges)

Can I lose money?

While the strategy is market-neutral, risks include:

  • Fee costs: If spread narrows before covering fees
  • Liquidation: If leverage is too high and price moves sharply
  • Exchange risk: Counterparty risk on centralized exchanges
  • Execution risk: Slippage during entry/exit

How much capital do I need?

Minimum recommended: $1,000 per exchange ($2,000 total)

With leverage, you can control larger positions:

  • $1,000 at 10x = $10,000 position size
  • Required margin = Position / Leverage + Safety Buffer

What's a good minimum spread to trade?

  • Conservative: 0.05% (5 basis points) - fewer trades, higher quality
  • Moderate: 0.04% (4 basis points) - balanced approach
  • Aggressive: 0.03% (3 basis points) - more trades, lower margins

How often are there opportunities?

This varies by market conditions:

  • High volatility: More funding rate divergence = more opportunities
  • Low volatility: Rates converge = fewer opportunities
  • Typical: 2-5 high-quality opportunities per day

See Also