serve
Usage
soulpass serve [--port <port>]
Start a localhost-only HTTP daemon exposing JSON-RPC 2.0 methods with warm caches. Eliminates CLI spawn overhead (~600ms/op → ~0ms) — ideal for trading bots and high-frequency operations. Binds to 127.0.0.1 only; every method requires the auth token.
◆ human-only — a long-running process started by a human, not an agent; agents call the methods it serves.
Flags
--port <port>— Listen port (default: 8402)
JSON-RPC methods
price | Real-time token prices |
balance | Check balances |
tx_status | Transaction status |
spot | Market-price token buy/sell via the planner; an hl: asset is refused, naming perps_market |
perps_market | Hyperliquid perpetual at market — soulpass perps market over JSON-RPC (amount in US dollars, reduce_only, leverage, all; no_wait refused) |
pay | Token transfer |
batch | Parallel SOL transfers |
cache_invalidate | Clear local caches |
Examples
# Start daemon
soulpass serve --port 9000
# Call via curl (auth token required)
TOKEN=$(cat ~/.soulpass/daemon.token)
curl http://127.0.0.1:9000 \
-H "Authorization: Bearer $TOKEN" \
-d '{"jsonrpc":"2.0","method":"price","params":{"tokens":["SOL"]},"id":1}'