Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
Decentralized Exchanges (DEX)
Hyperliquid
Lighter
edgeX
Aster
Aevo
Pendle
WOOFi Pro
Uniswap / PancakeSwap
Aerodrome / Velodrome
KyberSwap
1inch
EVM DEX Common Commands
Jupiter
OKX DEX
DEX Strategy Examples
LP Auto-Rebalancing
Gauge Staking Auto-Compound
DEX-CEX Arbitrage
Jupiter Limit Order Grid
DEX DCA
pump.fun Token Sniping Strategy
Prediction Markets
Securities and Futures
On-chain & Custom

Complete, ready-to-run DEX strategies: automatic rebalancing of range liquidity, gauge staking and compounding on Aerodrome and Velodrome, DEX-CEX arbitrage, Jupiter limit order grids, dollar-cost averaging (DCA), and pump.fun token sniping. Each page explains the strategy logic, the exchange objects it needs, its parameters and its risks, and includes the full code.

StrategyWhat it doesExchange objects
LP Auto-RebalanceProvides liquidity in a ±X% range around the current price; when the price leaves the range, withdraws the liquidity and opens a new position at the new price, and collects fees periodically; guardrails cap rebalance frequency, gas and capitalOne of Uniswap, PancakeSwap, Aerodrome, Velodrome
Gauge Staking and CompoundingPicks a pool by reward APR, opens a position and stakes it in the gauge, then periodically sells the rewards for USDC and adds them back to the positionAerodrome or Velodrome
DEX-CEX ArbitrageCompares the DEX quote with the CEX order book price, and places one order on each side when the spread, after fees, gas and a safety margin, reaches the thresholdOne DEX plus one CEX spot exchange
Jupiter Limit Order GridPlaces grid orders above and below the current price using native limit orders, and places a reverse order at the adjacent price level once one fillsJupiter
DEX DCABuys on a schedule: Jupiter uses its native DCA, while on other DEXs the strategy places timed market buys; buys double when the price is below the moving averageAny DEX
pump.fun Sniping StrategyFinds new pump.fun tokens, filters them, buys a fixed amount, and sells on take-profit, stop-loss or timeout (extremely high risk)Jupiter

How to Run
  • Copy the code into a new JavaScript strategy; the parameters are at the top of the code. When creating the robot, add the exchange objects as described on each page, and use a dedicated wallet.
  • Strategies that send transactions default to DRY_RUN = true: they only plan, request quotes and run on-chain simulations (lp.simulate, simulate, trigger.simulate, dca.simulate, and dryRun of pump.buy). Nothing is signed or broadcast, and PnL is tracked on paper positions. A simulation error caused by an insufficient wallet balance is normal.
  • Live trading: once the logs and status bar look right, switch to a dedicated wallet funded with a small amount, set DRY_RUN to false, and adjust parameters such as the gas estimate for the chain you use.
  • Progress such as position IDs, open orders and amount spent is saved in _G, so tracking resumes after the robot restarts.

Risks
  • Impermanent loss: once the price moves away, range liquidity is worth less than simply holding the tokens. Once the price leaves the range, the position holds only one token and stops earning fees.
  • Gas and fees: every position opening, rebalance, claim and swap is an on-chain transaction. Gas on Ethereum mainnet is high, so small-capital strategies rarely pay off there; running on low-fee chains such as Base, Arbitrum, BNB Chain or Solana is recommended.
  • MEV: on-chain swaps can be front-run and hit by sandwich attacks. The wider the slippage tolerance, the larger the maximum loss to a sandwich.
  • Contracts and tokens: contracts such as pools, gauges and the Jupiter escrow vault carry security risk. New tokens may be scams (rug pulls), and their names can be impersonated, so always go by the contract address or mint address.
  • Estimates are not returns: the estimated daily fees and reward APR in the plan are extrapolated from past trades or current emissions. Only use funds you can afford to lose, and test with small amounts first.

For a simplified version of range liquidity ("open position → monitor → withdraw once out of range"), see the complete LP strategy example on the exchange.IO("lp.add") page. For the parameters of each command, see the EVM DEX Common Commands and Jupiter exchange pages.

In this sectionRead the whole section

NameDescription
LP Auto-RebalancingOpens a single-range position within ±RANGE_PCT% of the current price to earn trading fees.
Gauge Staking Auto-CompoundSelects a pool on Aerodrome or Velodrome by reward APR, opens a position, stakes it in the pool's gauge to earn AERO or VELO rewards, then periodically claims t…
DEX-CEX ArbitrageArbitrages the price spread for the same token between an on-chain DEX and a centralized exchange (CEX) spot market.
Jupiter Limit Order GridPlaces several levels of native Jupiter limit orders above and below the current price.
DEX DCABuys the same token at regular intervals to average down the position cost: on Jupiter it uses native DCA, and on other DEXs the strategy places market buys on…
pump.fun Token Sniping StrategyExtremely high risk, for learning and adaptation only: detects newly created tokens on pump.fun, filters them by set conditions, buys a fixed amount on the bond…