impulse is a terminal client for the Imperial perps API.
It has two modes:
- CLI subcommands for scripting/automation
- TUI for interactive monitoring + order flow
cargo build --release
./target/release/impulseIf no subcommand is provided, impulse starts the TUI.
- Login (JWT auth):
impulse login- Check account + market state:
impulse whoami
impulse balances
impulse positions
impulse marks --symbol SOL- Route and trade:
impulse route --side long --notional 1000 --leverage 5 --asset SOL
impulse order --side long --venue phoenix --notional 100 --collateral 20 --asset SOL- Manage orders:
impulse orders
impulse cancel --order-pda <PDA>
impulse update --order-pda <PDA> --trigger 91.5- Cleanup:
impulse sweep --profile 0
impulse revokeEvery command supports --json and returns one envelope:
- success:
{"ok": true, "data": ...} - failure:
{"ok": false, "error": "..."}
Example:
impulse marks --symbol SOL --jsonThis is the recommended mode for Claude/Codex integrations.
impulse deposit maps to Imperial /deposit/build-tx and supports:
--mode deposit(wallet USDC -> profile USDC)--mode withdraw(profile USDC -> wallet USDC)
Important: this endpoint returns a partially-signed sponsored tx. You still need to:
- decode base64
- sign with wallet keypair
- broadcast via Solana RPC
Example:
impulse deposit --usdc 100 --profile 0 --mode deposit
impulse deposit --usdc 50 --profile 0 --mode withdrawimpulse sweep calls /passthrough/users/{wallet}/profiles/{index}/sync.
Use it after fully closing non-USDC-collateralized positions (residue like WSOL/WBTC/WETH) to reclaim USDC back to wallet.
Start:
impulse tuiUseful keys:
:command line?helpb/sprefill buy/sellcprefill closexcancel selected ordervcycle venuemcycle candle bucketqquit
TUI commands include:
buy, sell, close, limit, cancel, route, balances, positions, orders, status, sweep, sym, venue, profile, revoke, clear.
CLI exposes both basic and advanced route parameters (see impulse route --help), including:
hold-hoursdaily-volsticky-venuesubaccount-default-venuewalletprofile-indexexcluded-venues
- Global API override:
--base-url - Credentials path override:
IMPULSE_HOME - JSON output:
--json
Default auth file location:
$XDG_CONFIG_HOME/impulse/credentials.json- fallback:
~/.config/impulse/credentials.json
Use:
impulse --help
impulse <command> --helpFlag descriptions are detailed and aligned with Imperial API behavior.
Imperial OpenAPI:
https://api.imperial.space/api/v1/openapi.json
Docs UI:
https://api.imperial.space/api/v1/docs
MIT