Skip to main content

Strategy Engine

The HyperETH Strategy Engine allows traders to submit high-level trading logic that executes server-side, in close proximity to exchanges.

Why Use the Strategy Engine?

Trading is extremely latency-sensitive—millisecond differences can mean the difference between capturing an arbitrage opportunity or missing it entirely. Core Advantages:
  • Low Latency: Strategies execute server-side, eliminating network round-trip delays between your client and the exchanges
  • Atomic Execution: The server guarantees atomicity and consistency of multi-leg strategy execution
  • High Expressiveness: Supports complex trigger conditions, dependencies, and execution logic

How It Works

+----------+                      +----------------------------------+
|          |   Submit Strategy    |         HyperETH Server          |
|  Client  | -------------------> |  +----------------------------+  |
|          |                      |  |     Strategy Engine        |  |
|          | <-- Strategy ID ---- |  |                            |  |
|          |                      |  |  +-------+    +-------+    |  |
|          | <-- Status Updates - |  |  | Maker |--->| Taker |    |  |
|          |                      |  |  |  Leg  |    |  Leg  |    |  |
+----------+                      |  |  +---+---+    +---+---+    |  |
                                  |  |      |            |        |  |
                                  |  +------|------------|--------+  |
                                  |         |            |           |
                                  |         v            v           |
                                  |    +----------+ +----------+     |
                                  |    |Exchange A| |Exchange B|     |
                                  |    +----------+ +----------+     |
                                  +----------------------------------+
  1. Submit: Client submits a strategy with trading parameters
  2. Execute: Server executes the strategy legs according to triggers and conditions
  3. Monitor: Client can query status at any time
  4. Complete: Strategy completes (or fails) and client is notified

Product Roadmap

Phase 1 (Current): Preset Strategies

Provides simplified APIs for common trading patterns:
  • Maker-Taker Arbitrage: Place a maker order on one exchange, trigger a taker order on another when conditions are met

Phase 2 (Future): Custom Strategies

Opens up advanced engine capabilities, allowing users to define custom StrategyConfig for flexible, customized trading strategies with:
  • Multiple legs with complex dependencies
  • Custom trigger conditions
  • Advanced risk controls

Core Concepts

Strategy

A strategy is a complete trading plan consisting of one or more legs with defined execution rules.

Leg

A leg represents a single order or set of orders. Each leg has:
  • Order Parameters: Symbol, side, price, amount, etc.
  • Triggers: Conditions that must be met before the leg executes
  • Distribution: Which exchange and account to use

Trigger

Triggers define when a leg should execute:
Trigger TypeDescription
immediateExecute immediately
order_statusWait for another leg’s order to reach a status (e.g., “placed”)
price_spreadWait for price spread between exchanges to meet threshold
order_book_depthWait for sufficient order book depth

Dependencies

Dependencies define the execution order between legs:
  • Sequential: Leg B waits for Leg A to complete before starting

Available Strategies

API Endpoints

All strategy endpoints use the Cross-DEX Aggregation server: Base URL: https://api.hypereth.io/v2/all
EndpointMethodDescription
/strategy/submit/maker-taker-arbitragePOSTSubmit a maker-taker arbitrage strategy
/strategy/status/maker-taker-arbitrage/{strategyId}GETGet strategy execution status
/strategy/balancesGETQuery account balances for strategy planning

Authentication

All strategy endpoints require API key authentication via the X-API-KEY header.
curl -X POST https://api.hypereth.io/v2/all/strategy/submit/maker-taker-arbitrage \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your-api-key" \
  -d '{ ... }'