Funding Farming Time-Based Strategy — User Guide

Overview

The Funding Farming Time-Based Strategy allows you to automatically open and close trades around funding rate events. This strategy helps capture funding payments with minimal market exposure by trading at precise times relative to funding periods.

You can configure the system to:

  1. Open trades before a funding event (e.g., 60 minutes before)
  2. Close trades shortly after funding is awarded (e.g., 10 minutes after)
  3. Use UTC time zones for consistent operation across exchanges (00:00, 08:00, 16:00 UTC)

⚙️ Configuration

All configuration values are defined under the funding_farming_settings section in your YAML settings file.

funding_farming_settings:
  is_enabled: true
  max_open_trades: 5
  max_symbols_to_pick: 10
  funding_rate_threshold: 0.0003  # 0.03% minimum
  spot_order_size: 100.0
  future_order_size: 100.0
  liquidation_percent: 5.0

  # Time-based controls
  open_trade_before: 60    # Open trades 60 minutes before funding time
  close_trade_after: 10    # Close trades 10 minutes after funding is paid

🧭 Common Configuration Scenarios

Scenario Description Recommended Use
Precision Timing (Recommended) Opens 1 hour before, closes 10 minutes after Best for consistent funding capture
Quick Entry/Exit Opens 15 min before, closes 5 min after Suitable for active traders
Always Trading No time limits For continuous funding-based trading
Extended Window Opens 2 hours before, closes 30 minutes after For slower exchanges or high volatility

Example Settings

1. Precision Timing
open_trade_before: 60
close_trade_after: 10

Opens: 23:00, 07:00, 15:00 UTC
Closes: 00:10, 08:10, 16:10 UTC

2. Quick Entry/Exit
open_trade_before: 15
close_trade_after: 5

Opens: 23:45, 07:45, 15:45 UTC
Closes: 00:05, 08:05, 16:05 UTC

3. Always Trading
open_trade_before: 0
close_trade_after: 0

Opens anytime when funding rate meets threshold
No auto-close timing restriction

4. Extended Window
open_trade_before: 120
close_trade_after: 30

Opens: 22:00, 06:00, 14:00 UTC
Closes: 00:30, 08:30, 16:30 UTC


🔄 How It Works

1. Opening Positions

Funding times occur three times per day: 00:00, 08:00, and 16:00 UTC.
The system starts monitoring before each funding event and only opens trades within the time window defined by open_trade_before.

Example: For open_trade_before: 60, trades open between 23:00–00:00 UTC.

2. Closing Positions

After funding is awarded, the system holds positions for the duration defined by close_trade_after. It then automatically closes positions when the delay expires.

3. Check Intervals

Opening Window Check Frequency
0 minutesEvery 10 minutes
1–10 minutesEvery 2 minutes
11–30 minutesEvery 5 minutes
31+ minutesEvery 10 minutes

📋 Log Examples

✅ Opening window active: 45 minutes until funding at 16:00 UTC
🎯 Matched BTCUSDT (Funding: 0.0850%)
✅ Position opened for BTCUSDT at 15:15 UTC
⏳ Not in opening window. Next window opens in 85 minutes at 15:00 UTC.
📍 Monitoring active positions...
⚠️ Position BTCUSDT closing after funding (12 minutes passed)
✅ Position closed successfully.

🛡️ Risk Management

  1. Funding Rate Threshold – Trades only if rate meets the minimum
  2. Liquidation Protection – Closes trades approaching liquidation
  3. Spread Validation – Avoids wide bid-ask spreads
  4. Price Movement Checks – Warns on sudden volatility
  5. Max Trade Limit – Respects configured trade limits

⏱️ Close Priority Order

  1. ✅ Time-based closure (funding + delay)
  2. ⚠️ Funding rate drops below threshold
  3. 🚨 Approaching liquidation
  4. ⚡ Large market movement (warning only)

💡 Benefits

Advantages

  • Predictable trading schedule
  • Reduced market exposure
  • Guaranteed funding capture
  • Fully automated cycles
  • Multiple daily opportunities

Considerations

  • May miss trades in short windows
  • Possible funding update delays
  • Higher competition during funding
  • Potential slippage near funding time

✅ Best Practices

  • Start with wider time windows (60–120 minutes)
  • Monitor logs to confirm accurate timing
  • Add 10–15 min buffer on slow exchanges
  • Verify funding payments after each cycle
  • Use limit/post-only orders to reduce fees
  • Start small when testing strategy

🧩 Troubleshooting

Issue Possible Causes Suggested Fix
Positions not opening Outside window / low funding rate / max trades reached Check timing and thresholds
Positions not closing close_trade_after = 0 or funding not processed yet Adjust timing, review logs
Missed funding payment Opened too late or funding delay Open earlier or verify exchange schedule

🕓 Example Timeline

Settings:
open_trade_before: 60
close_trade_after: 10

Time (UTC)Event
22:30System idle, waiting for window
23:00Opening window starts
23:05BTCUSDT trade opened
00:00Funding payment processed
00:10Auto-close triggered
00:15Trade recorded, ready for next cycle

Next window begins at 07:00 UTC for the 08:00 UTC funding.


📊 Performance Tracking

MetricDescription
Funding EarnedTotal funding fees collected
Net P&LProfit after fees and slippage
Win RatePercentage of profitable cycles
Avg Holding TimeShould match configured window
Execution RateSuccessful trades per funding cycle

🚀 Advanced Configuration

Dynamic Timing (Planned Feature)

  • Adjusts based on funding rate magnitude
  • Adapts to market volatility
  • Uses historical slippage data
  • Accounts for exchange latency

Multi-Exchange Strategy

  • Run across multiple exchanges with different funding times
  • Capture more daily opportunities
  • Reduce risk through diversification

📎 Related Topics