> For the complete documentation index, see [llms.txt](https://docs.origami.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.origami.tech/bots/futures-bot.md).

# Create a Futures grid bot

Create a Futures custom bot — margin mode, leverage, Position Mode of the account, Long / Short grids and Reduce-Only.

A Futures custom bot runs the same grid engine as a [Spot grid bot](/bots/spot-bot.md) on a perpetual futures pair. The differences are the futures settings on the bot, and the position side and Reduce-Only flag on each grid. This page covers only those differences; the grid basics are in the Spot page.

## Before you start

* A futures account connected in [Accounts](/accounts.md) with a balance in the **quote asset** of the pair (USDT for `BTC-USDT`). Cross-collateral is not supported: each market is traded only against its own quote asset.
* The account's **Position Mode** set to **One Way** or **Hedge** in [Account settings](/accounts/settings.md). With Position Mode **None** the form shows *This account's position mode is None, so a futures bot can't be created* and a button **Edit Account**.

## Step 1 — Bot settings

1. **Bots → Add Bot → Custom Bots → Select**.
2. Set **Bot Type** to **Futures**.
3. **Bot Name**, **Account** and **Pair** work as for a spot bot. The account list shows only accounts whose exchange supports futures.
4. **Margin Mode** — **Cross** (default) or **Isolated**. Some pairs allow Isolated only; the control is then locked.
5. **Leverage** — from `1` up to the pair's maximum. Default `1`.
6. Click **Continue**, then pick a preset or **Skip**.

![Add Bot form for a Futures bot with Margin Mode and Leverage](https://602593284-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDjboTEEPFNxFhKJ6msZi%2Fuploads%2FmN2DDX4wl1nXs635Tn9y%2Fbots-futures-bot-01.png?alt=media)

{% hint style="warning" %}
Leverage and margin mode are properties of the pair on the exchange account, not of the bot. Saving them here applies them to every futures bot and to manual trading on the same account and pair. The form warns about this with the toast **Leverage settings are shared for this pair on the account**.
{% endhint %}

## Step 2 — Grids on futures

The grids page (`/bots/futures/<id>`) has the same **Arguments** block as on spot, with `execute_price` defaulting to `ticker_futures()` instead of `ticker()`. Two controls are futures-specific.

### Long / Short (Hedge mode)

On a Hedge-mode account every grid has a **Short** / **Long** switch. A **Long** grid opens and closes the long side of the position; a **Short** grid works the short side. Run two grids to trade both sides at once.

The switch is locked while the bot runs and the grid is enabled (tooltip: *You cannot switch between Long and Short positions right now…*). Stop the bot to change it.

On a One-Way account the switch is shown disabled: orders simply increase or decrease the single position.

### Reduce Only (One-Way mode)

On a One-Way account each grid has a **Reduce Only** checkbox. A Reduce-Only grid can only decrease the position — use it for exit grids so they never flip you into the opposite side. Hedge-mode accounts do not show the checkbox; use the Long / Short side instead.

### Position in formulas

Grid formulas can read the current position with `position(...)` and futures market data with `ticker_futures()`, `orderbook_futures()` and `candles_futures()`. See [Grid language](/reference/grid-language.md).

![Grids page of a futures bot: Post Only, Reduce Only and the Short / Long switch above the arguments](https://602593284-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDjboTEEPFNxFhKJ6msZi%2Fuploads%2FztMOrYkWOHDgpFcCHHvJ%2Fbots-futures-bot-02.png?alt=media)

## Step 3 — Run

**Run** as for a spot bot. Positions opened by the bot appear in [Open Positions](/terminal/positions.md); orders in [Active Orders](/terminal/active-orders-and-history.md).

## Simulation on futures

**Simulate** shows the side per level as **Open Long**, **Close Long**, **Open Short** or **Close Short** on Hedge accounts, and **Buy** / **Sell** on One-Way accounts. See [Grid simulation](/bots/simulation.md).

## Troubleshooting

| Symptom                                   | Cause                                                                        | Fix                                                                |
| ----------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Form blocked with *position mode is None* | The exchange account has no Position Mode set                                | **Edit Account** → set **One Way** or **Hedge**                    |
| **Margin Mode** locked on **Isolated**    | The pair supports Isolated only on this exchange                             | Nothing to do                                                      |
| **Long** / **Short** greyed out           | One-Way account                                                              | Use **Reduce Only** for exit grids, or switch the account to Hedge |
| Orders rejected: margin                   | Balance in the quote asset too small for `execute_volume × price / leverage` | Reduce size or add quote asset to the account                      |

## Related

* [Spot grid bot](/bots/spot-bot.md) — arguments, presets, saving
* [Manual orders: Limit and Market](/terminal/manual-orders.md) — leverage and margin from the Terminal
* [Bot lifecycle](/bots/lifecycle.md)
