OneKey Perps/Hyperliquid development for views/Perp, orders, orderbook, charts, Relay deposits, positions, funding, margin, and liquidation. Excludes generic Swap/Market work.
72
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Medium
Suggest reviewing before use
Use this as a Perps/Hyperliquid domain router for order semantics, realtime subscriptions, and UI/background state races. Choose the owner and proof path; verify anchors with rg before editing.
perp/spot), account/dex, order mode, and platform. Ask only if missing scope blocks correctness or creates trading risk.| Prompt/file signal | Use this skill? | First move |
|---|---|---|
views/Perp, ServiceHyperLiquid, Hyperliquid, Perps/永续/合约 trading | Yes | Pick owner below, then one reference |
| Generic Market K-line, generic TradingView bridge, generic token selector | No | Use adjacent Market/TradingView/token-selector skill or repo search |
| Generic Swap Relay quote/status/pending/requestId | No | Use $1k-trade-swap-market unless Perps deposit is explicit |
Perps deposit, usePerpDeposit, fetchPerpDeposit*, perpsDepositOrderAtom, perp-deposit endpoint | Yes | Open deposit-relay.md |
If Perps/Hyperliquid is only a guess, do not load all references; verify the file/surface with rg or use the adjacent skill.
| Surface | Primary owner | Usual proof |
|---|---|---|
| Order submit/cancel/TWAP/scale/TIF | ServiceHyperliquidExchange.ts, Hyperliquid actions.ts, shared Perps utils/types | SDK type/source check + targeted order utility/action tests |
| L2/BBO/orderbook subscriptions | ServiceHyperliquidSubscription.ts, Hyperliquid context actions, freshness utils | rapid switch/reconnect + L2/BBO freshness proof |
| Deposit quote/status | packages/kit-bg/src/services/ServiceSwap.ts, perpsDepositOrderAtom | active fromTxId; requestId only when backend/Relay exposes it |
| Positions/account state/funding/margin/liquidation | ServiceHyperliquid.ts, Hyperliquid context atoms/actions, account-scoped Perps hooks/utils | account/dex/asset scoped proof; no stale positions/account summary |
| Perps TradingView/K-line/chart lines | packages/kit/src/components/TradingView/TradingViewPerpsV2/TradingViewPerpsV2.tsx | readiness/message/reconnect scenarios |
| UI-only display | Perps component/list/row files | display proof only; do not mutate trading contracts here |
| Topic | Guide | Start With |
|---|---|---|
| Code map | code-map.md | views/Perp, Hyperliquid context, BG service, shared types/utils |
| Order contracts | order-contracts.md | TWAP, scale, TIF, trigger, reduce-only, precision |
| State and subscriptions | state-subscriptions.md | account/dex/asset scoping, L2/BBO, active target, cleanup |
| Perps TradingView bridge | tradingview-bridge.md | TradingViewPerpsV2, Perps K-line readiness, chart lines |
| Relay deposit | deposit-relay.md | Perps deposit address flow, requestId tracking, pending cards |
| Positions/account state | positions-account-state.md | positions, balances, PnL/PNL/P&L, funding, margin, liquidation |
| Failure patterns | failure-patterns.md | recurring bugs and hard-to-see regressions |
| Validation recipes | validation-recipes.md | targeted tests and runtime paths |
| Review checklist | review-checklist.md | PR/source checks and release risk gates |
| Source index | source-index.md | volatile SDK/API/docs/vault lookup points |
| User asks about | Load first | Then verify |
|---|---|---|
| "TWAP cancel/list/history is wrong" | order contracts + code map | TWAP state/cancel/history recipes |
| "Scale order children/precision/TIF" | order contracts | scale utility tests + partial-failure runtime path |
| "Orderbook flashes old BTC after ETH switch" | state/subscriptions + code map | rapid asset/account switch; L2/BBO freshness |
| "Perps K-line blank after offline/reconnect" | TradingView bridge | ready-state/reconnect scenarios, native if touched |
| "Perps deposit pending/completed wrong" | Relay deposit | active tx/request scope and stale quote cases |
| "Perps positions/PnL/funding/margin/liquidation/account summary stale" | positions/account state | account/dex/asset scope; no stale position/account display |
| "Review a Perps PR" | changed-surface reference first; review checklist second | use failure patterns to challenge findings and validation gaps |
Order semantics, TIF, TWAP, scale, trigger, and reduce-only are volatile, SDK-versioned contract facts — confirm them against the source, do not trust memory:
node_modules/@nktkas/hyperliquid/src/api/exchange/_methods/.@nktkas/hyperliquid bump; new fields/TIF values (e.g. FrontendMarket) appear over time.$1k-tradingview-communication - TradingView message contracts and iframe bridge.$1k-state-management - Jotai atom/context conventions.$1k-performance - Render, subscription, and hot-path performance.$1k-trade-swap-market - Adjacent trade/review/history patterns; do not copy swap provider semantics blindly.$1k-cross-platform - Platform-specific RN/Web/Desktop behavior.$1k-analytics - Perps analytics/logging changes.d71e6b7
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.