Polymarket Liquidity Pool Farming Bot
Polymarket LP Farm Bot: User Documentation
1. Overview
The Polymarket LP Farm Bot is an automated trading script designed to provide liquidity (LP) on Polymarket orderbooks. Instead of directional betting, the bot acts as a short-term liquidity provider. It places passive limit orders, monitors the orderbook, and dynamically adjusts or exits its positions based on the configured strategy.
2. Core Behavior & Execution Flow
When the bot is started, it follows a continuous loop:
Market Identification It either connects to a specific market directly or scans for an active market matching predefined asset and timeframe traits
Order Placement It quotes a price and size on one or both sides of the market (Yes/No)
Monitoring & Repositioning The bot watches the orderbook. If its orders fall too far behind or market depth drops below safe levels, it cancels and replaces the orders to maintain its target position
Execution & Exit (Post-Fill) When an order is filled, the bot switches from placing passive liquidity to executing an exit strategy—either quickly escaping the position, working a limit exit, or attempting to capture the spread by merging the opposite side
3. Parameter Configuration Guide
3.1 Market Selection
How the bot knows where to trade.
market_slugThe direct identifier of a market. If provided, the bot bypasses automatic selection and operates only hereassete.g.,btc,eth. Used for auto-selection to find relevant marketsperiode.g.,15,60(in minutes). Defines the duration/expiry window of the marketIf
market_slugis empty, the bot will scan Polymarket for a market matching theassetandperiodand automatically deploy there.---
3.2 Strategy & Positioning
How the bot decides where to place its orders.
sidebuy: Provides liquidity on the first outcomesell: Provides liquidity on the second outcomeall: Engages in dual-sided market making (quoting both Yes and No)
target_price_moderank: The bot targets a specific position in the orderbook queue (e.g.,1for the front of the queue,2for the second best price)cents: The bot stays a fixed dollar amount away from the best price (e.g.,2cents behind the top bid)
target_price_valueThe numerical input for the chosen modeThe bot will constantly attempt to maintain this specific pricing requirement. If the market moves away, the bot will pull its old order and place a new one at the new target level.
---
3.3 Sizing and Safety Limits
How the bot protects capital and manages trade size.
order_size_modeshares: The bot bids for a fixed amount of contract sharesusd: The bot places dollar-denominated orders, adjusting the share amount based on the current price
order_size_valueThe numerical size valuemin_orderbook_size_modeDefines a required liquidity threshold in the market before the bot will participate (modes:none,shares,usd)min_orderbook_size_valueThe minimum required liquidityIf
min_orderbook_sizeis not met, the bot considers the market temporarily unsafe/too thin, cancels any active LP orders at that level, and waits until the depth thickens up.refresh_interval_secForces the bot to restart its order process afterXseconds, adding activity and preventing stale orders
3.4 Post-Fill Execution (Exit Strategy)
How the bot behaves after someone takes its liquidity.
exit_modelimit: The bot attempts a controlled exit by placing a limit order at an advantageous price, working the book until closedmarket: The bot rushes to close the position immediately at the best available market pricemerge: For dual-sided strategies. Instead of closing, the bot completes the market by buying the opposite outcome side, thus guaranteeing the spread without directional risk
exit_target_price_mode&exit_target_price_valueFunction identical to the entry pricing parameters, determining the strict price target when the bot places a limit exit
3.5 System (in development)
dry_runSet tolivefor real capital deployment, ordry_runfor simulated actions allowing you to observe bot logs without financial risk
Last updated