feat(agents): Derive Perp Smart-Money Flow Agent - #178
Open
carlito-hummingbot wants to merge 12 commits into
Open
feat(agents): Derive Perp Smart-Money Flow Agent#178carlito-hummingbot wants to merge 12 commits into
carlito-hummingbot wants to merge 12 commits into
Conversation
Directional perp agent driven by a capital-flow & positioning composite: cross-market risk regime (CoinGecko /global + /coins/markets + /search/trending) plus an on-chain Solana DeFi pulse (GeckoTerminal SOL top pools). The routine produces a LONG/SHORT/HOLD signal; execution is venue-agnostic (Derive, Hyperliquid, Backpack, Pacifica, ...) via default_trading_context + Hummingbot server — the routine never calls an exchange API. - agents/smart_money_flow/AGENT.md: identity, opencode-go:deepseek-v4-flash - routines/onchain_flow.py: keyless signal fetch + scoring + ReportBuilder - strategies/directional_flow/strategy.md: directional perp playbook, risk limits - skills/smart_money_playbook/SKILL.md: flow decision matrix Verified: routine compiles and scores correctly live (RISK-OFF -> HOLD; forced RISK-ON +6.5% -> LONG +0.80; RISK-OFF -9.5% -> SHORT -0.40). Pivoted from Orca Whirlpools spot (CLMM cannot express directional/short).
…alidation runbook - strategy.md default_trading_context now names derive_perpetual as the concrete venue, documents the one-time 'connect derive_perpetual' step (Condor/API does NOT add keys by design), and gates mainnet behind derive_perpetual_testnet. - validation.md: testnet-first runbook proving execution before PR submission (connect once in client; Condor/API drives the connected instance).
…or code Verified against repo: - API keys are added ONLY via web dashboard (Settings -> Keys); Telegram /keys is read-only; MCP API does not add keys. - Condor web filters out testnet connectors (condor/web/routes/settings.py: 'testnet' not in c.lower()), so derive_perpetual_testnet is NOT selectable. Validation must be mainnet derive_perpetual on a tiny isolated wallet. Updated validation.md and strategy.md default_trading_context accordingly.
Cap budget at 50 USDC total: total_amount_quote 50, max_total_exposure_quote 50, max_position_size_quote 20, min_order_amount_quote 10, single position (max_open_executors 1), 2x leverage (~40 USDC notional, under balance). Keep production defaults documented separately. Aligns strategy.md + HOW_IT_WORKS.md.
…-USDC Derive perpetuals are quoted in USDC (trading-rule map + order-book subscription both require '-USDC'), not USDT. Correct default_trading_context pairs and the validation note accordingly.
…t result Restarting hummingbot-api repopulates the derive_perpetual symbol map after a bad-pair attempt (SOL-USDT) poisons it. Golden rules: use SOL/ETH/BTC-USDC on Derive; restart container if create_executor hangs with KeyError. Records the verified LONG SOL-USDC place+close on Derive mainnet (~$0.02 fees).
AGENT.md now states tested on Derive mainnet only (removed other DEXes from description/body). HOW_IT_WORKS.md adds concise LLM-per-tick cost note: deepseek-v4-flash pricing, prompt-cache effect, ~$0.10/day typical at 300s cadence.
…w_trader)
The strategy folder was named 'directional_flow' while the strategy name
'Derive Flow Trader' slugifies to 'derive_flow_trader'. The web GET
/agents/{slug}/strategies/{sslug} resolves by folder name, so the frontend
(open button) passed the slug 'derive_flow_trader' and got 404
'Strategy not found'. Moved strategy.md into the slug-named folder and
removed the stale directional_flow folder. Also tightened the description
to Derive-only (remove Hyperliquid/Backpack/Pacifica per user request).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s in onchain_flow - AGENT.md when_to_consult tightened to Derive perps (drop 'any venue'). - onchain_flow.py: report pair labels SOL/ETH/BTC now show -USDC to match Derive's USDC-quoted perps (signal is venue-independent; the displayed label was stale USDT). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… prevent frontmatter truncation The '# --- ... ---' comment inside default_config ended YAML frontmatter at the first '---', silently dropping risk_limits / sizing / trading_context. The running engine then fell back to unsafe engine defaults. The fix removes the dashes from the comment.
…m for opencode-go model Switches agent_key from 'opencode-go:deepseek-v4-flash' to 'custom@opencode:deepseek-v4-flash' so the agent runs on opencode-go via PR hummingbot#175's named custom OpenAI-compatible endpoint (no PR hummingbot#170 needed). Documents endpoint setup: Settings -> LLM Endpoints, or CUSTOM_LLM_BASE_URL/CUSTOM_LLM_API_KEY in .env for headless condor-bot.service deploys.
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.
Summary
Adds the Smart-Money Flow Condor agent: a directional perpetual-futures
trader that reads cross-market capital-flow + an on-chain Solana DeFi pulse
and takes bounded LONG/SHORT positions on Derive (
derive_perpetual).agents/smart_money_flow/— AGENT.md,strategies/derive_flow_trader/(strategy.md + 50-USDC test-mode config),
routines/onchain_flow.py(CoinGecko + GeckoTerminal keyless signal),
skills/smart_money_playbook/,HOW_IT_WORKS.md, validation.md
flow intensity (vol/mcap, 24h change, trending) + Solana on-chain pulse
else HOLD — no forced trades
(max 20 USDC/position, 2x, 1 position, 50-USDC wallet)
opencode-go:deepseek-v4-flash(cheap; ~$0.10–0.35/day at 300s cadence)Depends on
Requires the opencode-go / deepseek provider from PR #170 (the agent's
agent_keyusesopencode-go:deepseek-v4-flash). This PR is agent-only;provider infra lands separately in #170.
Validation
data, returns HOLD in current RISK-OFF regime (correct — no signal ≥ ±0.4)
Derive execution path works
folder/slug mismatch — both fixed)
Notes
📸 Screenshots attached: Agents tab (Live), strategy detail, onchain_flow report.





