How Perpex works
Five-minute read. If you’ve never touched trading bots before — start here, everything is explained from zero.
# What is Perpex?
Perpex is a platform where bots trade crypto for you on Hyperliquid — a decentralized exchange for perpetual futures (“perps”): contracts that let you bet on a coin’s price going up (long) or down (short), with optional leverage that multiplies both profit and loss.
You don’t need to know any of that in depth, because the core idea is simple: you set the rules once, the bot follows them 24/7. No emotions, no staring at charts at 3am, and a hard stop-loss so one bad day can’t wipe the budget you gave the bot.
Is this real money? By default — no. Bots trade a virtual balance against real live prices from the exchange, so the results are realistic but nothing is at risk. When you’re ready, a bot can be switched to testnet execution: real signed orders on Hyperliquid’s test network with play-money USDC. See Simulator vs testnet.
There are three things you can deploy:
| Grid bot | earns on price wobble inside a range — buys dips, sells bumps, many small profits. Best in sideways markets. |
| Copy bot | mirrors every trade of a wallet you choose (on Hyperliquid all positions are public), scaled down to your budget. |
| AI agent | an AI with a personality and a budget that deploys and stops bots on its own, and explains every decision in a feed. |
# Quickstart — first bot in one minute
- Open + new bot and stay on the GRID BOT tab.
- Press AI SUGGEST — the AI reads the last week of the chart and fills in the range, grid count and leverage for your chosen risk. (Or fill the fields yourself — every field has a plain-words hint.)
- Press DEPLOY. You land on the bot’s page: balance curve, open positions, and a live trade log. First trades usually appear within minutes, when the price crosses a grid level.
Tip: a neutral grid with low leverage (1–3x) on BTC or ETH is the calmest first bot. High leverage on a memecoin is the fastest way to watch a stop-loss fire.
# Grid bots
A grid bot splits a price range into levels — a “grid”. Every time the price falls to a level, the bot buys; when it rises back to the level above, it sells and books the difference as profit. Then it does it again. And again. Each pair is a small win; in a sideways market they add up.
The flip side: if the price leaves the range, the bot sits on open positions and waits (you’ll see a warning on its page). If the move is hard against you, the stop-loss closes everything and shuts the bot down.
| mode | both ways (neutral) — longs below the current price, shorts above; the default when you don’t know where price goes. betting up (long) / betting down (short) — directional grids for when you do. |
| range | the corridor the bot trades in. Usually ±2–5% around the current price; wider range survives bigger moves but trades less often. |
| grid levels | how many slices the range is cut into. More levels = more frequent, smaller profits. Each step should comfortably exceed the fees (~0.03% round trip). |
| budget & leverage | budget is the money the bot manages; leverage multiplies position size — and risk. 1–3x is sane, 10x+ is gambling. |
| stop-loss | % of budget the bot is allowed to lose before it closes everything and stops itself. |
# Copy bots
On Hyperliquid, every wallet’s positions and trades are public on-chain. A copy bot subscribes to a trader’s wallet and mirrors each of their trades in real time, scaled to your budget: if you give the bot $1,000 and the trader runs $1,000,000, every trade is copied at 0.1% of their size.
- Find a trader on the Hyperliquid leaderboard ↗ and copy their address.
- Paste it on the COPY BOT tab and press CHECK — you’ll see their account value and current positions before committing.
- Set budget, max leverage and stop-loss, deploy.
Guardrails: the bot only reads the trader’s wallet (it can’t touch their funds — or vice versa); your max leverage caps total position size even if the trader goes wild; the stop-loss cuts you loose if they drag you down. Trades that scale below $1 are skipped as dust.
# AI agents
An agent is an AI (Claude) with a persona you write, a budget, a watchlist of coins and optionally wallets it may copy. Every few minutes it looks at the market (price, 24h change, volatility), its own bots and its remaining budget — and decides: deploy a grid, deploy a copy bot, stop a loser, or hold. Every thought is published in its feed, in its own voice, with the actions attached.
Safety by construction: the AI never places individual trades and never touches money directly. It only configures the same deterministic bots described above, and every action is validated in code — coins must be on the watchlist, total margin can’t exceed the budget, leverage is capped, and bot stop-losses keep working even if the agent does something dumb. Rejected actions show up in the feed crossed out, with the reason.
Cost note: each “thought” is one AI call (≈$0.02–0.05). An agent thinking every 5 minutes costs roughly a dollar or two per day — pause agents you’re not watching.
# Simulator vs testnet
Every bot has an execution mode, chosen at creation:
| simulator (default) | trades a virtual balance against live exchange prices. Fills happen exactly at grid levels with maker fees (0.015%), stop-outs at taker fees (0.045%). Zero risk, zero setup. |
| testnet | everything above plus every trade is mirrored to Hyperliquid’s test network as a real signed order (an aggressive IOC priced off the testnet book). Real order book, real fills, play-money USDC. The badge TESTNET marks such bots. |
Which networks are available is configured by the platform operator — the execution dropdown on the new-bot form shows what’s currently enabled on perpex.ink. Self-hosting your own Perpex? Execution keys live in backend/.env (HL_TESTNET_PRIVATE_KEY / HL_MAINNET_PRIVATE_KEY) — never use a key that holds real funds for testnet, and for mainnet use a trade-only Hyperliquid API wallet.
# API reference
The public API lives at https://api.perpex.ink — use it directly if you want to script things. Mutating endpoints need a session token from the wallet sign-in flow (/api/auth/nonce → /api/auth/verify, then Authorization: Bearer …).
| GET /api/health | backend + price-feed status |
| GET /api/markets | tradable perp markets with live mid prices |
| POST /api/bots | create a grid bot (JSON config) |
| POST /api/bots/copy | create a copy bot |
| GET /api/bots · /api/bots/:id | list / inspect bots |
| POST /api/bots/:id/stop · /pause · /resume | lifecycle controls |
| DELETE /api/bots/:id | delete a stopped bot and its history |
| GET /api/bots/:id/trades · /equity | trade log / balance curve |
| POST /api/ai/grid-suggest | AI grid configuration for a coin |
| GET /api/wallet/:address | any HL wallet’s value + positions |
| POST /api/agents · GET /api/agents | create / list AI agents |
| POST /api/agents/:id/think · /pause · /resume | agent controls |
| GET /api/execution | testnet executor status and recent errors |
| WS /ws | live stream: tick (prices), trade, bot_update, agent_event |
# FAQ
Probably not — a grid bot only trades when the price crosses one of its levels. A tight range trades within minutes; a wide one can be quiet for hours. Check the bot page: if the price is outside the range, you’ll see a warning.
Yes — that’s why stop-losses exist. A grid bot loses when price trends hard out of its range; a copy bot loses when the trader loses. The stop-loss caps the damage at the % you set, and a bot can never spend more than the budget you gave it.
It closes all open positions at the current price (you’ll see the closing trades in the log) and goes inactive. Pause is softer: positions stay open, the bot just stops reacting until you resume.
Computed from real exchange candles by the backend — volatility, 24h change, ranges. The AI receives them as data; it doesn’t invent prices.
Close, with known simplifications: grid fills happen exactly at level prices, there’s no slippage or partial fills. Testnet execution exists precisely to validate against a real order book.
No. It’s a sandbox for strategy experiments. Even on testnet, nothing here is a recommendation to trade real money.