Skip to content

TWAP into a recent mover: guided compound workflow #12216

@premiumjibles

Description

@premiumjibles

Problem

Users want to say "TWAP into the top gainer" or "DCA into a trending token" but the agent doesn't chain market data tools with trade execution. All building blocks exist (getTopGainersLosers, getTrendingTokens, createTwap) but the system prompt says "Each trade type is an independent workflow," discouraging chaining.

tk ticket: sa-wofz

Fix

Add a <compound-intents> section to the system prompt (~20-30 lines) that teaches the LLM to:

  1. Detect compound intent ("TWAP into a top gainer")
  2. Fetch market data first
  3. Present options to user
  4. Confirm parameters
  5. Execute createTwap

Constraint: TWAP only works on Ethereum/Gnosis/Arbitrum (CoW Protocol) — prompt must guide chain availability verification.

Key Files

  • apps/agentic-server/src/routes/chat.ts — system prompt
  • apps/agentic-server/src/tools/twap/createTwap.ts
  • apps/agentic-server/src/tools/getTopGainersLosers.ts
  • apps/agentic-server/src/tools/getTrendingTokens.ts

Acceptance Criteria

  • LLM correctly chains getTopGainersLosers → user selection → createTwap
  • LLM verifies token is on a CoW-supported chain before attempting TWAP
  • Works for both "top gainers" and "trending tokens" data sources

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions