liberfi-perpetuals — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited liberfi-perpetuals (Agent Skill) and scored it 87/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 3 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 3 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Perpetuals data and signed order relay flow via LiberFi OpenAPI (/v1/perpetuals/… → perpetuals-server).
See bootstrap.md for CLI install and lfi ping.
positions, orders, fills): pass the walletaddress (0x) as the positional argument. For first-person queries ("我的持仓", "my positions", etc.), the skill MUST auto-resolve the user's TEE EVM address via lfi status → lfi login key (if needed) → lfi whoami → use the returned evmAddress. NEVER ask the user for an address — the TEE wallet is server-managed and the user does not know it.
order-prepare / order-submit, cancel variants): require a user wallet to sign typed data; agents must not fabricate signatures.lfi status then lfi login key) — the server's TEE wallet signs and broadcasts on the user's behalf. The atomic deposit-quote / deposit-submit escape hatches do not require auth but the caller is then responsible for signing the SOL tx and broadcasting it themselves.| User intent | Skill |
|---|---|
| Spot swap, bridge, gas send | liberfi-swap |
| Trending spot tokens, new listings | liberfi-market |
| Polymarket / Kalshi | liberfi-predict |
| Spot token audit, DEX pools for a token | liberfi-token |
| Perp markets, HL-style orderbook, perp positions | liberfi-perpetuals |
| Funding the perp account (Solana → Hyperliquid via Relay), checking deposit lifecycle | liberfi-perpetuals |
| Spot wallet holdings on a chain (not perp account) | liberfi-portfolio |
| Command | Description |
|---|---|
lfi perpetuals coins | List tradable perp coins |
lfi perpetuals markets | Market snapshots (--symbols optional) |
lfi perpetuals market <symbol> | Single market |
lfi perpetuals orderbook <symbol> | L2 book (--max-level) |
lfi perpetuals trades <symbol> | Recent trades (--limit) |
lfi perpetuals klines <symbol> | Candles (--interval required) |
lfi perpetuals positions <address> | Positions + margin summary |
lfi perpetuals orders <address> | Open orders |
lfi perpetuals fills <address> | Fill history |
lfi perpetuals order-prepare | Build typed data for place order |
lfi perpetuals order-submit --body '<json>' | Submit signed place order |
lfi perpetuals cancel-prepare | Build typed data for cancel |
lfi perpetuals cancel-submit --body '<json>' | Submit signed cancel |
lfi perpetuals deposit-place --gross-lamports <n> | Recommended: TEE one-click Solana → Hyperliquid deposit (server quotes, signs, broadcasts, submits). Auth required. |
lfi perpetuals deposit-quote --user-solana-address <a> --hyperliquid-recipient <a> --gross-lamports <n> | Escape hatch step 1: returns unsigned SOL tx + breakdown. Caller signs + broadcasts within ~30s, then calls deposit-submit. |
lfi perpetuals deposit-submit --body '<json>' | Escape hatch step 2: record the broadcasted SOL tx hash. Idempotent on solanaTxHash. |
lfi perpetuals deposit-status <intentId> [--refresh] | Read deposit lifecycle. --refresh bypasses any server-side cache (server-reserved knob; today both endpoints behave identically). |
Common flags: --provider <name> (e.g. hyperliquid), global --json.
The deposit pipeline moves SOL from the user's Solana wallet to the user's Hyperliquid perp account via the Relay bridge service. The recommended path is the one-click TEE auto-flow:
lfi status --json; if not logged in,lfi login key --role AGENT --name "<agent>" --json.
lfi perpetuals deposit-place --gross-lamports <lamports> --jsonlamports = SOL × 1_000_000_000 (1 SOL = 1e9 lamports).--hyperliquid-recipient is optional — defaults to the user's TEEEVM address (lfi whoami evmAddress), which is what 99% of users want.
intentId and solanaTxHash.lfi perpetuals deposit-status <intentId> --json untilstatus is settled (typical: 30–120 s).
Server returns status: "broadcasted" immediately after step 3; the reconciliation loop progresses through relay_waiting → relay_pending → settled (or failed_* states). On failure consult the statusHistory[] and lastError fields for the recoverable / non- recoverable distinction.
For the atomic escape-hatch flow (when the user controls their own SOL private key outside the TEE, or recovering from a partial failure where the SOL tx has been broadcasted but submit did not succeed), see reference/deposit-flow.md.
lfi perpetuals markets --jsonlfi perpetuals orderbook BTC --jsonlfi perpetuals trades BTC --limit 20 --jsonlfi perpetuals positions 0xYourAddr --jsonIf the user says "我有什么永续持仓", "我的合约持仓", "my perp positions", "我在 Hyperliquid 上挂了哪些单", "我永续盈亏", "show my fills" or any first-person variant — DO NOT ask for a wallet address. Run this exact sequence:
lfi status --jsonlfi login key --role AGENT --name "OpenClawAgent" --jsonlfi whoami --json → returns evmAddress(the user's TEE EVM address managed by the LiberFi server).
lfi perpetuals positions <evmAddress> --jsonlfi perpetuals orders <evmAddress> --jsonlfi perpetuals fills <evmAddress> --limit 20 --jsondirectly — do not retry with a different address; an empty result is the correct answer for a fresh TEE wallet.
The user does not know their EVM address — the LiberFi server holds the TEE wallet. The skill must resolve "我" → TEE wallet via whoami, transparently.
lfi perpetuals order-prepare --user-address 0x… --symbol BTC --side long --order-type limit --amount 0.01 --price 95000 --jsontypedData with their wallet (e.g. MetaMask eth_signTypedData_v4).SignedAction: action, nonce, signature (0x), optional vaultAddress from prepare response.lfi perpetuals order-submit --body '{"action":…,"nonce":…,"signature":"0x…"}' --jsonAll CLI calls hit OpenAPI paths under /v1/perpetuals/…, which the gateway proxies to perpetuals-server /v1/…. Configure the gateway with UPSTREAM_PERPETUALS_SERVICE_BASE_URL (default local example: http://localhost:8083 — avoid colliding with openapi :8080 and prediction :8082; run perpetuals-server with SERVER_PORT=8083 when colocated).
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.