Updated: 2026-09-07 JST
This file contains only reusable trading/workflow rules. It intentionally contains no wallet address, account balances, positions, or private account state.
account_checker.ts in kamibaba/hyperliquid-market-bridge to retrieve live positions/orders and Strategy tracking. Do not use that route for market screening. MicroFn account functions are non-authoritative fallbacks only; do not depend on them for ledger registration or PnL authority.kamibaba/hyperliquid-market-bridge.coverageComplete=true, registryVerified=true, no venue failures, fresh fetchedAt, and active/valid counts.Val: kamibaba/hyperliquid-market-bridge
HTTP file: index.tsx
Bridge version baseline: 1.2.1 (verify current version if behavior changes)
Upstream: deployed read-only Netlify Hyperliquid market service.
No paid third-party liquidation API is required or configured. Use liquidation data only when it is genuinely available at no added cost or is supplied directly by the user; otherwise proceed without it rather than weakening the setup with an uncertain or paid dependency.
No schedules / no automated trading / no wallet data in the market bridge.
Liquidity veto: as of 2026-09-07 the user has explicitly rejected xyz:JPY for actionable trading because practical liquidity is inadequate. Exclude xyz:JPY from trade instructions unless the user explicitly re-enables it after fresh evidence of adequate executable liquidity. More generally, do not infer usable liquidity from mark/oracle proximity or displayed impact spread alone; verify actual L2 depth, executable VWAP, 24h turnover, and observed fill practicality before sizing.
Typical calls:
mode=market&limit=0 — refresh all venues.mode=read&data=market&offset=0&limit=100, then 100/200/300... until hasMore=false — read the same saved snapshot without another upstream collection.mode=read&data=market&symbols=... — shortlisted exact rows/deltas.mode=technical&coins=AAA,BBB — exact symbols; closed 5m/15m/1h/4h bars + L2 book, max 2 symbols.Never assume the universe is a fixed count. Discover venues and active markets dynamically each time.
The authoritative account checker is the Val Town script account_checker.ts in kamibaba/hyperliquid-market-bridge. It is for live position/order verification after reported account changes and handoff boundaries, JST account-wide realized-PnL auditing, and the project-scoped Strategy ledger. Do not use it for broad market screening. The account address is stored in the val environment as HL_ACCOUNT_ADDRESS, not in the public market HTTP file.
The authoritative Strategy ledger is the val-scoped SQLite database in kamibaba/hyperliquid-market-bridge, using tables strategy_oids, strategy_tids, strategy_seeds, and strategy_meta. account_checker.ts returns live positions, openOrders, account-wide targetTracking, Strategy-scoped strategyTracking, and recent perp fills with a tagged flag. targetTracking can include independent discretionary trades. strategyTracking is the project authority and includes only fills whose OID/TID is registered in SQLite plus reconstructed funding while a project position is open.
MicroFn account functions are retained only as non-authoritative recovery/audit fallbacks. On 2026-09-07, all three MicroFn execution routes returned generic Function execution failed even with a one-line diagnostic function, so ledger/PnL operation MUST NOT depend on MicroFn availability.
When the user says an instructed order was placed/modified, immediately run account_checker.ts, identify the actual parent/child OIDs and any newly executed TIDs, and write them with parameterized INSERT OR REPLACE statements through Val Town sqlite_batch. Future fills on registered OIDs are then attributed automatically. For positions carried across a ledger boundary, add one signed row in strategy_seeds at the boundary so subsequent funding can be reconstructed. Independent discretionary orders must never be tagged as project orders.
Val Town Strategy authority starts at 2026-09-07 JST. The 2026-09-06 final strict Strategy Net baseline is fixed at -$2.965045, producing a 2026-09-07 prior carry-in of $202.965045. The carried PUMP short was seeded at the 2026-09-07 00:00 JST boundary. The legacy MicroFn ledger remains untouched for later audit/reconciliation if its execution service recovers.
For usable new-position headroom, first query the user's account abstraction through official Hyperliquid /info and the current spotClearinghouseState. When userAbstraction="unifiedAccount", account_checker.ts automatically computes the Hyperliquid Balances-table USDC Available Balance as USDC total - USDC hold and returns it under headroom.availableBalanceUSDC; this is the primary headroom authority. Do NOT substitute API withdrawable, accountValue, marginSummary.accountValue, or crossMarginSummary.accountValue, because those are different quantities. If the abstraction mode is not unifiedAccount, the required balance fields are unavailable, or a user-visible UI value demonstrably disagrees with the computed value, fall back to the Hyperliquid UI Balances → USDC → Available Balance and investigate the discrepancy before sizing further margin-consuming orders. Always re-run account_checker.ts after any margin-changing event (entry/add fill, position-size change, newly accepted margin-reserving order, leverage/margin adjustment, or other event that changes hold) so the headroom value is refreshed; never reuse a stale prior balance or infer fresh headroom merely by subtracting theoretical notional/leverage. Position sizing must still be limited by structural stop risk rather than by maximum buying power.
The goal is the highest-expectancy portfolio, not preservation of the last favorite symbol. Consider:
Always inspect both Long and Short opportunity sets, but do NOT force a hedge. First assess broad market regime, majors, sector/category/chain rotation and correlation. Independently of any user hint, perform an automatic narrative/theme-discovery pass on every meaningful crypto decision: start from cross-sectional leaders/laggards and short-interval relative performance, cluster symbols by shared tokenomics/chain/sector/catalyst characteristics, then actively verify likely common causes with fresh fundamental/news/flow evidence. Explicitly test themes such as buybacks/burns/value-accrual, unlock/supply overhang, launchpad/memecoin rotation, chain migration/ecosystem rotation, AI/agent, DeFi/RWA, privacy, staking/emissions, and any newly emerging theme suggested by the live leaders; this list is illustrative, not exhaustive. A theme should be promoted when enough leaders/benchmarks show current relative strength plus fresh causal evidence; the trade candidate itself does NOT need to have already accelerated. After a theme is promoted, split the basket into (a) leaders/continuation names and (b) catch-up/laggard candidates. Explicitly compare buying the leader continuation versus buying an unextended laggard that is genuinely exposed to the same catalyst/flow, has no idiosyncratic negative catalyst, retains acceptable 1h/4h structure, has adequate liquidity, and is less crowded on funding/OI. Do not reject a laggard merely because it is flat while leaders are moving; that flatness can be the opportunity. Conversely, never buy a laggard solely because it has not moved—distinguish true catch-up candidates from fundamentally weak non-participants. If the user separately identifies a live theme, treat that as an additional high-priority hypothesis to test, not as the only source of theme discovery. A theme leader that is already extended must not be dismissed solely for being up a lot; evaluate breakout/retest, small-core + pullback-add, and continuation structures so non-fill opportunity cost is modeled. The max-two-symbol technical endpoint is a per-call constraint, not a reason to skip serial detailed checks on additional high-priority theme finalists.
For crypto, explicitly classify the broad regime BEFORE selecting directional trades using at minimum BTC/ETH/SOL/BNB relative strength, 5m/15m/1h/4h trend context, breadth across major Layer-1/DeFi/meme clusters, funding/OI where available, and current macro/flow/fundamental context. A sharp short-term decline in one or two majors must not by itself flip the broad regime to bearish when market breadth and higher-timeframe structure remain risk-on. If most majors/major-alt clusters are positive and higher-timeframe structure is still up, do not build a multi-leg net-short portfolio unless it is explicitly a relative-value/hedged construction with controlled net beta.
For any trade whose thesis is causally derived from another symbol, theme leader, catalyst or flow source, explicitly record that dependency and keep re-checking it while the trade is open or while adds remain pending. The dependent trade's own technical trend is not sufficient to preserve the thesis if the causal driver has materially changed. Example: if PUMP weakness is hypothesized to result from attention/trading-volume rotation toward PONS or other competing launchpad/chain tokens, then those competitors stalling or declining is a mandatory re-check of whether the proposed rotation still exists; it is NOT evidence that their selling mechanically causes PUMP selling. Distinguish competing-flow (potential inverse relationship) hypotheses from shared-beta (positive co-movement) hypotheses. Price co-movement alone does not prove either causal flow. Broad-market risk-on strengthening also requires re-checking a counter-regime short. When the causal driver stops confirming, first cancel pending adds; then reassess whether to reduce/exit the dependent position even if its own 15m/1h/4h trend still points the original way. Never keep adding merely because the dependent symbol remains technically down/up after the original causal impulse has faded.
If Long+Short is used, size by structural-stop risk contribution and correlation/beta, not equal dollar notional. Highly correlated instruments that express the same underlying thesis (for example WTI + Brent, BTC + ETH beta longs, or multiple names driven by the same single catalyst) must be treated as one risk bucket for portfolio risk and daily-capacity stress tests. Do not count their profit capacities as fully independent when applying the single-largest-independent-setup-failure test, and cap aggregate stop/gap risk at the bucket level rather than per symbol.
Directional concentration is not a defect by itself. If the broad market regime and the best independent setups all point the same way, a one-sided portfolio (all LONG or all SHORT) may be optimal. Never add an opposite-direction position merely to create visual balance, reduce net exposure mechanically, or satisfy a hedge quota; in a persistent trend this creates predictable drag and can guarantee that one side loses. Regime-aligned trades use the normal entry standard: in a clearly bullish regime, LONGs do not require a special idiosyncratic catalyst beyond a valid setup; in a clearly bearish regime, SHORTs do not require one. Counter-regime trades require materially stronger independent evidence: e.g. clear relative weakness/strength plus a specific fundamental, flow, supply-demand, catalyst, or structural reason that explains why that asset should diverge from the broad market. Apply this symmetrically: bullish regime -> SHORT needs extra justification; bearish regime -> LONG needs extra justification. Same-direction additions are restricted only when they are duplicative/highly correlated without incremental expectancy or push aggregate structural-stop risk above the chosen risk budget. Portfolio direction must follow regime + expectancy, not forced symmetry.
User clarification on 2026-09-08: the primary failure mode to avoid is NOT simply too many positions, too few positions, or large/small lot size. The decisive quality gate is whether the selected symbol, direction, entry, structural invalidation, take-profit path and combined portfolio are themselves high-expectancy. Diversification, smaller sizing, opposite-direction exposure or more symbols must never be used as a substitute for a weak setup. Every proposed leg must first pass a standalone setup-quality test: current regime fit; verified relative strength/weakness; fresh causal/fundamental/flow support where relevant; entry location that is not merely chasing recent performance; structural SL outside normal noise; realistic TP(s) supported by observed structure or explicitly labeled extension; and net RR/expectancy after fees/slippage. Only then may legs be combined. Portfolio construction must then test whether correlations, shared catalysts and stop/target geometry improve or degrade the joint distribution. A portfolio of individually weak trades is invalid even if nominally diversified.
If one leg's thesis breaks, close/reduce that leg; do not keep a broken long merely because a short hedge exists.
Do not apply stock logic mechanically to crypto. Include:
Funding sign alone is never an entry signal. OI changes alone do not identify directional initiators.
Execution choice is part of expectancy. Compare:
Do not default to one “perfect” limit. Model non-fill opportunity cost.
Use a small Core when momentum/hedge urgency makes waiting costly. Do not chase if already directionally exposed and pullback RR is better.
The default actionable entry must be placeable immediately without requiring the user to watch for a later candle close, reclaim, or other manual confirmation trigger. Prefer resting Limit / ladder / core+ladder orders with hard attached protection. If a setup is only valid after later confirmation, either choose another immediately placeable symbol from the full universe or label it watch-only rather than making it the primary instruction. Do not require continuous screen-watching.
For catalyst-driven crypto that has already made a sharp extension, do not treat the catalyst alone as permission to passively buy a pullback. If lower-timeframe rollover makes a passive Limit a falling-knife entry, choose a different symbol/setup that supports a structurally protected resting order rather than requiring the user to wait for a manual confirmation trigger. A scheduled buyback/reserve purchase with undisclosed size is qualitative support, not a quantitatively guaranteed bid. For scheduled tokenomics events such as unlocks, claims, emissions changes or burns, re-verify the event's current status and timestamp before demoting or replacing an otherwise stronger setup; do not treat a stale "today/upcoming" page state as proof that the event is still ahead. If the event status is genuinely uncertain but the asset remains a regime-aligned leader with strong multi-timeframe structure and positive value-accrual/flow support, manage the uncertainty through smaller Core size, wider structural risk allowance or delayed adds rather than automatically replacing it with a weaker asset. When momentum is strong and passive pullback entries risk non-fill, explicitly compare a small marketable Core + deeper adds against an all-limit ladder.
Before placing a structural stop around a support/resistance level, compare the buffer beyond that level with current 5m/15m ATR, spread, and plausible stop-market slippage. If the invalidation requires a wider stop, reduce size rather than moving the stop inside normal noise. When a first tranche is losing momentum into support, do not automatically add solely because price reaches the planned level. If fast downside momentum makes passive averaging materially worse, cancel/omit the add and choose a different immediately placeable setup rather than requiring the user to wait for a manual confirmation trigger.
User's Hyperliquid UI cannot attach SL/TP while creating a native Scale entry. Therefore:
Fixed-size reduce-only TPs do not auto-resize after position additions. Recalculate after fills. Position TP/SL can manage the remaining position dynamically.
For an unattended multi-entry ladder that belongs to one thesis, do not place any pending re-entry beyond another tranche's hard SL. LONG: every planned buy Entry must remain above the shared structural SL. SHORT: every planned sell Entry must remain below the shared structural SL. Otherwise the sequence can become stop-out followed by automatic re-entry, which is contradictory for a single thesis. If different tranches genuinely use different invalidations, treat and label them as separate independent setups; do not present them as one ladder. Prefer a common structural SL for a single unattended ladder, with size adjusted so the shared stop remains acceptable.
When the user says they are going to sleep, going offline, or otherwise cannot monitor the position, switch to sleep/unattended mode. Default behavior is: cancel all pending entry/add orders and leave only already-open positions with verified hard SL/TP protection. Do not allow a position to increase automatically while the user is asleep merely because a preplanned adverse-price add is reached. An overnight pending entry/add is exceptional and requires explicit justification that (a) the setup remains valid without future discretionary confirmation, (b) worst-case all-fill structural/gap risk is acceptable as one unattended portfolio, (c) correlated risk buckets are already aggregated, and (d) no stale Available Balance is being reused. If those conditions are not proven, no overnight adds.
Hyperliquid TP/SL trigger orders are triggered by Mark Price, not by the last trade / TradingView candle price. Therefore a candle wick can pass through a TP trigger level without the TP firing if Mark Price never crosses the trigger. When the goal is to capture a trade-price touch/wick at a profit target, prefer a resting Reduce-Only Limit (or Reduce-Only Scale exit) rather than a TP trigger order. Keep trigger-market orders for protection when Mark-based activation is desired.
When an intermediate TP executes, cancel stale unfilled add orders if they could rebuild the position after profit taking.
Decision order:
For fixed notional and SL, increasing leverage does not itself increase stop-loss dollars; it changes margin efficiency and liquidation distance.
For existing Isolated positions, increasing the leverage setting may NOT automatically release previously allocated isolated margin. Check/remove isolated margin separately when appropriate.
Choose leverage so liquidation remains safely beyond structural SL after allowing for slippage, gaps, Mark moves and volatility. Do not use unnecessarily low leverage if it only locks capital without lowering the defined risk.
Cross can be efficient for portfolio-level offsets but shares equity risk. Isolated contains idiosyncratic failures. Neither mode changes the requirement for a structural hard stop.
Structural invalidation first. Do not place stops merely “close” to make risk small. Use 4h/1h/15m/5m structure and ATR context; 1m is execution detail, not thesis invalidation.
TPs come from market structure, not the daily dollar goal. Consider resistance/support, prior highs/lows, breakouts, volume/liquidation levels when actually available, and scale-out to reduce near-miss risk.
Size from max loss divided by stop distance. Daily target does not determine notional.
User clarification on 2026-09-07: maintain the minimum Net +$200 daily objective and the existing carry accounting; the objection after the Brent loss was excessive single-name concentration and insufficient full-universe portfolio selection, not permission to abandon the objective or automatically halt the day.
The assistant's post-loss 0.50%/0.75% per-name, 1.50% aggregate, -2% halving and -3% no-new-risk thresholds were NOT user-approved mandates. They are superseded as binding project rules. Do not retroactively enforce them on existing positions or claim that a numerical reduction follows from user consent. There is no newly approved permanent numerical risk cap; proposed risk budgets must be labeled proposals and disclosed in dollars and equity percentages. Do not substitute guaranteed-return claims or unlimited risk for the removed thresholds.
Keep risk-first sizing: structural invalidation and market-appropriate volatility allowance first, explicit per-setup and portfolio risk budget second, quantity third; margin feasibility is a separate check. Compute planned net stop loss including fees and plausible slippage, plus a separately labeled adverse-volatility/gap scenario. ATR multipliers are scenario assumptions, NOT statistical loss bounds, guaranteed protection, or proof of a profitable setup. Report 15m/1h/4h ATR, structural stop distance, scenario distance, size, notional, modeled stop/scenario loss and equity percentage.
For each meaningful portfolio decision, compare Long and Short candidates across the complete current active universe, including viable HIP-3 venues. Compare one-name concentration with multiple independent setups; do not impose a fixed number of symbols or force an opposite-direction trade. Aggregate correlated names and common catalysts as one risk bucket; offsetting notional is not proof of a hedge. Compare all-fill/all-stop, single-largest-setup failure, sector-wide failure, whipsaw across long/short legs, partial/non-fill and funding costs. All-target payoff is not expectancy or a guaranteed daily profit. Explain any shortfall versus both today's base target and the carry-inclusive objective without declaring either objective abandoned.
For adverse-price ladders, evaluate all tranches together before placement. A larger add into deteriorating momentum needs fresh positive justification; otherwise omit/cancel pending adds. Avoid escalating exposure to a recently failed thesis merely to recover its loss. Do not reduce or retain an existing position solely to obey a newly invented percentage: re-evaluate its actual thesis, total portfolio risk and current market structure. Permanent changes to the objective or numerical risk rules require explicit user agreement.
Prefer the user's actual observed fee tier. Known historical observed rates were roughly taker 0.0081% and maker 0.0027%; re-check if needed. Evaluate Net PnL after fees, funding and slippage.
User target: at least Net +$200 per JST day effective 2026-09-06 JST. The prior base target remains $100 for 2026-09-04 and 2026-09-05, but the user explicitly reset carry at the start of 2026-09-06: the 2026-09-06 required target is a clean $200 with no prior carry-in. From 2026-09-06 onward, new shortfalls roll fully into the next day; profit above the required amount clears carry but does not reduce the next day's applicable base target.
$200 is a minimum realized Strategy Net threshold, not the profit-capacity planning ceiling. A set presented as capable of completing the day must include headroom for non-fills, partial fills, fees, funding, slippage and targets that narrowly miss. As a default completion-capacity gate, require prospective net profit capacity of at least max(remaining strategy target × 1.50, remaining strategy target + $50) from the still-open/planned opportunities. In addition, stress-test whether the day can still plausibly reach $200 if the single largest independent setup fails while the others behave as planned. If either the 50% headroom gate or the single-largest-setup-failure test cannot be supported by high-EV setups, label the set as an intermediate cycle and re-screen/redeploy sequentially; never mechanically enlarge risk solely to satisfy the buffer arithmetic.
For audit, Val Town account_checker.ts computes ACCOUNT-WIDE JST 00:00→now strict realized perp Net PnL as sum(closedPnl) - sum(USDC trading fee) + sum(userFunding delta.usdc). It excludes spot fills and does not count unrealized PnL. This is useful for reconciliation but may include the user's independent discretionary trades.
The project's minimum daily goal must use Val Town SQLite-backed strategyTracking, a separate STRATEGY-SCOPED net PnL that includes only fills/funding/fees attributable to registered project OIDs/TIDs plus seeded carried positions. Discretionary trades such as the user's 2026-09-04 SOFTBANK trade must not count toward project performance. Maintain account-wide targetTracking and project-wide strategyTracking separately; never silently substitute one for the other.
From 2026-09-07 JST onward, account_checker.ts + val-scoped SQLite is the authoritative remaining-target transport. Its 2026-09-07 starting carry is $202.965045, derived from the fixed 2026-09-06 final strict Strategy Net baseline -$2.965045. Never distort SL, TP, leverage or position size merely to hit the target, but do check whether planned trades have realistic profit capacity relative to the remaining target. If a proposed order set cannot realistically cover the remaining target, explicitly label it as an intermediate cycle rather than presenting it as a complete daily-target plan.
Before committing to a trade, estimate whether its target is a scalp, 1–6 hour trade, or potentially beyond the current day. Do not rely on a single slow trade if its realistic maximum profit is far below the remaining daily target; continue screening independent high-quality opportunities in parallel, without forcing trades.
For each actionable leg include exact:
Do not leave percentages for the user to convert into actual prices.
Update this canonical file only for persistent rule/process changes, tool/transport changes, or newly learned platform mechanics. Do not persist live positions here; live account state is always re-fetched because stored positions become stale.
The latest account-specific handoff is stored in this val's project-scoped blob storage, not in a public file.
project:hyperliquid:authoritative-handoff:currentreadBlob tool using storage {type:"val", val:"kamibaba/hyperliquid-market-bridge"}.