Skip to main content
Glama

TWAP execution

hl_twap_order
Destructive

Accumulate or reduce a position by slicing it into evenly-spaced child orders over a duration (TWAP) to minimize market impact. Use dry-run to preview schedule, then confirm to execute real orders.

Instructions

Accumulate/reduce a position by slicing it into evenly-spaced child orders over a duration (TWAP), minimizing market impact, with the builder code on every child. Dry-run returns the schedule; live schedules it and returns a plan id (poll with hl_execution_status). A live plan keeps the server process alive until every slice has fired; plan state is in-memory, so if the process is killed mid-run the already-submitted slices remain open on the exchange and the remainder is abandoned (logged on shutdown). ⚠️ Executes REAL child orders on your agent wallet when confirm=true & dryRun=false (builder code attached). Dry-run by default. Irreversible; not investment advice. Test on testnet first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYes
sideYes
dryRunNo
slicesNo
confirmNo
totalSizeYes
reduceOnlyNo
durationMinutesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYes
modeYes
sideYes
planIdNo
childrenYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes beyond annotations by describing dry-run schedule, live plan persistence, process death risks, and real order execution conditions. Annotations indicate destructiveHint=true, which is consistent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with warnings and key points. Slightly long but every sentence adds value. Could be tighter but efficient overall.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers the main workflow, risks, and usage modes. Lacks detailed parameter explanations which are critical given 0% schema coverage. Output schema exists but not referenced.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage, but description only mentions parameters in passing (coin, side, totalSize, slices, durationMinutes, dryRun, confirm, reduceOnly). Does not explain reduceOnly or other details meaningfully.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool accumulates/reduces a position via TWAP to minimize market impact. It provides a specific verb-resource pair and distinguishes from siblings like hl_place_order.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explains when to use (slicing to reduce impact), dry-run vs live execution, and includes warnings about irreversible actions and testnet testing. Lacks explicit when-not-to-use compared to alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/johnsmithxy1mmm-sys/HyperliquidMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server