Skip to main content
Glama

Plan a position from assets the wallet holds

plan_ladder
Read-onlyIdempotent

Plans a ladder, a deposit spread over up to 40 narrow one-sided ranges (rungs) of one pool, from assets the wallet already holds, and returns the unsigned transactions. Use when the wallet holds the token, the quote asset, or both; with only ETH or USDG, prefer plan_build, which buys the missing side and builds in one transaction. Not for an order at one price (plan_limit_order). Rungs under the price hold the quote and buy as it falls; rungs over it hold the token and sell as it rises; each earns the pool's swap fee when traded through. Returns: transactions[] (to, data, value in wei, gas), check (simulated, ok, failedStep, reason, ethNeeded, ethHeld), sendWithin, ifItReverts, slippagePct, rungs (the band as laid), fees (0.25% of what goes in; then 5% of the fees earned, 3.5% for a holder of 100,000 LOOM; every cut paid as USDG). Behavior: read-only on our side; nothing is signed or sent. The plan is laid out from the chain at this block and simulated from the owner; send it within check.sendWithin, and plan again rather than resend one that reverted. Costs quota units (agent_quota). Errors: refused with a reason when the band holds no rung, the pool has no money side, the amounts are zero, or the token is flagged.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
poolNoA pool id from ladder_pools. Left out: the token's default pool.
ownerYesThe wallet that signs, sends, and owns the ladder.
rungsNoHow many rungs across the band, 1 to 40; default 40.
shapeNoWhere the band puts the most: spot (even), curve (near the price), bidask (at the edges), hybrid (half spot, half bidask), custom (weights). Default bidask.
splitNoWith one asset only: swap part of it for the other in the same pool and build the whole band, in one transaction.
tokenYesThe token's address.
copyOfNoThe id of a ladder on the current contract this one copies: its owner is paid 0.1% while it stays open in the same pair.
lowPctYesThe band's bottom, in percent from the current price: negative for under it (for example -30).
highPctYesThe band's top, in percent from the current price (for example 40).
newPoolNoFrom plan_open_pool's `then`: a pool being opened in the same plan, so the ladder is laid against its key and opening price. No split in it; both amounts, or one for a one-sided ladder.
weightsNoshape custom only: a relative height per rung, low price to high, any scale; stretched over the rungs built.
referrerNoThe wallet that referred the owner: paid 0.1% of what goes in, out of the opening fee; kept by the contract from the owner's first ladder on.
fullRangeNoOne position across every price instead of a band. Never out of range, earns the least per dollar. Needs both amounts, or one with split: true; lowPct and highPct are ignored.
payWithEthNoFor a pool quoted in WETH: pay in plain ETH, wrapped inside the same transaction, nothing to approve. Default: whenever the wallet holds less WETH than amountQuote.
amountQuoteNoHow much of the quote asset to put in, as a decimal string. Builds the rungs under the price.
amountTokenNoHow much of the token to put in, as a decimal string. Builds the rungs over the price.
slippagePctNoRoom for the price to move before the transaction is mined, in percent. Left out: 2% on a calm pool, more on one that has been moving, at most 10%.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changed
    • addedInput schema / properties / amountQuote / description
      Added value: +"How much of the quote asset to put in, as a decimal string. Builds the rungs under the price."
    • addedInput schema / properties / amountToken / description
      Added value: +"How much of the token to put in, as a decimal string. Builds the rungs over the price."
    • changedInput schema / properties / copyOf / description
      Previous value: -"The id of a ladder on the current contract this one copies: its owner is paid 0.1% while it is open in the same pair."New value: +"The id of a ladder on the current contract this one copies: its owner is paid 0.1% while it stays open in the same pair."
    • changedInput schema / properties / fullRange / description
      Previous value: -"One position across every price instead of a band of rungs. Never out of range and needs no watching; very little of the money sits at the price, so it earns the least per dollar. Needs both amounts, or one amount with split: true. lowPct and highPct are ignored."New value: +"One position across every price instead of a band. Never out of range, earns the least per dollar. Needs both amounts, or one with split: true; lowPct and highPct are ignored."
    • addedInput schema / properties / highPct / description
      Added value: +"The band's top, in percent from the current price (for example 40)."
    • addedInput schema / properties / lowPct / description
      Added value: +"The band's bottom, in percent from the current price: negative for under it (for example -30)."
    • changedInput schema / properties / newPool / description
      Previous value: -"From plan_open_pool's `then`, for a pool being opened in the same plan: the ladder is laid out against its key and opening price. No split in it (it is empty): both amounts, or one for a one-sided ladder."New value: +"From plan_open_pool's `then`: a pool being opened in the same plan, so the ladder is laid against its key and opening price. No split in it; both amounts, or one for a one-sided ladder."
    • addedInput schema / properties / owner / description
      Added value: +"The wallet that signs, sends, and owns the ladder."
    • changedInput schema / properties / payWithEth / description
      Previous value: -"For a pool quoted in WETH: pay in plain ETH, wrapped inside the same transaction, with nothing to approve. Default: whenever the wallet holds less WETH than amountQuote."New value: +"For a pool quoted in WETH: pay in plain ETH, wrapped inside the same transaction, nothing to approve. Default: whenever the wallet holds less WETH than amountQuote."
    • changedInput schema / properties / pool / description
      Previous value: -"A pool from ladder_pools; the default pool when left out"New value: +"A pool id from ladder_pools. Left out: the token's default pool."
    • changedInput schema / properties / referrer / description
      Previous value: -"The wallet that referred the owner: paid 0.1% of what goes in, out of the opening fee, and kept by the contract from the owner's first ladder on."New value: +"The wallet that referred the owner: paid 0.1% of what goes in, out of the opening fee; kept by the contract from the owner's first ladder on."
    • addedInput schema / properties / rungs / description
      Added value: +"How many rungs across the band, 1 to 40; default 40."
    • addedInput schema / properties / shape / description
      Added value: +"Where the band puts the most: spot (even), curve (near the price), bidask (at the edges), hybrid (half spot, half bidask), custom (weights). Default bidask."
    • changedInput schema / properties / slippagePct / description
      Previous value: -"Left out: 2% on a calm pool, more on one whose price has been moving (set from its last fifteen minutes, at most 10%)"New value: +"Room for the price to move before the transaction is mined, in percent. Left out: 2% on a calm pool, more on one that has been moving, at most 10%."
    • changedInput schema / properties / slippagePct / minimum
      Previous value: -0.1New value: +0.01
    • addedInput schema / properties / split / description
      Added value: +"With one asset only: swap part of it for the other in the same pool and build the whole band, in one transaction."
    • addedInput schema / properties / token / description
      Added value: +"The token's address."
    • changedInput schema / properties / weights / description
      Previous value: -"shape custom only: the height of each rung, low price to high, relative (any scale), stretched over the rungs built"New value: +"shape custom only: a relative height per rung, low price to high, any scale; stretched over the rungs built."
  2. Changed2 schema fields changed
    • changedInput schema / properties / weights / description
      Previous value: -"shape custom only: the height of each rung, low price to high, 0 to 1, stretched over the rungs built"New value: +"shape custom only: the height of each rung, low price to high, relative (any scale), stretched over the rungs built"
    • changedInput schema / properties / weights / items / maximum
      Previous value: -1New value: +1000000
  3. Changed2 schema fields changed
    • changedInput schema / properties / shape / enum
      Previous value: -[
      -  "spot",
      -  "curve",
      -  "bidask",
      -  "hybrid"
      -]New value: +[
      +  "spot",
      +  "curve",
      +  "bidask",
      +  "hybrid",
      +  "custom"
      +]
    • addedInput schema / properties / weights
      Added value: +{
      +  "description": "shape custom only: the height of each rung, low price to high, 0 to 1, stretched over the rungs built",
      +  "items": {
      +    "maximum": 1,
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  "maxItems": 40,
      +  "minItems": 1,
      +  "type": "array"
      +}
  4. Changed1 schema field changed
    • addedInput schema / properties / slippagePct / description
      Added value: +"Left out: 2% on a calm pool, more on one whose price has been moving (set from its last fifteen minutes, at most 10%)"
  5. Changed1 schema field changed
    • changedInput schema / properties / shape / enum
      Previous value: -[
      -  "spot",
      -  "curve",
      -  "bidask"
      -]New value: +[
      +  "spot",
      +  "curve",
      +  "bidask",
      +  "hybrid"
      +]
  6. Changed1 schema field changed
    • addedInput schema / properties / newPool
      Added value: +{
      +  "description": "From plan_open_pool's `then`, for a pool being opened in the same plan: the ladder is laid out against its key and opening price. No split in it (it is empty): both amounts, or one for a one-sided ladder.",
      +  "properties": {
      +    "key": {
      +      "properties": {
      +        "currency0": {
      +          "pattern": "^0x[0-9a-fA-F]{40}$",
      +          "type": "string"
      +        },
      +        "currency1": {
      +          "pattern": "^0x[0-9a-fA-F]{40}$",
      +          "type": "string"
      +        },
      +        "fee": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "hooks": {
      +          "pattern": "^0x[0-9a-fA-F]{40}$",
      +          "type": "string"
      +        },
      +        "tickSpacing": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "currency0",
      +        "currency1",
      +        "fee",
      +        "tickSpacing",
      +        "hooks"
      +      ],
      +      "type": "object"
      +    },
      +    "sqrtPriceX96": {
      +      "pattern": "^\\d+$",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "key",
      +    "sqrtPriceX96"
      +  ],
      +  "type": "object"
      +}
  7. Changed2 schema fields changed
    • addedInput schema / properties / copyOf
      Added value: +{
      +  "description": "The id of a ladder on the current contract this one copies: its owner is paid 0.1% while it is open in the same pair.",
      +  "pattern": "^\\d+$",
      +  "type": "string"
      +}
    • addedInput schema / properties / referrer
      Added value: +{
      +  "description": "The wallet that referred the owner: paid 0.1% of what goes in, out of the opening fee, and kept by the contract from the owner's first ladder on.",
      +  "pattern": "^0x[0-9a-fA-F]{40}$",
      +  "type": "string"
      +}
  8. Changed1 schema field changed
    • addedInput schema / properties / fullRange
      Added value: +{
      +  "description": "One position across every price instead of a band of rungs. Never out of range and needs no watching; very little of the money sits at the price, so it earns the least per dollar. Needs both amounts, or one amount with split: true. lowPct and highPct are ignored.",
      +  "type": "boolean"
      +}
  9. Changed1 schema field changed
    • addedInput schema / properties / payWithEth
      Added value: +{
      +  "description": "For a pool quoted in WETH: pay in plain ETH, wrapped inside the same transaction, with nothing to approve. Default: whenever the wallet holds less WETH than amountQuote.",
      +  "type": "boolean"
      +}
  10. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, destructiveHint=false), yet the description adds substantial context beyond them: the simulation result fields, sendWithin expiry, the instruction to re-plan rather than resend a reverted plan, quota cost, and the specific refusal conditions (no rung, no money side, zero amounts, flagged token). The only redundancy is restating that nothing is signed or sent.

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?

Front-loaded with the core action and the sibling routing before the dense Returns/Behavior/Errors blocks. It is long, but nearly every clause carries operative detail (fee split, expiry, refusal reasons); a small amount, such as the read-only restatement, could be trimmed.

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

Completeness5/5

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

For a 17-parameter tool with nested objects and no output schema, the description compensates by enumerating the return payload (transactions[], check, sendWithin, rungs, fees) and the error surface. An agent has enough to invoke and interpret results correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents each parameter; the description nonetheless adds meaning the schema lacks, notably the rung orientation rule (rungs under the price hold the quote and buy as it falls, over hold the token and sell as it rises) and the fee mechanics. It does not restate the individual optional params, so it stays above the baseline without being exhaustive.

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?

States a precise verb+resource ('Plans a ladder, a deposit spread over up to 40 narrow one-sided ranges (rungs) of one pool') with the input source ('assets the wallet already holds') and output form ('unsigned transactions'). It explicitly distinguishes itself from plan_build and plan_limit_order, so an agent can route without opening a schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use ('wallet holds the token, the quote asset, or both'), when-not ('with only ETH or USDG, prefer plan_build'), and a named alternative for a different shape ('Not for an order at one price (plan_limit_order)'). Nothing about tool selection is left to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources