> ## Documentation Index
> Fetch the complete documentation index at: https://docs.route.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# Standing orders

> Limit, DCA and TWAP orders on Robinhood Chain. Tokens stay in the wallet until a fill.

Robinhood Chain, switched on per partner key. For Solana see [Solana orders](https://docs.route.fun/solana/orders-and-agents.md).

The owner signs an order once. Route's keeper fills it through the RouteOrders contract when its terms are met. The contract
enforces the tokens, slice size, minimum rate, interval and expiry on every fill, and output always goes to the order's recipient.
Each fill pays its own gas from the input (at most 3 times the gas cost at signing), unless Route sponsors gas for your key.

| Order | How to express it |
| - | - |
| Limit | `sliceIn` = `totalIn`, with `minRate` at your price |
| DCA, TWAP | `sliceIn` smaller than `totalIn`, with `interval` seconds between fills |

**1. Quote the order**

[`GET /orders/quote`](https://docs.route.fun/api-reference/orders-quote) with `owner`, `in`, `out`, `totalIn`, `minRate` and `expiry` (plus
`sliceIn`, `interval`, `startAt`, `recipient`). Returns the order, `typedData` to sign, the current `marketRate`, and
`permit` (Permit2 typed data, or `null` when the allowance already covers it) and `approval`, as for
[gasless swaps](https://docs.route.fun/execution/gasless.md).

**2. Sign**

The owner signs `typedData`, and `permit.typedData` when present.

**3. Store it**

[`POST /orders`](https://docs.route.fun/api-reference/orders-create) with `{ "order", "signature", "permit": { "message", "signature" }, "erc2612" }`.
Returns the order `hash`.

**4. Track or cancel**

[`GET /orders?owner=`](https://docs.route.fun/api-reference/orders-list) lists orders with their fills. [`DELETE /orders/<hash>`](https://docs.route.fun/api-reference/orders-cancel)
stops Route filling it.

## Rules

* `minRate` is output per input in raw units, scaled by 1e18, over each whole slice, with the gas fee included. Leave room for the
  gas fee when you set it near the market rate, or the keeper will hold the order.
* Each slice must be worth at least 20 gas fees. Expiry is at most 365 days out.
* The Permit2 allowance must cover every live order of the owner for that token; `permit` is sized for that.
* `DELETE` stops Route. A hard cancel is `cancel(hash)` on RouteOrders from the owner, or a Permit2 lockdown.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.