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

# Polymarket Pendulum Bot

## Pendulum

Pendulum is an automated trading bot for [Polymarket](https://polymarket.com) **Sports and Esports** markets. It watches live prices on a binary market and buys whichever outcome becomes cheap, then layers in more positions each time the price swings to the other side — aiming to profit when the market resolves.

{% hint style="info" %}
**Only Sports and Esports markets are supported.**\
The event URL must contain `/sports` or `/esports`.
{% endhint %}

\---

### How It Works

Every sports/esports market has two outcomes (e.g. *Team A Wins* / *Team A Loses*). Their prices always add up to \~100¢. Pendulum follows a simple cycle:

1. **Entry**\
   When one outcome's price falls inside your Entry Range, the bot buys it
2. **Reversal**\
   When the price swings to the other side past your Reversal Threshold, the bot buys that side too
3. **Repeat**\
   This continues up to your Max Reversal limit, accumulating shares on both sides
4. **Exit**\
   When the market resolves, the winning side pays $1.00/share; your profit is the payout minus total cost

***

### Setup

1. Open the Pendulum page and connect your wallet
2. Enter your **Private Key** and **Funder Address** in the Credentials panel
3. Paste a Polymarket Sports or Esports event URL and click **Fetch**
4. Select the sub-market you want to trade
5. Adjust settings (or leave defaults), then click **Start**

***

### Parameters

#### Entry Range

| Field             | Default | Description                                                  |
| ----------------- | ------- | ------------------------------------------------------------ |
| **Entry Min (¢)** | `50`    | Bot only enters if an outcome is priced **at or above** this |
| **Entry Max (¢)** | `65`    | Bot only enters if an outcome is priced **at or below** this |

***

#### Reversal Settings

| Field              | Default | Description                                                                                                                                                                                  |
| ------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Reversal (¢)**   | `10`    | How many cents the opposite outcome must rise past the trigger before the bot buys it. Can be **Fixed** (same value every time) or **Custom** (comma-separated per level, e.g. `10,8,6,5,4`) |
| **Max Reversal**   | `5`     | Maximum number of reversals to execute. After this, the bot holds and waits for resolution                                                                                                   |
| **Skip Reversals** | `0`     | Observe this many reversals without buying before the bot starts placing real orders                                                                                                         |

***

#### Profit & Safety

| Field             | Default | Description                                                                                                                   |
| ----------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **Target ($)**    | `2.00`  | Dollar profit the bot aims for if one side wins. Determines how many shares are bought at each level                          |
| **Scaler**        | `1.2`   | Multiplies the profit target on each deeper reversal (e.g. $2 → $2.40 → $2.88…). Higher = bigger positions on later reversals |
| **Breakeven Rev** | off     | Reversal number at which the bot stops aiming for profit and just tries to recover its total cost                             |
| **MPD (¢)**       | `5`     | Minimum Price Distance — offset added to the trigger price when placing orders, to improve fill rate                          |
| **Safety (¢)**    | off     | If either outcome hits this price, the bot immediately sells everything on both sides. Set to 0 to disable                    |

***

#### Auto-merge

When enabled, after each reversal the bot converts equal quantities of both outcome tokens back into USDC on-chain. Since one UP + one DOWN share is always worth $1.00, this frees up capital between reversals.

***

### Levels Table

Before starting, the **Levels table** shows a preview of every planned position — price, side, shares, cost, and estimated profit at each reversal level. Use it to review your total exposure before committing.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.dextrabot.com/dextrabot/polymarket-bots/polymarket-pendulum-bot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
