feat(agents): HIP-3 MM strategies + new Delta-Neutral Funding Agent - #165
Merged
Conversation
fengtality
force-pushed
the
feat/mm-expert-hip3-examples
branch
from
July 24, 2026 21:05
03d3210 to
1ff6caf
Compare
Contributor
|
Commit 20936d8
Scans HIP-3 markets, checks volume/spread/drift/depth, outputs top pick.
Pair Backtest (hip3_pairs_backtest) - Validate pair stat-arb profitability and market neutrality on historical data.
Live Pair & Delta Monitor (hip3_dn_pair_monitor) - Check live funding rates, OLS hedge beta, and actual position delta balance.
|
Three HIP-3 (xyz-issuer perps on hyperliquid_perpetual) examples for the market_making_expert agent: - hip_3_delta_neutral_funding_mm: delta-neutral MM + funding harvest on a correlated pair (default CL/BRENTOIL). Two pmm_mister controllers in one bot, beta-weighted long/short so net market delta ~0, leaned to the funding-favorable side. The hip3_dn_pair_monitor routine is the analysis brain: it fetches live positions and reports the ACTUAL net factor delta (in-band / breach) each tick, plus a tightened ±$20 band. - hip_3_mm_operator: HIP-3 volume-farming MM operator. - routines: hip3_dn_pair_monitor, hip3_market_scanner, hip3_pairs_backtest. Strategy config carries a stable bot_name for the shared bot. Correct executor + P&L attribution for these bot-mode agents across the dashboard and the agent's core-data view is handled by the framework (PR #166), kept separate from these strategy files. .gitignore: agent runtime artifacts (learnings.md, sessions/). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T9Vygff6wPFpmZb5gahuW4
…d funding hysteresis Rewrite the HIP-3 delta-neutral MM strategy so neutrality is INDUCED through the market-making itself — throttle the over-accumulated leg / accelerate the laggard via each pmm_mister controller's spreads, *_amounts_pct, take_profit and target/min/max_base_pct — and NEVER via market/hedge orders. The routine's HEDGE recommendation is now read as REBALANCE (re-tune, don't hedge). Add funding hysteresis: gate every A/B orientation flip on the other config's carry beating the current by >= flip_margin_pct_yr (default 15%/yr), damping the dual-paying-compression flip oscillation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T9Vygff6wPFpmZb5gahuW4
The trading connector builds its symbol map by uppercasing the exchange symbol, so a lowercase pair (xyz:SPCX-USD) KeyErrors at trade time and a deployed bot silently stops without placing an order. The price/candle endpoints normalize case and give a false 'case-insensitive' signal. Belongs with the HIP-3 market-making strategy, not the LP agent PR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T9Vygff6wPFpmZb5gahuW4
Every HIP-3 market enforces a per-order minimum notional (XYZ:CL-USD = $10). The multi-level default split each leg into sub-minimum orders, so on a small account orders intermittently failed with "lower than minimum notional size" after base-lot quantization rounded them down. Size for one spread level per side with portfolio_allocation 0.5 so each order clears the floor with margin, and hold the leg with an alert when even a single order can't reach the market minimum rather than spamming failed orders. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The HIP-3 delta-neutral funding MM is a distinct domain (funding-carry pair trading, not spread/inventory market making), so it moves out of market_making_expert into a new Delta-Neutral Funding Agent (agents/delta_neutral_funding_agent) with its own AGENT.md identity. Moved with it: the hip_3_delta_neutral_funding_mm strategy playbook and its two routines (hip3_dn_pair_monitor, hip3_pairs_backtest). hip3_market_scanner stays with market_making_expert — it belongs to the hip_3_mm_operator strategy. The strategy_id in the playbook's routine call is updated to the new agent slug; routine discovery and resolution are directory-based, so the bare routine names keep working under the new agent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fengtality
force-pushed
the
feat/mm-expert-hip3-examples
branch
from
July 30, 2026 23:00
20936d8 to
a335c86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds HIP-3 (xyz-issuer perps on
hyperliquid_perpetual) trading content: a new Delta-Neutral Funding Agent and an mm-operator strategy for the existingmarket_making_expert. Strategy files only — the framework-side executor + P&L attribution for these bot-mode agents is a separate PR (#166).New agent:
delta_neutral_funding_agentDelta-neutral funding is a distinct domain (funding-carry pair trading, not spread/inventory MM), so it lives in its own agent rather than under
market_making_expert:AGENT.md— identity, consult triggers, and the always-on HIP-3 domain rules (UPPERCASEXYZ:prefix, unified collateral, per-order min-notional, fee reality).hip_3_delta_neutral_funding_mmstrategy — delta-neutral MM + funding harvest on a correlated pair (default CL/BRENTOIL, corr 0.98, β 1.02). Twopmm_mistercontrollers in one bot, beta-weighted long/short so net market delta ≈ 0, leaned to the funding-favorable side so both legs pay. Neutrality is INDUCED by re-tuning the controllers — never market-hedged. Funding hysteresis gates A/B flips; per-order min-notional floor enforced in sizing.hip3_dn_pair_monitorroutine — per-tick analysis brain: live beta + drift, correlation gate, per-leg funding + net carry, and the actual net factor delta (IN-BAND / BREACH) from live positions.hip3_pairs_backtestroutine — correlation / pair validation at launch.market_making_expertadditionship_3_mm_operatorstrategy — HIP-3 volume-farming MM operator.hip3_market_scannerroutine — HIP-3 pair discovery/ranking used by the operator.Skill
hyperliquid_tokenized_perps— warns the HIP-3 issuer prefix is case-sensitive (lowercase → connector KeyError → 0 orders).Scope
positions_summary, count-once rollup) moved to fix(perf): correct executor + P&L attribution for bot-mode agents #166.🤖 Generated with Claude Code