On every run
Each time your agent runs, the AI reads your brief, the deployer’s limits, its own account (cash, open positions with entry, stop-loss and profit) and a market snapshot for each market it may trade. The snapshot has the live price, funding and open interest from Hyperliquid, plus the features below, computed from candles and history AgentHub collects for you.
Write rules with these names in brackets, like trend1d = up or change24hPct ≥ 3. The AI checks each rule against the number and only trades when every condition holds. “Test the brief” shows the same numbers a live run would see.
Missing means not met
Price moves
| Name | What it means | Reads as | Example rule |
|---|---|---|---|
Change over 1 hourchange1hPct | How far the price has moved over the last 1 hour. | % | Price is up at least 3% over 1 hour (change1hPct ≥ 3) |
Change over 4 hourschange4hPct | How far the price has moved over the last 4 hours. | % | Price is up at least 3% over 4 hours (change4hPct ≥ 3) |
Change over 24 hourschange24hPct | How far the price has moved over the last 24 hours. | % | Price is up at least 3% over 24 hours (change24hPct ≥ 3) |
Change over 7 dayschange7dPct | How far the price has moved over the last 7 days. | % | Price is up at least 3% over 7 days (change7dPct ≥ 3) |
Change over 30 dayschange30dPct | How far the price has moved over the last 30 days. | % | Price is up at least 3% over 30 days (change30dPct ≥ 3) |
Trend
| Name | What it means | Reads as | Example rule |
|---|---|---|---|
4-hour trendtrend4h | Up when the 20-candle average is above the 50 and price is above the 50 (4-hour candles); down for the opposite; otherwise flat. | up / down / flat | Only go long when trend4h is up |
Daily trendtrend1d | The same test on daily candles: the bigger picture. | up / down / flat | Stay flat when trend1d is down |
Price vs 50-day averagepriceVsSma50_1dPct | How far price is above (+) or below (−) its 50-day average. | % | Buy pullbacks within 2% of the 50-day average (priceVsSma50_1dPct between 0 and 2) |
Price vs 200-day averagepriceVsSma200_1dPct | How far price is above or below its 200-day average: the long-term regime. | % | Only trade longs while price is above the 200-day average |
Range
| Name | What it means | Reads as | Example rule |
|---|---|---|---|
20-day highhigh20d | The highest price of the last 20 full days. | USD | Go long on a break above the 20-day high (newHigh20d is true) |
20-day lowlow20d | The lowest price of the last 20 full days. | USD | Exit longs if price breaks the 20-day low |
Distance from 20-day highdistFromHigh20dPct | How far price is from the 20-day high (negative = below it). | % | Within 1% of the 20-day high |
Distance from 20-day lowdistFromLow20dPct | How far price is from the 20-day low (positive = above it). | % | Buy within 3% of the 20-day low |
New 20-day highnewHigh20d | True when price is above the 20-day high right now. | true / false | Breakout entry when newHigh20d is true |
New 20-day lownewLow20d | True when price is below the 20-day low right now. | true / false | Never buy on a new 20-day low |
Volatility
| Name | What it means | Reads as | Example rule |
|---|---|---|---|
Typical daily range (ATR)atr14_1dPct | The average daily range over 14 days, as % of price. Good for stop distances. | % | Stop-loss 1.5 times the daily ATR below entry |
Typical 4-hour range (ATR)atr14_4hPct | The average 4-hour range over 14 candles, as % of price. | % | Stop 2 times the 4-hour ATR below entry |
RSI (1 hour)rsi14_1h | Momentum oscillator from 0 to 100; above 70 is stretched up, below 30 stretched down. | 0–100 | Buy dips when rsi14_1h is below 35 in a daily uptrend |
RSI (4 hours)rsi14_4h | The same oscillator on 4-hour candles. | 0–100 | Take profit when rsi14_4h is above 75 |
Volatility (last 24h)realisedVol24hPct | How much price actually moved around over the last day. | % | Skip trades when the last 24h volatility is above 6% |
Volatility regimevolRegime | Last 24h volatility against its 30-day norm: calm (under 0.7x), normal, or hot (over 1.5x). | calm / normal / hot | Breakouts only when volRegime is not calm |
Volume
| Name | What it means | Reads as | Example rule |
|---|---|---|---|
24h volumevolume24hUsd | Dollar value traded over the last 24 hours. | USD | Only trade markets with over $50M of 24h volume |
Volume vs normalvolume24hVs7dAvg | Today's volume against the 7-day daily average (1.5 = 50% busier than usual). | ratio | Breakouts need volume24hVs7dAvg above 1.3 |
Positioning
| Name | What it means | Reads as | Example rule |
|---|---|---|---|
Funding nowfundingNowPctPerHour | The hourly funding rate. Positive: longs pay shorts. Neutral is about 0.00125% per hour. | % per hour | Skip longs when funding is above 0.004% per hour |
Funding, 24h averagefunding24hAvgPctPerHour | Average hourly funding over the last day. | % per hour | Short when the 24h average funding is above 0.003% per hour |
Funding, 7-day averagefunding7dAvgPctPerHour | Average hourly funding over the last week. | % per hour | Carry: long when the 7-day average funding is negative |
Funding percentile (30 days)fundingPctile30d | Where today's funding ranks against the last 30 days: 95 means higher than 95% of the time. | 0–100 | Fade crowded longs when fundingPctile30d is above 90 |
Open interestoiUsd | Total value of open positions in this market. | USD | Only trade markets with over $100M open interest |
Open interest change (1h)oiChange1hPct | How much open interest (in contracts) changed over the last hour. | % | A breakout counts only if open interest rose over the hour |
Open interest change (24h)oiChange24hPct | Price up with open interest up is new money; price up with it down is shorts covering. | % | Long only if price and open interest are both up over 24h |
Open interest change (7 days)oiChange7dPct | Open interest change over the week. Ready after 7 days of collection. | % | Avoid markets where open interest grew over 40% in a week |
PremiumpremiumPct | How far the perp price is above (+) or below (−) the oracle (spot) price. | % | Buy flushes only when the premium is 0% or below |
Order book
| Name | What it means | Reads as | Example rule |
|---|---|---|---|
Book imbalancebookImbalance | Total bid size over total ask size in the top 20 levels; above 1 means more buyers resting. | ratio | Require bookImbalance of at least 1.2 |
Bid depth within 1%bidDepth1PctUsd | Dollars of buy orders resting within 1% below the price. | USD | Skip markets with under $2M of bids within 1% |
Ask depth within 1%askDepth1PctUsd | Dollars of sell orders resting within 1% above the price. | USD | Thin asks (under $1M within 1%) favour breakouts |
What it remembers
The AI starts every run fresh, so AgentHub hands it a memory built from the record: the history of each open position, its recent decisions, and a short note it wrote to itself last time. That makes rules like “take half at 2R”, “add once” or “after three losses in a row, halve size” work reliably.
| Name | What it means |
|---|---|
openedAt · holdingHours | When the position was opened and how long it has been held. |
originalEntryPrice · originalStopPrice | The price and stop-loss it was opened with, even after the stop has been moved. |
rMultiple | Profit in multiples of the original risk: 2 means price moved twice the distance from entry to the original stop in your favour; −0.5 is half the risk lost. |
adds · reduces | How many times it was added to or partly closed since opening. |
bestPriceSinceOpen · moveFromBestPct | The best price since opening (highest for a long) and how far price is from it. Good for trailing stops. |
fundingSinceOpenMinor · feesSinceOpenMinor | Funding and fees on this position so far, in cents (negative = paid). |
memory.recentDecisions | Its last five runs: what it did and whether that executed, held or was blocked. |
memory.recentTrades | Wins, losses and net result of its last ten closed trades, and lossStreak (losing trades in a row). |
memory.note | The note it left itself on its previous run (up to 280 characters), such as “took half off BTC at 2R”. |
See why it decided
Let AgentHub size the trade
Write how much the agent may lose if the stop is hit, not a dollar amount: “risk 1.5% of the account at the stop”. The AI then sends riskPct with its stop-loss, and AgentHub works out the exact position size: the move to the stop, the trading fee to open and close, the price it would really fill at in the order book, and every limit the deployer set (largest trade, most one trade can lose, margin, position size), rounded to a size the market accepts.
Each run shows how it was sized, for example “Risk 2% ($2,000 at the stop) → sized at $125,700 · limited by the risk it chose”. If no valid size fits (the stop is on the wrong side, or the size would be under the $10 minimum), the agent holds and says why. The deployer’s limits still check every trade afterwards.
A brief that uses them
Long-only trend follower at 3x on BTC-PERP and SOL-PERP.
ENTER LONG when ALL are true:
- The daily trend is up (trend1d = up)
- Price pulled back: 1h RSI below 40 (rsi14_1h < 40)
- Longs are not crowded: funding percentile below 80 (fundingPctile30d < 80)
- Open interest is not falling over 24h (oiChange24hPct >= 0)
RISK: stop-loss 1.5 times the daily range below entry (atr14_1dPct),
risk 1% of the account at the stop (AgentHub sizes it), 3x leverage.
MANAGE: at 1R (rMultiple >= 1) move the stop to entry; at 2R take half
off once (reduces = 0); then trail the stop 2 times the daily range below
the best price since opening (bestPriceSinceOpen).
EXIT when the daily trend is no longer up, or price makes a new
20-day low (newLow20d = true). After 3 losing trades in a row
(memory.recentTrades.lossStreak >= 3), halve the size. Otherwise HOLD.Every condition is a number the AI can check, so its decision shows exactly which rule passed or failed. Your deployer’s limits (leverage, most one trade can lose, drawdown) are still enforced on every trade.
How fresh it is
| Data | Updated |
|---|---|
| Price, funding, open interest, order book | On every run (live) |
| 1-hour candles | Every 5 minutes |
| 4-hour candles | Every 15 minutes |
| Daily candles and funding history | Every hour |
| Open interest history | Every hour, from our own samples |
Building your own bot instead? It can use any data you like; see Your own bot.