[new-plugin] hyperliquid-aigrid v1.2.6#360
Conversation
Strategy plugin for Hyperliquid perps. Renamed from liqgrid for clearer
brand association with Hyperliquid.
Pipeline:
user → natural-language parse → hyperliquid-plugin (mark/candles)
+ api.hyperliquid.xyz (funding) + hyperliquid-aigrid binary
→ dry-run plan + 7-day backtest preview → user confirm
→ hyperliquid-plugin order/tpsl --strategy-id hyperliquid-aigrid
→ Agentic Wallet TEE signing → on-chain fills
Key features (deterministic binary):
- Funding-aware ±20% notional tilt to collect funding as alpha
- Concentrated-liquidity sizing (Gaussian fill-prob in log-price)
- 75-combination parameter optimizer (Calmar-ranked)
- 30-day backtest with realized PnL / max DD / Sharpe
- Zero-friction quickstart (range/leverage/profile auto-pick)
- Hard caps in source: $5k notional / 10x lev / 50 rungs / 30% loss
Source: dddd86971-cloud/hyperliquid-aigrid@aed9868
30/30 self-tests pass. SUMMARY.md / SKILL.md / README.md / LICENSE all
present. category=strategy + dependent_plugin: hyperliquid-plugin@^0.3.9
+ risk_level: advanced + supported_venues: [hyperliquid].
This PR replaces okx#344 (which was titled liqgrid). okx#344 will be closed
with a link to this PR.
…json regen for new package name)
Round 1 (P1 + P2):
- SKILL.md: lg-<planHash[:5]> → ha-<planHash[:6]> (line 498 stale tag form)
- SKILL.md: drop 'v1.0.0' from Example 3 ceiling text
- SKILL.md: jq funding-rate fetch example now copy-paste-able with --arg
coin substitution + explicit "mainnet only" rationale
- README.md: 26 invariants → 30
- plugin.yaml: + type: community-developer + github_link
- plugin.json: + homepage + repository
Round 2 (caught after first verification pass):
- SKILL.md: grid-resume filter rule lg- prefix → 'hyperliquid-aigrid' or
ha-{planHash[:6]} per Attribution Rule (line 561 was stale)
- source_commit pin bumped to 2a8d6cc (incl. types.ts comment fix +
README v1.2 section + 30-test count)
No code changes. Same 30/30 self-tests pass.
Source: dddd86971-cloud/hyperliquid-aigrid@66bd3f5 Adds post-buildLevels guard for small-notional accounts ($50-200 range): when concentrated-liquidity sizing leaves edge rungs below marketMeta.minOrderSizeUsd, iteratively reduce gridCount toward MIN_GRID_COUNT, then fall back to uniform sizing if even that fails. Solves the production issue where v1.2.0 plans for $50 accounts produced edge rungs around $0.05 each — well below HL's $10 min order — leading to silent rejection on placement. Now small-account users get viable 4-rung uniform grids with clear warnings explaining how to restore concentrated geometry. Self-tests: 30 → 33. Existing large-account behavior (≥ $300 × 1×) is byte-identical to v1.2.0. SKILL.md adds 'Small-account guidance' table covering: - ≥ $300 × 1× → full concentrated - $100-$300 × 1× → reduced count, still concentrated - $50-$100 × 1× → uniform fallback - < $50 × 1× → recommend 2× leverage
…ills/day<1 warning PR-side updates only — bump plugin.yaml version + source_commit pin, plus document the new fields + REFUSE-abort rule in SKILL.md. Three new GridPlan output fields make the funding-bias tilt and grid geometry directly readable without summing levels[]: - buySideNotionalUsd / sellSideNotionalUsd : per-side aggregates - rangeWidthPct : (rangeHigh - rangeLow) / mark New "expected fills/day < 1" warning: when realized vol is too low for the configured range, the grid sits idle and pays funding for nothing — the warning suggests a tighter range (~±2σ daily of mark) or waiting. Pre-execution check okx#3 in SKILL.md formalizes the existing "REFUSE: prefix → abort" guard for stale-range / mark-out-of-range plans. planHash unchanged for the same input bytes — purely additive output extension. Source SHA pinned at b0fdd4230f, self-tests 33 → 37 (all green).
|
v1.2.2 update — purely additive output extension Source SHA What's new:
Same shape as before (no breaking changes), no algorithm shifts, no new caps. Rebased cleanly on origin/main. |
PR-side updates only — bump plugin.yaml version + source_commit pin, plus document the new range algorithm in SKILL.md. quickstart() now derives the recommended range from BOTH the placeable rung count AND realized vol, instead of a fixed vol-only formula. For small accounts (where rungs are forced down to MIN_GRID_COUNT=4 by the HL $10 min order), this means the range tightens to (rungs-1) × σ_hourly instead of always being ±4-7% — so the grid actually trades on hourly wiggles rather than waiting hours for outlier moves. Real-world impact at σ_d=1.35% on BTC: $24 account → ±0.41% (was ±4.4%) $100 account → ±2.61% (was ±4.4%) $5000 account → ±4.36% (unchanged — vol envelope kept as upper bound) plan() semantics unchanged. Only quickstart() output range differs. Plans built from explicit (rangeLow, rangeHigh) have byte-identical output to v1.2.2. Source SHA pinned at dd30dec42e. Self-tests 37 → 41 (all green).
|
v1.2.3 update — notional-aware Source SHA This fixes a real product gap discovered during live testing: a $24 small-account user calling v1.2.3 picks the tighter of two derivations:
Real-world impact at σ_d=1.35% (BTC calm day):
Plus a
|
PR-side updates only — bump plugin.yaml version + source_commit pin, plus document the new fee-aware fields in SKILL.md. Discovered during live $24-account testing on this PR that maker fills on Hyperliquid tier-0 carry a 1.5 bps fee even with `crossed: false` (observed: 0.00016 BTC × $77,822 fill paid $0.001867 USDC). v1.2.4 makes this visible in plan output: - avgRungGapPct - expectedFeePerRoundtripUsd - breakEvenGapPct (= 2 × feeRateMaker) - feeAwareNetEdgePerRoundtripUsd Plus optional MarketMeta.feeRateMaker / feeRateTaker (defaults to HL tier-0: 1.5 / 4.5 bps), and a fee-erosion warning when avgRungGapPct falls within 2× breakEven. Source SHA pinned at 098a21aa. Self-tests 41 → 45 (all green). plan() / quickstart() semantics, planHash, and levels[] byte-identical to v1.2.3.
|
v1.2.4 update — fee-aware plan output, driven by live testing on this PR Source SHA Discovered during live $24-account 4-rung grid testing on this PR that maker fills on Hyperliquid tier-0 carry a 1.5 bps fee even when v1.2.4 makes the fee economics visible in plan output instead of leaving users to guess whether their grid is profitable in absolute USD:
Plus optional Real example from the live $24 grid (gap 0.275%, default maker 1.5 bps):
|
PR-side updates only — bump plugin.yaml version + source_commit pin,
plus document two new user-facing commands in SKILL.md.
These commands respond to natural-language asks the user already makes
("撤掉最下面那个 buy", "网格往上挪", "cancel the $77,608 rung", "tighten
the grid", "follow the price"). Pre-v1.2.5 the user had to manually
orchestrate grid-close → grid-plan → grid-open through three separate
confirmations — error-prone (e.g. cancelling but failing to place new)
and clunky.
- grid-cancel-rung : surgical single-oid cancel via natural-language
reference (lowest / highest / closest-to-mid /
by-price), with disambiguation rules and
explicit ASK when ambiguous. Other rungs stay
intact.
- grid-roll : atomic re-center around current mark. One
confirmation, internally cancels old rungs +
runs grid-quickstart with current price + places
new rungs. Safety rules:
- refuse if existing position would be
liquidated by new range
- refuse if any old rungs fail to cancel
- "roll + flatten" option to also close the
current position before re-deploying
Skill orchestration only — binary unchanged. Source SHA pinned at
41ca8f93. Self-tests 45 (unchanged from v1.2.4). plan() / quickstart()
semantics and planHash byte-identical to v1.2.4 for the same input.
|
v1.2.5 update — Source SHA This is a Skill-orchestration release — no binary changes. Why these matter: users naturally say things like "撤掉最下面那个 buy", "cancel the $77,608 rung", "网格往上挪", "tighten the grid", "follow the price". Pre-v1.2.5 the Skill had no documented flow for these — the user had to manually orchestrate
Self-tests: 45 (unchanged). The decision to keep these as orchestration-only docs (not binary subcommands) is deliberate — the binary stays pure compute, and the agent layer handles user-intent disambiguation where it belongs. This also keeps |
…ptimize fee-aware PR-side updates only — bump plugin.yaml version + source_commit pin, plus document the new fee-aware behavior in SKILL.md. Fixes a real visibility gap discovered during PR-okx#360 testing: the v1.2.2 / v1.2.4 fields (buySide/sellSide notional, fee economics) were computed by the binary but never shown by `explain` — users had to read raw JSON. v1.2.6 makes `explain` render them in human form (Notional split + Fee economics sections). Also makes runBacktest/runOptimize fee-aware: - BacktestResult adds feesPaidUsd + realizedPnlNetUsd - Each simulated fill is charged maker fee (default 1.5 bps HL tier-0, overridable via marketMeta.feeRateMaker) - Optimize.score now uses NET PnL, not gross — prevents tight fee-eroding grids from gaming the ranking Backwards compat preserved: realizedPnlUsd unchanged (gross), score formula change is transparent to callers reading realizedPnlNetUsd. plan() / quickstart() / planHash byte-identical to v1.2.5. Source SHA pinned at c45a8ef3. Self-tests 45 → 49.
|
v1.2.6 update — Source SHA Fixes a visibility gap discovered while monitoring the live $24-account grid on this PR: the v1.2.2 buy/sell aggregates and v1.2.4 fee-economics fields were computed by the binary but
Real impact on a 75-combo BTC sweep:
Backwards compat preserved: |
Plugin Store DApp Popularity Contest
About the ContestPlugin Store is the decentralized agent plugin marketplace on Onchain OS. This contest focuses on two trading-related Basic Skills in Plugin Store — the Polymarket Plugin and the Hyperliquid Plugin — and encourages developers to build more high-quality strategy Skills around them. Contest Rules
Scoring Rules
Four Steps to Participate
Three Leaderboards · 5,900 USDC each · 17,700 USDC in totalTrading Volume | Number of Trades | Unique Trading Addresses
A single Skill can win on multiple leaderboards. All prizes are paid in USDC.
|
[new-plugin] hyperliquid-aigrid v1.2.0
Season 1 Developer Challenge submission — strategy plugin for Hyperliquid perps.
This PR replaces #344 (which was titled
liqgrid— renamed for clearer brand association with Hyperliquid).Summary
hyperliquid-aigridturns a trader's one-sentence Hyperliquid view into a deterministic, risk-capped grid strategy:What makes it different (vs other Hyperliquid grid Skills)
planHashSHA-256 fingerprint.hyperliquid-aigrid optimize) — sweeps 5 widths × 5 leverages × 3 profiles, Calmar-ranked.hyperliquid-aigrid backtest) — deterministic candle-by-candle simulation. Realized PnL / max DD / Sharpe before live trading.hyperliquid-aigrid quickstart) — given coin + notional + candles, binary picks(rangeLow, rangeHigh, leverage, profile)from recent vol regime.Safety posture (advanced risk)
src/types.ts:CAPS)hyperliquid-plugin--strategy-id hyperliquid-aigridfor leaderboard attributionSource
dddd86971-cloud/hyperliquid-aigridaed9868e8950ecb6b49c852bc75e92fd150ecd6dbun install -g)Pre-submission checklist
plugin.yaml,.claude-plugin/plugin.json,SKILL.md,SUMMARY.md,LICENSEall presentname=hyperliquid-aigrid(lowercase, 18 chars, within 2-40)version=1.2.0consistent across all three filesauthor.github=dddd86971-cloudmatches PR authorlicense= MIT (valid SPDX)category=strategy(per the strategy-plugin spec)dependent_plugin= [hyperliquid-plugin@^0.3.9]risk_level=advanced,supported_venues= [hyperliquid]description= 195 chars (within 200)api_calls=["https://api.hyperliquid.xyz"](read-only info endpoint for funding + candles)--strategy-id hyperliquid-aigridskills/hyperliquid-aigrid/#!/usr/bin/env nodeshebang ondist/index.js)🤖 Generated with Claude Code