Execution intelligence for Hyperliquid
Hyperliquid lets an order buy its way forward in time: about 45 ms for every basis point, up to 8 bps. VELOCITY tells you what that is worth for the order in front of you, and lets you send it from your own keys.
How it works
Give the engine an order: market, side, size, urgency and your limits. It reads the live book and volatility and returns the priority fee that minimises expected cost, with the whole cost curve behind it.
Under a millisecond. Runs hosted, or inside your own process.
The fee goes into the order as Hyperliquid's own priority field. Your browser or your script signs it with a trade-only agent key and sends it straight to Hyperliquid.
VELOCITY never holds a key and has no "execute for me" endpoint.
The fill, the fee burned and the slippage against arrival price are logged. Batches of those records are committed to Elysium so any single execution can be checked against what was published.
Policies, credits and attestations live on Elysium. Trading capital never does.
The schedule
Hyperliquid sorts its mempool by arrival time minus a credit for the fee you pay. The credit grows in a straight line up to the cap and then stops. So the question is never “how fast can I go”. It is whether the next 45 ms are worth one more basis point for this order, in this market, right now.
Drawn from Hyperliquid’s published constants. The Fee Explorer compares them with what our own executions measure.
import { Velocity } from "@velocity/sdk";
// Local mode: the fee model runs in your process against your own
// market-data subscription. No network hop sits before the order.
const client = await Velocity.connect({
network: "testnet",
mode: "local",
agentKey: process.env.HL_AGENT_KEY, // trade-only key; cannot withdraw
account: "0xYourMainWallet",
});
const quote = client.quote({
market: "BTC",
side: "buy",
notionalUsd: 25_000,
urgency: "high",
maxPriorityBps: 4,
maxSlippageBps: 5,
});
console.log(quote.recommendedBps, quote.p); // e.g. 4 40000
// Builds the IOC with grouping {"p": quote.p}, checks your on-chain
// policy, signs with the agent key and sends it straight to Hyperliquid.
const result = await client.executeIoc(quote);
console.log(result.status, result.fillPx, result.priorityFeeUsd);SDK
Every 45 ms spent asking a server what to pay costs the same as a basis point of priority. So the SDK ships the fee model itself. In local mode it prices the order in your process, against your own market-data connection, and signs with your agent key.
The Optimizer is free to use and needs no wallet. Connect one when you want to send the order.