openfin-hyperliquid
Complete Hyperliquid playbook — perpetuals and spot trading, margin/leverage, TWAP, real-time WebSocket data, and historical candles. Use for any Hyperliquid task. Trading triggers: place perp/spot orders (Gtc/Ioc/Alo), market-like fills, take-profit/stop-loss grouping, modify or cancel orders, batch cancels, TWAP orders (place/track fills/terminate), change leverage (cross vs isolated), adjust isolated margin, get the EVM deposit address to fund Hyperliquid. Deposits fund the **unified Hyperliquid account** — once unified, there is one USDC balance per wallet, no perp-vs-spot distinction. Auto-unify rule: on the first balance check, read `/account`; if `withdrawable > 0`, GET `/agent/trading/abstraction`, and if it returns `"default"` or `"disabled"`, POST `{abstraction: "u"}` (the only accepted value) to upgrade — one-shot and idempotent. After unification, agents MUST read both `/account` and `/account/spot` and sum `account.withdrawable + spot.USDC.total` to get the wallet's free USDC, then treat
Repository SourceNeeds Review
openfin-onramp
Fiat-to-crypto onramp via Moonpay, prefilled with the caller's wallet, chain, currency, and fiat amount. Use whenever the user says they want to buy crypto with a card / bank / Apple Pay / Google Pay, top up a wallet from fiat, fund a Hyperliquid / Polymarket / Solana wallet "with my card", or "I'm out of USDC, how do I get some". Triggers: "buy USDC with my card", "credit card onramp", "Apple Pay USDC", "deposit fiat", "I have no crypto, how do I start", "fund my wallet with fiat", "buy ETH on Base with USD". Covers POST /agent/onramp/moonpay — returns a Moonpay simple-URL with chain / currencyCode / walletAddress / fiat amount baked in. The user opens the URL to complete KYC + payment in Moonpay's UI; once the buy clears, funds arrive in the user's OpenFinance-provisioned wallet on the chosen chain. No on-chain signing from the agent. Wallet defaults to the caller's OpenFinance-managed EVM address (or Solana address when chain=solana / currencyCode ends `_sol`). Pair with openfin-relay (bridge after onr
Repository SourceNeeds Review
openfin-relay
Cross-chain bridging, swapping, and "bridge+call" via Relay through the OpenFinance backend. Use whenever the user wants to move tokens between chains or execute a destination-chain transaction funded from another chain. Triggers: "bridge X from Y to Z", "move my USDC to Base / Arbitrum / Optimism / Polygon / Solana", "swap ETH for USDC on Base", "cross-chain swap", "bridge and call", "how do I get to Solana / back from Solana", "my USDC is stuck on Solana", EVM-to-EVM, EVM-to-Solana, Solana-to-EVM, Bitcoin bridge, gas topup on destination, native-token sentinel 0x0, relay quote/preview/execute flow, poll intent status. Covers POST /agent/relay/quote, POST /agent/relay/execute, GET /agent/relay/status. Includes the chainId cheatsheet (1/137/8453/10/42161/... and Solana 792703809 specifically), tradeType semantics (EXACT_INPUT / EXACT_OUTPUT / EXPECTED_OUTPUT), why topupGas is auto-disabled on Solana routes, and bridge+call payloads (txs array). Use together with openfin-setup (API key check) and openfin-t
Repository SourceNeeds Review
openfin-setup
Auth check for the OpenFinance backend — confirms an API key is available before any other OpenFinance skill runs. Use FIRST whenever the user is about to call any /agent/* route (Polymarket, Hyperliquid, Relay), is hitting 401/412, or hasn't traded yet in this session. Triggers on "how do I get started", "API key is required", "Invalid API key", "401/412 from /agent/*", "set up OpenFinance", or any first call into a trading skill. Resolves the key from `OPENFINANCE_API_KEY` (or equivalent env / user-supplied value), confirms the format (`open_…`), verifies via GET /agent/wallets, and otherwise points the user to https://openfinance.tech to issue one.
Repository SourceNeeds Review