Skip to content

feat(agents): rename Smart-Money Flow agent to Derive Options Trader - #202

Closed
fengtality wants to merge 2 commits into
mainfrom
feat/derive-options-trader-agent
Closed

feat(agents): rename Smart-Money Flow agent to Derive Options Trader#202
fengtality wants to merge 2 commits into
mainfrom
feat/derive-options-trader-agent

Conversation

@fengtality

Copy link
Copy Markdown
Contributor

Summary

  • Renames the smart_money_flow agent to derive_options_trader and makes options-market positioning its core identity: the Derive options read (25D risk reversal, put/call OI ratio, IV term structure, net GEX), the options_flow routine, and the Derive public API reference now live at agent level in AGENT.md.
  • Moves the smart-money capital-flow content (cross-market regime + Solana on-chain pulse, "follow the flow" playbook) out of AGENT.md into the strategy renamed smart_money_flow (was derive_flow_trader). That strategy now also runs options_flow every tick and uses the options composite as a confirmation/sizing input (full size on agreement, half size on strong disagreement, tie-breaker when the flow read is ambiguous).
  • Adds the options_flow routine and the options_oracle_operator strategy (pure options positioning).
  • Both strategies default to a 5-minute cadence (frequency_sec: 300) and run on agent_key: claude-acp:sonnet (the smart_money_flow strategy previously ran on the opencode custom endpoint).
  • Skill namespace updated: smart_money_flow:smart_money_playbookderive_options_trader:smart_money_playbook; the playbook now documents the options-confirmation rule.

Runtime state (strategy sessions/, empty learnings.md) is intentionally not committed, consistent with the rest of the repo.

Test plan

  • manage_trading_agent lists the agent under slug derive_options_trader with strategies smart_money_flow and options_oracle_operator
  • manage_skill(action="read", name="derive_options_trader:smart_money_playbook") resolves
  • Dry-run (agent.experiment) a tick of each strategy: both call options_flow; smart_money_flow also calls onchain_flow

🤖 Generated with Claude Code

- Agent identity is now options-first: the Derive options positioning read
  (25D risk reversal, put/call OI, IV term structure, net GEX) is the core
  signal, with the options_flow routine and Derive public API reference
  documented at agent level.
- The smart-money capital-flow content (cross-market regime + Solana
  on-chain pulse) moves out of AGENT.md into a renamed smart_money_flow
  strategy (was derive_flow_trader), which now also reads options_flow
  each tick as a confirmation/sizing input and tie-breaker.
- Add options_flow routine and options_oracle_operator strategy; set both
  strategies to a 5-minute cadence and agent_key claude-acp:sonnet.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown

Greptile Summary

The PR renames Smart-Money Flow to Derive Options Trader and reorganizes its strategies around options positioning.

  • Adds the options_flow routine and pure options-oracle strategy.
  • Moves the capital-flow strategy and playbook into the renamed agent.
  • Updates strategy cadence, model configuration, risk instructions, and partial API-failure handling.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
agents/derive_options_trader/routines/options_flow.py Adds the Derive options composite and now handles missing GEX and per-expiry API failures without corrupting or discarding available signals.
agents/derive_options_trader/strategies/options_oracle_operator/strategy.md Defines the pure options-positioning strategy and consistently limits executor leverage to the configured 2× maximum.
agents/derive_options_trader/strategies/smart_money_flow/strategy.md Rehomes the capital-flow strategy and adds options-based confirmation and sizing.
agents/derive_options_trader/AGENT.md Establishes the renamed agent identity, shared options methodology, strategies, and risk discipline.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Derive Options Trader tick] --> B[Run options_flow]
    B --> C{Strategy}
    C -->|Options Oracle| D[Trade from options composite]
    C -->|Smart Money Flow| E[Run onchain_flow]
    E --> F[Confirm flow with options composite]
    D --> G[Apply sizing and 2x leverage limit]
    F --> G
    G --> H[Create or manage SOL-USDC executor]
Loading

Reviews (2): Last reviewed commit: "Merge origin/main; align with main's ris..." | Re-trigger Greptile

Comment thread agents/derive_options_trader/strategies/options_oracle_operator/strategy.md Outdated
Comment thread agents/derive_options_trader/routines/options_flow.py Outdated
Comment thread agents/derive_options_trader/routines/options_flow.py
Merge resolution: keep the derive_options_trader rename, port main's
smart-money-flow refactor (PR #200) into the renamed files — identity/playbook
split note, max_position_size_quote risk key (main's risk engine does not know
max_total_exposure_quote), total_amount_quote call shape, leftover-position
rule, cheat sheets.

Review fixes (Greptile P1s):
- Leverage: never request 3x — the gate does not clamp leverage; 2x everywhere.
- options_flow: neutral 1.0x GEX amplifier when no liquid expiry (never amplify
  on missing data).
- options_flow: raise_for_status + per-expiry return_exceptions so one failed
  expiry no longer discards the rest; total API failure returns a controlled
  "Derive API unavailable" result, and both strategies document how to react.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@carlito-hummingbot

Copy link
Copy Markdown

Tested this on my server — the agent works as designed. Quick rundown:

  • Agent loads as derive_options_trader with both strategies showing up (smart_money_flow + options_oracle_operator), and the playbook skill resolves under the new name.
  • Dry-ran a tick of each strategy:
    • options_oracle_operator — reads the options market and only acts when the signal is strong enough (LONG/SHORT/HOLD). No forced trades.
    • smart_money_flow — pulls both the capital-flow read and the options read every tick, and uses options as a confirmation: full size when they agree, half size when they strongly disagree, options as tiebreaker when flow is ambiguous.
  • Both strategies correctly held when signals were weak — e.g. one tick showed flow bearish but options neutral, so it sized accordingly. The confirmation logic in the playbook works as documented.

We'll keep testing with real orders and observing the signals and executions as we go.

fengtality added a commit that referenced this pull request Aug 17, 2026
#202 renames the smart_money_flow agent to derive_options_trader and moves both
strategies from the opencode custom endpoint onto claude-acp:sonnet. It was
branched from main before #203 added the GeckoTerminal rate-gate guard, so its
onchain_flow routine trips that test once #203 lands. Folded in here and fixed in
the following commit rather than left to break main after merge.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mt84XBEMVxbbyMG8fDxDKj
fengtality added a commit that referenced this pull request Aug 17, 2026
#202 was branched from main before #203 landed, so its files miss two gates that
#203 adds and that this branch now sits behind:

- `options_flow.py` failed `black --check` and `isort --check`, which #203's CI
  enforces repo-wide. Formatting only.
- `options_flow.py` line 433 wrote a Markdown underscore escape as `\_` inside a
  non-raw string. Python does not recognise `\_`, so it kept the two characters
  but raised SyntaxWarning (an error in a future version). Doubled to `\\_`:
  identical rendered output, no warning.

The GeckoTerminal rate-gate guard needed no fix here. #202 only *renamed*
`onchain_flow.py`; #203 had already rewritten that file to call
`pool_data.gecko_request`, so the merge took the rename with the rate-gated
content and `test_nobody_hand_builds_a_geckoterminal_url` passes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mt84XBEMVxbbyMG8fDxDKj
@fengtality

Copy link
Copy Markdown
Contributor Author

Folded into #204 (feat/lp-close-retry-ownership) and closing this one.

Why it moved rather than merging on its own: this branch was cut from main before #203 landed, and #203 adds two gates it does not satisfy. Both would have gone red on main after merge, while CI here stayed green because the gates don't exist on this base.

  1. GeckoTerminal rate-gate guard. Feat/trade panel dex #203 adds test_nobody_hand_builds_a_geckoterminal_url, which fails any source file containing api.geckoterminal.com. This branch renames onchain_flow.py but carries main's pre-fix body, which sets GECKO = "https://api.geckoterminal.com/api/v2" and opens its own httpx.AsyncClient — bypassing the shared per-IP budget that condor/pool_data.py owns. Simulating the merge reproduced it:

    FAILED tests/test_gecko_throttle.py::test_nobody_hand_builds_a_geckoterminal_url
      bypass the rate gate with a raw URL: ['agents/derive_options_trader/routines/onchain_flow.py']
    

    This one needed no code change in the end — the rename here is byte-identical to main's file, and Feat/trade panel dex #203 had already rewritten it to call pool_data.gecko_request, so the merge took this branch's rename with Feat/trade panel dex #203's rate-gated body.

  2. Formatting gate. Feat/trade panel dex #203 enforces black --check . and isort --check . repo-wide. options_flow.py failed both.

Also fixed while folding in: options_flow.py:433 wrote a Markdown underscore escape as \_ inside a non-raw string. Python doesn't recognise \_, so it kept both characters but raised SyntaxWarning — an error in a future Python. Doubled to \\_, so the rendered output is unchanged.

Everything else carried over unchanged: the derive_options_trader rename, options_flow.py, options_oracle_operator, the smart_money_flow strategy, the skill-namespace move, and both strategies moving from the opencode custom endpoint to claude-acp:sonnet.

Merge order is #203hummingbot/hummingbot-api-client#25 (released) → #204.

@fengtality fengtality closed this Aug 17, 2026
fengtality added a commit that referenced this pull request Aug 18, 2026
- `options_flow.py` failed `black --check` and `isort --check`, which #203's CI
  enforces repo-wide. Formatting only.
- `options_flow.py` line 433 wrote a Markdown underscore escape as `\_` inside a
  non-raw string. Python does not recognise `\_`, so it kept the two characters
  but raised SyntaxWarning (an error in a future version). Doubled to `\\_`:
  identical rendered output, no warning.

The GeckoTerminal rate-gate guard needed no fix here. #202 only *renamed*
`onchain_flow.py`; #203 had already rewritten that file to call
`pool_data.gecko_request`, so the merge took the rename with the rate-gated
content and `test_nobody_hand_builds_a_geckoterminal_url` passes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mt84XBEMVxbbyMG8fDxDKj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants