Hosted agents are deployed only through web-auth after billing entitlement and wallet binding:
https://auth.nunchi.trade
The hosted-agent provisioner creates the Nunchi-owned runtime, injects secrets, and starts the runner. Users should not deploy this repository directly.
hl apex run --preset default --budget 1000 --data-dir data/apexSend SIGTERM — the runner will:
- Stop accepting new positions
- Leave exchange-level stop-losses in place (safety net)
- Persist state to
data/apex/state.json - Exit cleanly
Never use kill -9 — this skips state persistence and can leave orphaned positions.
hl apex status
hl apex reconcileCause: 5+ consecutive API failures (HL API down or network issue). Impact: Engine enters safe mode — no new entries, only guard exits. Action: Check HL API status. If HL is up, check network connectivity from the hosted-agent runtime. The circuit breaker resets automatically on the next successful API call.
Cause: Tick execution exceeded 30s three times in a row.
Impact: Engine enters safe mode.
Action: Check if HL API is slow (high latency). Reduce the number of instruments scanned by Pulse. Check /metrics for tick_latency_ms trends.
Cause: Too many API calls to HL within their rate window.
Impact: Automatic exponential backoff (2s → 4s → 8s).
Action: Usually self-resolving. If persistent across many ticks, reduce radar_interval_ticks or pulse scan frequency.
Cause: A tick took more than 80% of the configured interval.
Impact: Ticks may start overlapping.
Action: Check which phase of the tick is slow (Pulse candle fetching is often the bottleneck). Consider increasing tick_interval.
When the engine enters safe mode:
- No new entries are taken
- Existing guards continue to function (exits still work)
- Check
/metricsorhl apex statusto confirm safe mode
To recover:
- Diagnose the root cause (API issues, timeouts)
- If the issue is resolved, restart the runner — safe mode resets on restart
- Alternatively, use the API:
POST /api/configurewith{"params": {"safe_mode": false}}
hl apex reconcile # Check for discrepancies
hl apex reconcile --fix # Auto-fix orphaned positions/slotsWhen to run: After crashes, network outages, or any unclean shutdown.
# Close a specific slot
hl apex close <slot_id>
# Close all positions (nuclear option)
hl apex close --allIf the CLI is unavailable, use the Hyperliquid web UI directly.
Use the hosted-agent operator logs for the provisioned service.
CRITICAL— circuit breaker, tick timeouts, unexpected errorsGuard close— trailing stop triggeredRate limited— API throttlingReconciliation— state vs exchange mismatches
| Variable | Default | Purpose |
|---|---|---|
RUN_MODE |
apex |
apex, strategy, mcp |
APEX_PRESET |
default |
conservative, default, aggressive |
APEX_BUDGET |
auto | Total trading capital |
APEX_SLOTS |
3 |
Max concurrent positions |
HL_TESTNET |
true |
false for mainnet |
API_AUTH_TOKEN |
unset | Bearer token for control endpoints |
DATA_DIR |
/data |
Persistent state directory |
TICK_INTERVAL |
varies | Seconds between ticks |
- User has active hosted-agent entitlement in web-auth
- Agent wallet is bound on the wallet binding page
- Hosted deploy is requested from web-auth, not from this repository
- Provisioner
/healthreportsrailwayConfigured: true - Provisioner
/healthreportscallbackConfigured: true - Hosted endpoint
/healthresponds with 200 - Hosted endpoint
/mcp/tradingresponds - Web-auth hosted-agent status refresh shows the provisioned endpoint
- Monitor
/metricsendpoint for tick latency and error counts