Search

Search benchmark pages, protocols, published runs and the docs

Rout

Quickstart

The lifecycle of one sniper through the agents API. Every endpoint, status and error code here is what Rout's own app client sends and handles today.

Before you start

The API base URL is issued with access; this page writes it as $ROUT_API. Requests carry the session cookie from sign-in. The sign-in contract (/auth/*) is not documented here yet.

Source: rout-next/src/lib/api.ts lines 15–26 and 59–66, at rout-automation-ui@61469bf.

Create it (saved disabled)

curl -X POST "$ROUT_API/agents" \
  -H 'content-type: application/json' --cookie "$SESSION" \
  -d '{ "name": "snipe-next-launch", "kind": "sniper", "definition": <definition> }'
# 201 → the roster row, "enabled": false
examples/snipe-next-launch.json
{
  "name": "next-pump-launch",
  "required": {
    "target": "any"
  },
  "order": {
    "quote": "native",
    "amount": {
      "id": "buy",
      "name": "buy",
      "mint": "So11111111111111111111111111111111111111112",
      "pick": {
        "fixed": {
          "raw": 100000000
        }
      }
    },
    "slippage_bps": 1500
  },
  "execution": {
    "tip_lamports": 1000000,
    "nonce": false
  },
  "limits": {
    "quote": "native",
    "max_spend_per_day_raw": 2000000000,
    "max_open_positions": 5,
    "max_open_cost_raw": 500000000,
    "stop_after_loss_raw": 1000000000
  },
  "user_id": "018f3c1e-0000-7000-8000-000000000001",
  "wallets": [
    "018f3c20-0000-7000-8000-000000000001"
  ],
  "wallet_policy": "first",
  "rules": [
    {
      "name": "every-pump-launch",
      "firing": "once",
      "when": {
        "mint_venue_creation": {
          "venues": {
            "one_of": [
              "pump-fun"
            ]
          },
          "seen": "executed",
          "launch": null,
          "window_slots": 10
        }
      }
    }
  ],
  "sells": {
    "proceeds": "native",
    "rules": [
      {
        "name": "initials-at-2x",
        "firing": "once",
        "when": {
          "gain": {
            "at_least_bps": 10000,
            "window_slots": 150
          }
        },
        "sell": {
          "amount": "initials",
          "slippage": {
            "start_bps": 500,
            "max_bps": 2000
          }
        }
      },
      {
        "name": "quarter-at-4x",
        "firing": "once",
        "when": {
          "gain": {
            "at_least_bps": 30000,
            "window_slots": 150
          }
        },
        "sell": {
          "amount": {
            "of_entry_bps": 2500
          },
          "slippage": {
            "start_bps": 500,
            "max_bps": 2000
          }
        }
      },
      {
        "name": "quarter-at-8x",
        "firing": "once",
        "when": {
          "gain": {
            "at_least_bps": 70000,
            "window_slots": 150
          }
        },
        "sell": {
          "amount": {
            "of_entry_bps": 2500
          },
          "slippage": {
            "start_bps": 500,
            "max_bps": 2000
          }
        }
      },
      {
        "name": "stop-loss",
        "firing": "once",
        "when": {
          "loss": {
            "at_least_bps": 4000,
            "window_slots": 150
          }
        },
        "sell": {
          "amount": "all",
          "slippage": {
            "start_bps": 1500,
            "max_bps": 5000
          },
          "tip_lamports": 5000000
        }
      },
      {
        "name": "stale-after-an-hour",
        "firing": "once",
        "when": {
          "held_for": {
            "slots": 9000
          }
        },
        "sell": {
          "amount": "all",
          "slippage": {
            "start_bps": 1000,
            "max_bps": 3000
          }
        }
      }
    ]
  }
}

The definition's name should equal the roster name. Leave user_id out and the API fills in yours.

Enable it

curl -X POST "$ROUT_API/agents/$ID/enable" --cookie "$SESSION"
ResponseMeaningDo
200RunningPoll status
202 ENABLED_NOT_RUNNINGEnabled; the runtime is starting or retrying in the background. Not an error.Show "starting…" and poll status
409 NO_KEYSThe signer refused a wallet. The agent is set back to disabled.Send the user to the wallet's settings
400 UNBUILDABLE / MALFORMED_DEFINITIONThe definition was refused. Set back to disabled.Show the error beside the field its path names

Watch it

curl "$ROUT_API/agents/$ID/status" --cookie "$SESSION"
# 200 → { "id", "name", "concerns": [], "seen": 0, "emitted": 0, "refused": 0, "blocked": 0 }
# 409 NOT_RUNNING → not running here: show "starting", not an error

Status is counters only. It carries no slots or signatures, so it can't serve as benchmark evidence; benchmark runs use the telemetry in Bundle data contracts. Source: rout-next/src/domain/agent.ts:25-33.

Change, stop, delete

CallRule
PUT /agents/{id} with { "definition": … }Only while disabled (409 AGENT_ENABLED). The roster name can't change through PUT.
POST /agents/{id}/disableStops buying. Sells go on.
DELETE /agents/{id}Only while disabled.
GET /agents, GET /agents/{id}The roster, and one row with its definition.

Next: every error code · the full definition.

On this page