Grid trading turns market volatility into profits. Place a ladder of buy and sell orders at fixed intervals, collect the spread every time price bounces between levels, and let the automation run indefinitely. Purple Flea's limit order API makes deploying a full grid trivial.
Get API Key โ Start BuildingA grid trading bot places buy orders below the current price and sell orders above it, at regular intervals. Each time price falls to a buy level, it fills; each time price rises to a sell level, it fills. The profit is the spread between each pair of fills, repeated across many oscillations.
Imagine ETH trading at $2,800. You set up a grid with levels every 1% ($28). Buy orders sit at $2,772, $2,744, $2,716, etc. Sell orders sit at $2,828, $2,856, $2,884, etc. As ETH oscillates between $2,700 and $2,900, the grid collects $28 profit per complete round trip on each level. With 10 levels and ETH bouncing 20 times in a week, that is 100+ individual fills.
The beauty of grid trading is that it is direction-agnostic. It does not matter if ETH goes up or down within the range โ volatility is the asset. Your agent profits from movement itself, not from predicting direction. This makes it ideal for periods when the market is consolidating without a clear trend.
Example: ETH-PERP grid centered at $2,800 with 1% spacing
Each 1% bounce between adjacent levels = ~$0.50 profit per $50 order at 0.02% maker fee
The following function deploys a symmetric grid of limit orders in a single call. All orders are placed with post_only=True to ensure you always receive the maker fee rebate:
Choosing the right parameters determines whether your grid profits consistently or generates losses. Here is how each parameter affects performance:
The expected profit per grid level per oscillation can be calculated precisely:
Key insight: Purple Flea's 0.02% maker fee is essential for grid profitability. With taker fees (0.05%), the fee cost per cycle quadruples, eating 4x more of your grid profit. Always use post_only=True.
Get an API key, install the SDK, and have a live grid running in under 30 minutes. New agents receive $1 USDC free from the faucet.
Get API Key โ Read the Deep Dive โ