DOCS
v0.1 HYPERLIQUID L1
// System Documentation · v0.1
Overview

Financial Singularity is an autonomous execution stack running on Hyperliquid perpetuals. It monitors 14 assets simultaneously, evaluates a multi-factor signal stack every 60 seconds, and opens and closes leveraged positions without human intervention.

There is no human in the loop between signal and execution. The system reads the market, makes a decision, and acts on it around the clock.

This documentation covers the complete system: infrastructure, exchange integration, strategy logic, indicator mechanics, position sizing, risk controls, execution cycle, fee structure, and the live dashboard.

Current Version
v0.1 — live on Hyperliquid perpetuals with real capital. 14 assets. 60-second execution cycle. Strategy validation in progress before scaling position sizes.
// System · Infrastructure
Infrastructure

The system runs on a dedicated virtual machine in Oracle Cloud's US East region (Ashburn, Virginia). It stays on continuously — not a scheduled job, not a serverless function. A persistent process.

Why Oracle Cloud

An earlier version of the infrastructure ran on Cloudflare Workers — a serverless environment that executes code only in response to incoming requests. Serverless is the wrong model for a trading bot. A bot needs to run a loop every 60 seconds indefinitely, maintain state between cycles, and hold open positions over time. Workers can't do that.

Oracle Cloud Free Tier provides a real, always-on virtual machine at no cost. That's the right model. The move to Oracle was the move from event-driven to persistent.

Stack
ComponentDetail
ServerOracle Cloud VM.Standard.E2.1.Micro · 1 OCPU · 1GB RAM
OSUbuntu 24.04 · Ashburn, VA
RuntimeNode.js
Process managerPM2 — keeps the bot alive across crashes and restarts
Reverse proxyNginx
Edge / SSLCloudflare
ExchangeHyperliquid L1 perpetuals
Request Path

The full path from a browser to the exchange API:

Browser → Cloudflare → Nginx → Node.js → Hyperliquid API
// System · Exchange
Exchange

The system trades exclusively on Hyperliquid — an on-chain perpetuals exchange built on its own L1 blockchain.

Why Hyperliquid
Speed

Order execution is sub-second. The system places market orders and expects fills immediately — latency between signal and fill is measured in milliseconds, not seconds.

On-Chain Settlement

Every trade settles on-chain. Positions, fills, and account state are publicly verifiable. There is no counterparty risk from an opaque centralized exchange holding funds.

API Quality

Hyperliquid exposes a clean REST API for market data, account state, order placement, and portfolio analytics. The system uses this API for everything: fetching candle data, reading current prices, placing and closing orders, retrieving account value, and pulling portfolio PnL.

Write Quota System

Hyperliquid rate-limits API write requests relative to trading volume — approximately 3.2 write requests per dollar of taker volume traded. Write quota scales with activity. The system is designed to use writes efficiently: leverage is initialized once at first boot and persisted, not re-set on every restart.

// System · Assets
Assets

14 perpetual markets monitored and traded simultaneously.

BTC  ETH  SOL  DOGE  LTC  LINK  INJ  OP  ADA  HYPE  WIF  JUP  ATOM  UNI
Selection Criteria

Assets were selected for a combination of liquidity, volatility profile, and signal behavior.

GroupAssetsRationale
Large-capBTC, ETH, SOLDeep order books, predictable slippage, strong trend behavior
Mid-capINJ, LINK, OP, ATOM, UNICleaner trend behavior where the signal stack performs well
High volatilityHYPE, WIF, JUP, DOGE, LTCLarge moves with clear momentum signals — higher noise but higher potential
Independence Assumption

All 14 assets run the same strategy with the same parameters. There is no asset-specific tuning in the current version. Each asset is evaluated independently — correlation between assets is not factored into position management at this stage.

// System · Leverage
Leverage

All positions use Hyperliquid's default leverage per asset.

Leverage is set once at system initialization and stored so it does not need to be re-applied on subsequent restarts. This is intentional — each leverage change consumes write quota. Initializing once and persisting the result avoids burning quota on every bot restart.

// System · Position Sizing
Position Sizing

Position size is calculated as a fraction of current account value, subject to a hard nominal ceiling.

baseSizeUsd = min(accountValue × 0.33, $30)

No single trade risks more than one third of the account, and no trade exceeds $30 nominal regardless of account size.

Signal Strength Multiplier

The base size is then adjusted by a signal strength multiplier derived from the indicators at the time of entry. A strong, high-conviction signal results in a position closer to the base size. A weaker but valid signal results in a smaller allocation.

Position size and signal confidence are coupled — the system bets more when it is more certain.

Why $30

The $30 ceiling reflects the current stage of the system. This is a live test with real capital. The ceiling exists to limit downside while the strategy is being validated in production conditions. The goal is to prove edge before scaling size.

// Strategy · Signal Stack
RSI

Relative Strength Index (14-period). The primary directional trigger. Not sufficient to enter a trade on its own.

How It Works

RSI measures momentum by comparing the magnitude of recent gains to recent losses over a 14-period window and normalizing the result to a 0–100 scale. High RSI values indicate that recent price action has been dominated by gains. Low values indicate the opposite.

How It's Used

The system uses RSI as the primary directional trigger. A long signal requires RSI in an upward-momentum zone. A short signal requires RSI in a downward-momentum zone. The specific thresholds can vary based on the operating mode determined by ADX.

Why It Needs Context

RSI is a momentum indicator, not a trend indicator. It tells you whether recent price action has had directional bias — not whether the current trend will continue. A market can be overbought and continue higher for hours in a strong trend, or reverse immediately in a ranging market.

RSI alone is insufficient. It needs ADX to confirm the market is actually trending before the signal is trusted.

// Strategy · Signal Stack
ADX

Average Directional Index (14-period). Measures trend strength, not direction. Used as both an entry filter and a regime classifier.

How It Works

ADX measures only the strength of the trend — a strong downtrend and a strong uptrend both produce high ADX readings. The directional information lives in the +DI and -DI components, but the system primarily uses the ADX value itself.

Trend Threshold

ADX > 20 = trending market. ADX < 20 = ranging, chopping, or consolidating. The system does not enter positions in non-trending markets. RSI signals in a range-bound environment have a much higher false positive rate.

Regime Classification

ADX also determines the operating regime for each evaluation cycle:

  • High ADX (strong trend): wider ATR-based stops, larger take profit targets, higher signal thresholds required for entry
  • Low-to-moderate ADX (weak trend): tighter stops, smaller targets, more conservative sizing multiplier

The system automatically adjusts its aggression to match the strength of the current trend.

// Strategy · Signal Stack
EMA

Exponential Moving Average — fast period and slow period. Defines current trend direction and provides the directional context that RSI and ADX don't.

How It Works

Two EMAs are evaluated: a fast-period and a slow-period. Their relationship defines trend direction:

  • Fast EMA above slow EMA → uptrend
  • Fast EMA below slow EMA → downtrend
How It's Used

A long signal in a confirmed uptrend is treated as higher probability than a long signal in a downtrend. When EMA alignment and RSI momentum agree, the signal is stronger. When they conflict, the signal is weakened or filtered.

Lag by Design

EMA is a lagging indicator — it smooths price action and reacts to changes after they've already begun. This means EMA-based trend detection misses the very beginning of a move but avoids reacting to noise. Combined with RSI's faster momentum readings, the system gets both early detection and trend confirmation before committing to a trade.

// Strategy · Signal Stack
Signal Modes

The combination of RSI, ADX, and EMA produces a classification of the current market environment into one of several modes. The mode determines which parameter set is applied to the trade.

Trending markets with strong ADX and aligned EMA use one set of parameters — wider stops, larger targets, higher conviction requirement. Weaker signals use more conservative parameters — tighter stops, smaller targets, reduced size multiplier.

The mode is determined fresh at every evaluation cycle and is recorded at entry. It's included in the trade log alongside RSI, ADX, ATR, and EMA readings so every decision can be reviewed after the fact.

// Strategy · Signal Stack
Entry Logic

A signal requires all three indicators to agree. No single indicator can trigger an entry on its own.

Long Signal

Fires when all three conditions are met:

  1. RSI indicates upward momentum — above the long threshold for the current mode
  2. ADX is above 20, confirming a trending environment
  3. EMA trend is bullish, or signal strength is high enough to enter against the EMA
Short Signal

Fires on the inverse of all three conditions.

Flat

If any condition is not met, the signal is flat and no trade is opened. The system never enters out of inertia — if the signal is flat, nothing happens for that asset that cycle.

No Direct Flips

The system does not flip directly from long to short. If a long position is open and a short signal fires, the short signal is noted but the long position is held until its stop loss or take profit is hit. A new position in the opposite direction is only opened after the current one closes. This prevents the system from being whipsawed by rapid signal changes in volatile conditions.

// Strategy · Signal Stack
Candle Data

5-minute candles with a 24-hour lookback window. 288 data points per evaluation.

24 hours of 5-minute candles is enough for all three indicators to stabilize and produce reliable readings, without being so long that the signal is dominated by stale price action.

Backtest Limit
Hyperliquid stores approximately 17.5 days of 5-minute candle history. This is the hard ceiling for any backtesting at this interval.
// Strategy · Risk
Stop Loss & Take Profit

Every position is opened with both a stop loss and a take profit pre-calculated. These levels are set at entry and never moved.

There is no trailing stop, no manual adjustment, no discretionary exit. The position closes when one of the two levels is touched.

ATR-Based Calculation

Both levels are derived from ATR — Average True Range — which measures the average size of price movements over a recent window. Using ATR to set distances means the system automatically gives trades more room in volatile markets and tighter parameters in calm ones.

stopLoss   = entryPrice ± (ATR × slMultiplier)
takeProfit = entryPrice ± (ATR × tpMultiplier)

The slMultiplier and tpMultiplier values depend on the mode determined at entry by ADX strength. Stronger trends use wider multipliers; weaker trends use tighter ones.

Reward-to-Risk

The TP multiplier is always larger than the SL multiplier. The reward-to-risk ratio on every trade is greater than 1:1. The system does not need to win more than half its trades to be profitable — it needs its average winner to be larger than its average loser. The TP/SL ratio is calibrated to maintain positive expected value after fees at realistic win rates.

// Risk Controls · Per-Trade
Per-Trade Limits

The first layer of risk management. Applied before any order is placed.

  • Position size capped at 33% of current account value
  • Hard nominal ceiling of $30 per trade regardless of account size
  • Stop loss calculated and stored before the order is sent — there is no trade without a stop
// Risk Controls · Daily Loss Cap
Daily Loss Cap

If cumulative realized PnL for the current calendar day falls below -5% of account value, the system stops opening new positions for the rest of that day.

The cap resets at midnight UTC. Existing open positions are not affected — they continue to be managed against their stop and take profit levels. Only new entries are blocked.

Why This Exists

Bad trading days tend to cluster. A system that has lost 5% in a single day is either in a hostile market environment or experiencing unusual conditions — either way, continuing to open new positions makes things worse. The daily cap limits damage without requiring a full shutdown.

// Risk Controls · Minimum Account Value
Minimum Account Value

If total account value falls below $25, all trading halts entirely.

Below this threshold, position sizes become so small that taker fees represent a disproportionate share of any potential gain. The system will not trade itself into a fee-dominated spiral where every trade costs more in fees than it could realistically return.

// Operations · Fees
Fees

Hyperliquid charges 0.0432% per trade as a taker fee. This applies to both sides of every round-trip — entry and exit.

On a $30 nominal position, the taker fee is approximately $0.013 per side, or $0.026 round-trip. Across 14 assets cycling through entries and exits multiple times per day, fees accumulate into a measurable drag on performance.

The strategy's TP/SL ratio and win rate targets are set with this cost structure in mind — a trade needs to win by enough to clear fees and still generate net positive PnL.

Fee Tier Scaling

Fee tier on Hyperliquid scales with 14-day rolling volume. At low account sizes and trade frequencies, the system operates at the base taker rate. As volume grows, fee tiers improve. Fee drag is highest in the early stages and decreases as the system scales.

// Operations · Execution
Execution Cycle

The bot loop runs every 60 seconds. Each cycle is a complete evaluation of all 14 assets. Full cycle completes in under 5 seconds end-to-end.

Step 1 — Fetch Market Data

Current mid prices for all 14 assets are fetched from Hyperliquid's price feed in a single request.

Step 2 — Risk Checks

Account value is checked against the $25 minimum. Daily PnL is checked against the -5% cap. If either limit is breached, the cycle logs the condition and exits without taking any new actions.

Step 3 — Asset Evaluation (Parallel)

All 14 assets are evaluated simultaneously:

  • If a position is open: compare current price against stored stop loss and take profit. If either is breached, close via market order, calculate realized PnL, update daily tracker, log the trade.
  • If flat: fetch 24h of 5m candles, run RSI/ADX/EMA, determine signal. If valid signal and risk allows, place market order, calculate stop/TP levels, store position.
Step 4 — Persist State

All updated state — positions, trade log, daily PnL, per-asset indicator logs — is written to disk. The metric history (rolling 24h of every cycle's readings) is also updated.

// Operations · API
API

A single HTTP endpoint aggregates everything needed to render the dashboard. Called every second by the dashboard client.

Each call fetches live data from Hyperliquid (account value, portfolio PnL, current prices) and combines it with the most recent state from disk (positions, indicator logs, trade history).

Response Data
  • Current open positions for all 14 assets
  • Latest indicator readings per asset — RSI, ADX, ATR, EMA trend, mode
  • Trade log — last 1000 closed trades
  • Live mid prices for all monitored assets
  • Today's realized PnL
  • All-time realized PnL — fetched live from Hyperliquid's portfolio API
  • Current account value — from Hyperliquid's clearinghouse API
  • Whether daily risk cap is currently active
// Operations · Dashboard
Dashboard

Live at marc.financialsingularity.com. Polls the API every second. Real-time read-only view of system state.

Account Panel

Current account value and all-time PnL, both sourced directly from Hyperliquid on every poll. The numbers on the dashboard match the numbers on Hyperliquid exactly.

Position Grid

All 14 assets with their current state — flat, long, or short. For open positions: entry price, stop loss, and take profit target. For all assets: latest RSI, ADX, ATR, EMA trend direction, and operating mode from the most recent evaluation cycle.

Trade History

Last 30 closed trades in reverse chronological order — asset, direction, entry price, exit price, realized PnL, and whether the trade closed on a stop loss or take profit. Header shows all-time cumulative PnL.

Session Indicator

Displays which global trading session is currently active: US open, Europe open, Asia open, after-hours, overnight, or weekend. The system trades all sessions equally, 24/7.

On this page