Exchange Integration
High-Level Overview
Firedrake integrates directly with the Binance and Bybit exchanges using their official APIs. This connection allows the platform to securely interact with your exchange account to read data and execute trades without ever taking custody of your funds.
Firedrake supports the following markets:
- Binance: Spot Market and Futures trading. It supports USDⓈ-Margined contracts that use USDT as margin.
- Bybit: Spot Market and Linear USDT Perpetual Futures.
How It Works
Using your API keys, Firedrake continuously monitors:
- Account balances.
- Trade history.
- Real-time market conditions based on your strategy settings.
When a strategy triggers or you initiate a position manually (via hooks or API requests), Firedrake automatically:
- Opens Orders: Places the initial entry order immediately.
- Manages Position: Instantly sets Take Profit, Stop Loss, and any safety/grid orders according to your configuration.
- Real-Time Tracking: Connects via WebSockets to the user data stream to monitor position changes and filled orders in real-time.
Important: The platform's architecture allows Firedrake to distinguish its own orders from those of other bots or manual trades. Firedrake manages exclusively its own positions, which technically allows distinguishing them from other systems on the same sub-account. However, we strongly recommend against using other algorithmic systems on the same sub-account to avoid potential logic conflicts.
Here is how Firedrake responds to external position changes:
Case 1: A third-party system buys more of a token for which Firedrake already has an open position.
- Firedrake will recalculate and repost Take-Profit and Stop-Loss orders according to the new position size.
- The safety order (DCA) grid will remain unchanged.
Case 2: A third-party system sells a token for which Firedrake has an open position.
- Partial Sale: If the position is not fully closed, Firedrake will adjust Take-Profit and Stop-Loss orders for the remaining size. The safety order grid will remain unchanged.
- Full Sale: If the position is fully closed, Firedrake will register the trade closure and automatically cancel all related pending orders.
Custody of Funds: Firedrake never has custody of your funds. All trades are executed directly on the exchange via API. Firedrake sends instructions, the exchange executes them, and your funds always remain in your exchange account.
What API Access Means
An API key acts as a limited remote control for your account. The permissions for this control are strictly defined by you when you create the key.
- API Key: A secure identifier that allows Firedrake servers to communicate with your exchange account.
- User-Defined Permissions: You decide exactly what Firedrake is allowed to do.
What Firedrake CANNOT Do
- ❌ Withdraw funds from your account.
- ❌ Change account credentials or passwords.
- ❌ Access other exchange services not explicitly permitted.
Required Permissions
For correct operation, you must create an API key with Read/Write permissions for:
- Orders
- Positions
- Access to Spot and/or Futures markets.
Security Best Practice: When creating these keys, you should restrict access so that they can only be used by Firedrake's specific IP addresses. This ensures that even if a key were compromised, it could not be used from any other machine.
What Firedrake Does NOT Monitor
Firedrake only monitors data required for executing and managing your configured strategies.
It does not:
- Monitor unrelated account activity
- Track manual trades outside its own orders
- Analyze or interpret your financial situation
Supported Exchanges
Firedrake currently integrates with Bybit and Binance.
Why these exchanges?
We selected these platforms for their reliability and maturity:
- Liquidity: They are the largest exchanges with massive liquidity, ensuring your orders fill quickly and at the expected price.
- API Stability: Both offer robust, stable APIs that support high-frequency trading operations.
- Regulation: High standards of regulatory compliance and security.
- Reliability: Proven track records for deposit and withdrawal stability.
We plan to integrate with additional exchanges in the near future. If you have a specific exchange you would like to see, please let us know via the contact form.
System Reliability & Failure Handling
We have designed Firedrake to be resilient. Here is what happens in various failure scenarios:
If Firedrake Servers Go Down
- New Trades: No new trades will be opened.
- Existing Trades: You should monitor open positions manually on the exchange until servers are back online.
- Notification: Our automated monitoring system will detect the outage and immediately notify you via email and Telegram.
- Recovery: Once servers restart, the system uses the API to "catch up" on missed data and resumes normal operation.
- Note: If a position closes while servers are down, safety orders or stop losses might not be automatically cleaned up. You will receive a notification to check this.
If Exchange API is Unavailable
- Notification: You will be notified via email and Telegram.
- Impact: New trades cannot be opened. Closing trades may leave residual orders (e.g., limits/stops) that require manual cancellation.
Exchange Limitations and System Stability
Firedrake utilizes an intelligent proxy and load balancing system.
- Pre-Check: Every API request is checked against current rate limits before sending.
- Load Balancing: If a server approaches its limit, the system automatically routes requests through a different server.
- Retry Logic: If a request fails, it is immediately retried through a different proxy path. This infrastructure significantly reduces the likelihood of API rate limit issues under normal operating conditions.
If an Order Fails Partially
The system continuously verifies that open orders match your configuration. If an order is placed incorrectly or partially fails, Firedrake detects the mismatch and automatically re-issues the order to align with your bot settings.
Security Model
Security is our top priority.
- IP Whitelisting: Your API keys are strictly limited to Firedrake's specific server IP addresses. No other machine can use them.
- Encryption: API keys are fully encrypted and are never stored in plain text.
- Isolation: The execution services that communicate with exchanges run on isolated servers with no access from the public internet.
Before You Connect an Exchange
Make sure that:
- You understand that trading involves risk
- You created a separate sub-account for Firedrake
- API keys do not have withdrawal permissions
- You start with small amounts when testing