LP Ranger Help and User Manual
Getting Started & How to Use
- First, read the README’s Overview section, and then, read the README’s Usage section.
- You must read and understand the Disclaimer and the Disclosure linked at the Disclaimer, before proceeding.
- If you are running on a Raspberry Pi 5 or similar device that defaults to a very low-resolution on the screen, consider setting the “Zoom” on your web browser to about 80%, to ease use of the app.
- On first load of the app, wait for the initial synchronization of the app with the blockchain data to complete. This initial sync handles the default selected liquidity position, if any. It will be repeated for each brand-new liquidity pool that you have a position on. This is a read-only operation but can take a while. Don’t worry though: The results are cached so that, normally, you won’t have to wait again. While with a valid Moralis API key that is not at its quota limit, it will be fastest, this one-time process can take up to two hours to complete. Watch for the Sync Status badge near top-right on the app to read “Synced”. At that time, the blur on the app details section will clear.
- Next, consider which Liquidity Positions you want to manage, by clicking on the “Positions” button near center top on the app if in three column-view, or at the left if in single-column view. Alternatively, you can just manage the currently-loaded position. Before clicking the “Manage” button on any position, check that all settings on the app are appropriate for the gas cost on the blockchain you are using, and for the level of slippage that you will require.
- First, check the amount on the “Threshold” setting for Auto-compound. If gas costs are high, you will want this number to be large enough that gas costs are a small fraction of it. Next, scroll down to ensure that the settings under “Bot Configuration” are to your liking. For example, be sure to set a slippage percent that is appropriate for that pair (otherwise, the swaps to rebalance your LP position will fail due to insufficient slippage, or will be too costly if you set slippage too high). Also, if your pair requires high slippage, then you will want to control the frequency of rebalancing for that pair. There are several settings for this and the easiest is the per-day limit. For high-slippage, you might want to restrict rebalances to one per day, to control loss from slippage. Carefully read each circle-i tooltip for all the settings so that you understand them all. When you are ready, click the “Manage” button. Each managed position runs its own independent rebalance loop.
- Wait for the “Sync” label near top right to finish (“Synced”). Syncing usually just takes a few minutes, but for a very long chain of liquidity positions in a given pool, it can take longer: Almost never more than 30 minutes, but possibly more. Don’t worry though: The results are cached so that, normally, you won’t have to wait again.
- When the price moves out of the configured range, the bot automatically rebalances by draining the old position and minting a new one centered on the current price. A rebalance lock ensures only one position transacts at a time (same wallet = same nonce).
- Each browser tab shows one position via URL. Open multiple tabs to monitor multiple pools simultaneously. If running on a lighter-weight machine such as a Raspberry Pi 5 or similar, it’s best to keep it to just one open web browser tab.
- Historical rebalance events are scanned up to 5 years back and used to calculate lifetime P&L.
- The $usd value of the total lifetime deposit is automatically detected. In case of a problem with that, a dialog pops up to notify the user of the opportunity to enter it manually instead at top left in the app under “Total Lifetime Deposit”. Manual entries there always override any auto-detected value.
- Wallet Residuals: Residuals are tokens that you intended to put into a liquidity position but that did not fit the chosen price range. They happen in two places: (1) when you first mint the position on the 9mm Pro dApp — the dApp deposits only what the range can accept at the current price and leaves the rest in your wallet on purpose; and (2) when the bot rebalances into a narrow new range and a little is left over. In both cases LP Ranger recognizes these wallet tokens as residuals for that specific pool, tracked separately from the on-chain LP value. On the very next rebalance the residuals are swept into the freshly minted position and, at that point, roll into your lifetime deposit for the pool. If you would rather not wait, click “Rebalance Now”, widen the range by at least one percent in the dialog, and click “OK” — the residuals will be folded in immediately. If multiple positions share a token, the wallet balance is split pro-rata based on each position’s in-range token amount.
Bookmarking Positions
The address bar updates as you switch positions. The URL looks like /pulsechain/<wallet>/<nft-contract>/<tokenId>. Add it to your browser bookmarks (or drag the address bar icon to the bookmarks bar) to jump straight to any position later. Opening a bookmark loads LP Ranger and activates that exact position as soon as the app is ready. Each bookmark is self-contained, so you can keep one per pool or one per NFT and switch between them with a single click. Bookmarks survive app restarts because they only reference on-chain identifiers — nothing in the URL depends on the server’s current managed-positions list.
Fund Tracking
When a position is rebalanced, all collected tokens (principal + earned fees) are recycled into the new position. Any remainder that doesn't fit the new range stays in your wallet and is automatically counted toward your P&L at current market prices, capped to your actual wallet balance. If you withdraw or sell tokens yourself, use Edit Realized Gains to account for them so your P&L stays accurate.
Automatic Residual Cleanup
After every successful rebalance, LP Ranger waits 10 minutes and then checks whether the wallet still holds a meaningful residual share of the position’s tokens. If the residual is still more than 5% of the combined LP + residual value for that pool, the bot fires one additional rebalance to sweep the leftover tokens into the position. This is called an automatic residual cleanup.
When it triggers. A cleanup arms itself only when every one of the following is true:
- At least 10 minutes have elapsed since the last rebalance.
- The residual wallet share exceeds 5% of (LP + residual) for the pool.
- No rebalance is currently in progress, paused, or already requested by you.
- A cleanup has not already been consumed since the last normal rebalance (see “Back-to-back protection” below).
Back-to-back protection. A cleanup may fire at most once per normal rebalance. If the cleanup itself does not reduce the residual below 5% — for example, because liquidity at the edge of the range is too thin — the bot does not keep trying. The cleanup opportunity is reset only when the next out-of-range or manual rebalance succeeds. This prevents the bot from oscillating on pools where a small residual is structurally unavoidable.
All the usual gates still apply. A cleanup still respects the throttle (minimum interval, volatility doubling), the daily rebalance cap, the swap-backoff timer, the paused state, and dry-run mode. The cleanup is simply a reason to ask for a rebalance — every safety rule downstream continues to govern whether and when it actually runs.
What you’ll see. While a cleanup rebalance is in flight, the range banner at the top of the position card turns yellow and flashes, reading “Rebalancing to Reduce Residual Wallet Coin Amount”. The resulting entry in the Activity Log is tagged “(Residual Cleanup)” so you can distinguish it from an out-of-range or manual rebalance at a glance. There is no separate Telegram alert — cleanup rebalances use the same “Rebalance Succeeded / Failed” channels as any other rebalance.
If you don’t want to wait. You can always click Rebalance Now to sweep residuals immediately. In the Rebalance dialog, widen the range by at least one percent and click OK; the leftover tokens will be folded into the fresh position.
Tuning. The 10-minute delay and 5% threshold live in app-config/static-tunables/bot-config-defaults.json under the residualCleanup group (fields delayMs and thresholdPct). These are intentionally not exposed in the Bot Configuration UI — they are cross-cutting defaults that apply to every managed position.
Range Width
The New Range Width % is initially set based on the first liquidity position detected on the wallet. To adjust it, manually create a new LP position with your desired range on 9mm Pro, then reload the app in your browser and select the new position. The bot will adopt its range width going forward.
Volatility Doubling
If 3 rebalances occur within 4× the minimum interval (e.g. 40 minutes when the minimum is 10 min), the bot enters doubling mode. Each subsequent rebalance must wait twice as long as the previous one: 10m → 20m → 40m → 80m, and so on. This prevents rapid-fire rebalancing during high volatility. Doubling mode clears automatically if no rebalance is needed for 4× the current wait, or at the daily midnight UTC reset.
Gas Cost Protection
Before each rebalance, the bot estimates gas cost in USD. If gas would exceed 0.5% of the LP position value, the rebalance is deferred and the bot retries once per hour instead of once per minute. Normal polling resumes automatically once gas drops or a rebalance succeeds. The bot always starts with the normal polling interval.
Closed Positions
When you select a closed position (zero liquidity), the bot will display its data but will not attempt to rebalance it. If you re-open a previously closed position by adding liquidity back to the same NFT on 9mm Pro, the bot treats it as brand new—duration, fees, and P&L all start from the original mint date. Recommendation: instead of re-opening a closed position, mint a fresh LP position on 9mm Pro. This gives you a clean start with accurate tracking and avoids any ambiguity in your P&L history.
Telegram Notifications
LP Ranger can send real-time alerts to your phone via Telegram. You choose which events trigger a notification:
- OOR Timeout Triggered (default ON) — the position has been continuously out of range for longer than the configured timeout, and a rebalance is about to begin.
- Rebalance Succeeded (default OFF) — a rebalance completed successfully and a new NFT was minted.
- Rebalance Failed (default ON) — a rebalance attempt failed (on-chain revert, RPC error, etc.).
- Compound Succeeded (default OFF) — unclaimed fees were successfully compounded back into the position.
- Compound Failed (default ON) — a compound attempt failed.
- Other Error (default ON) — an unexpected error occurred during a poll cycle, including stuck transactions that were auto-cancelled. Does not include server/bot shutdown, which has its own event below.
- Low Gas Balance (default ON) — the wallet’s native token balance (e.g. PLS) has dropped into the amber “top up soon” zone: below the recommended cushion (one worst-case rebalance × 3× safety × number of managed positions) but still above the one-rebalance floor. The alert fires once per low-balance episode and resets when the balance recovers above the recommended threshold, so you won’t be spammed.
- Very Low Gas (default ON) — the wallet’s native token balance has dropped below the one-rebalance floor and the Mission Control gas badge is flashing red. The next rebalance will fail on gas. This alert fires once when the tier drops to critical and resets only when the balance recovers to the “ok” tier.
- Server and Bot Shutdown/Exit (default ON) — the server (which includes the bot) is shutting down, whether via the dashboard,
npm run stop, or a SIGINT/SIGTERM signal. A manual restart may be required.
Setup:
- Open Telegram and message @BotFather. Send
/newbot, follow the prompts, and it will give you a bot token (looks like 123456789:ABCdefGhI...).
- Save the bot token to a safe place. You will need to copy it soon.
- Start a chat with your new bot and send any message (just type something and press Enter).
- In your web browser, go to:
https://api.telegram.org/bot<your-bot-token>/getUpdates (replace <your-bot-token> with the token from Step 2, no brackets).
- In the JSON response, find your chat ID at
result[0].message.chat.id — it is a numeric value near the top of the response, inside the first result entry, under message → chat → id. Copy this number.
- In LP Ranger, open the Telegram setup dialog from the Settings gear menu or from the wallet setup screen.
- Paste your bot token and chat ID, select the events you want, and click Save.
- Click Test to verify — you should receive a test message in Telegram.
Your bot token is encrypted on disk with the same wallet password used for your private key. It is never sent anywhere except the Telegram Bot API.
Troubleshooting
- Check Sync Status: Does the “Sync” status at top right show “Synced”? If not, wait for it. Data and controls may be incomplete until the initial blockchain scan finishes.
- Rebalance Not Completing: If the blockchain is busy, a rebalance could take longer than expected. The progress of a rebalance can be seen on the Activity Log of this app, where the creation of the new NFT will be seen logged as a distinct log item. Also, it can be monitored by viewing the server console log.
- Stuck Transaction Auto-Cancel: If a rebalance transaction does not confirm within 2 minutes, the bot automatically resends it with higher gas (1.5× bump). If the transaction is still stuck after 20 minutes total, the bot cancels it by sending a zero-value self-transfer at the same nonce, freeing the wallet for future transactions. Each phase is reported in this app’s Activity Log and on the server console. These timeouts are configurable via
TX_SPEEDUP_SEC (default 120) and TX_CANCEL_SEC (default 1200) in the .env file.
- Persistent Transaction Problems: If transactions continue to fail or get stuck, try switching to a different RPC endpoint using the RPC URL control toward the bottom of the app under Bot Configuration.
- Price Discovery Failures: If USD price lookups are failing (DexScreener is the default), you can configure alternative price services such as DexTools by setting the appropriate API key in your
.env file. See the detailed documentation in the file-header of server.js for all available pricing options.
- Prices Don’t Look Right: Try adding your Moralis API key (free) so that Moralis can be a data source. Moralis is a remotely-hosted crypto data API that provides token prices, historical block-level pricing, and other on-chain data. It is the most reliable price source for tokens that other free services miss. Click the gear icon (top right) to add your key in Settings.
- Slow Initial Scans: The first blockchain scan fetches historical prices for every rebalance epoch. Adding a Moralis API key (free) makes this much faster by bypassing GeckoTerminal rate limits. Click the gear icon (top right) → Settings.
- Lost Managed Positions or Settings: On every startup the app saves a backup of your configuration to
app-config/.bot-config.backup.json. If your managed positions or settings are lost, copy the backup over the main file: cp app-config/.bot-config.backup.json app-config/.bot-config.json and restart. See the “app-config/” section in the file-header documentation of server.js for the full layout.
- Current or Lifetime Panel Not Populating: If the Current and/or Lifetime panels are missing data or look stale, re-select the position you want to view from the LP Browser. This triggers a fresh fetch and redraw for that position.
- Position Stuck on “Syncing…”: If the sync badge at top right stays on “Syncing…” for longer than expected (typically about 30 minutes, occasionally more on very old pools and under slow external conditions) and appears wedged — no progress in the Activity Log, no new entries in the server console — the position’s initial load can get abandoned by a transient network hiccup — for example, the CSRF token going stale during a Chrome socket-pool saturation on a low-powered host. First try a browser page reload — this tears down the tab’s HTTP sockets and fetches a fresh CSRF token, which is often enough to let the already-running server-side scan report its result. If the badge is still stuck after the reload, click the Settings gear at top right, then click Reload Current Position. This aborts any in-flight server-side scan for this position and restarts its load from scratch with a fresh session token. Safe to click at any time; it only affects the currently-viewed position.
- Turning Sounds Off: LP Ranger plays short audio cues on successful rebalance, successful compound, and when you click “Manage Position.” To silence them, click the Settings gear icon at top right and uncheck Sounds. The choice is saved in your browser and survives restarts. Re-check the box to turn sounds back on. Sounds default to on for a fresh browser profile; the operator-configured default for fresh profiles lives in
app-config/static-tunables/ui-defaults.json (field soundsEnabled) and can be flipped to false to have sounds default off for any user who clears their browser storage or visits for the first time.
- Compounds Missing from Activity Log: Compound events are only recorded in the Activity Log if the app was running at the time the compound took place. Historical compounds that occurred before the app was started are not currently surfaced in the Activity Log (they are still counted in P&L and the “Fees Earned” KPI).
- Native Gas Token Wraps: EVM liquidity pools only accept the wrapped form of the native gas token (for example, $wPLS on PulseChain — the wrapped equivalent of native $PLS). LP Ranger detects each wrap as fresh capital by scanning the wrapped-token contract’s on-chain
Deposit event, which records the exact wrapped amount minted to the wallet. The Deposit event is emitted whether the wrap is a plain wallet action or bundled inside a swap or rebalance, and whether or not the gas fee is netted from the wrap output, so wraps are credited at full precision with no tolerance fudge.
Details
- Gas Costs: All crypto gas costs displayed in this app are computed using the current price of the native gas token (e.g. PLS on PulseChain). This means gas figures always reflect what the gas would cost at today’s price, not the price at the time of the original transaction.
- Historical Prices: Historical token prices (from GeckoTerminal, Moralis, etc) are used in two ways: (1) to show the original value of the total lifetime deposit into an LP position at the time it was created, and (2) to show the original value of the first historical LP position deposit for the purpose of calculating lifetime gain/loss over a five-year lookback on the current wallet.
Edit Initial / Lifetime Deposit
LP Ranger automatically detects the USD value of your initial deposit by looking up historical token prices at the time you minted the position. This auto-detected value appears in the Lifetime panel as the deposit amount. However, historical prices are not always available (especially for newer or low-liquidity tokens), so the app lets you enter the deposit value manually.
How it works:
- If you enter a value and save, your manual entry takes priority over the auto-detected value. The app will never overwrite your manual entry.
- The auto-detected deposit from the blockchain scan runs independently in the background. It does not change your saved value — it only serves as a fallback when no manual value is set.
- To revert to auto-detection, clear the input field (leave it empty) and click Save. This removes your manual override, and the app will use the auto-detected value on the next refresh.
A small info icon next to the deposit value tells you which source is being used: “Manually entered”, “Valued using Historical Price”, or “Valued using Current Price” (when historical prices were unavailable and the current price was used as a fallback).
Checking for Updates
LP Ranger checks GitHub for newer releases every time you open the About dialog. Click the Settings gear icon at top right in the app, then click About.
The About dialog shows the commit hash and commit date of your running copy. If a newer official release is available, a line appears below the commit row reading “Update available: X.Y.Z — Get the update”. The Get the update link opens that release’s GitHub page in a new tab. If the line reads “Up to date”, you are already on the latest release.
To retrieve and install an update:
- Click Get the update in the About dialog, then download the release’s
.tar.gz asset from the GitHub page that opens.
- Stop your running LP Ranger: in the Terminal where it is running, press Ctrl+C, or run
npm run stop from the project directory.
- Extract the new release alongside your existing install (it unpacks into a version-stamped directory such as
lp-ranger-X.Y.Z/), then cd into it and run npm ci followed by npm start. Always use npm ci for production releases so the pinned dependency versions are installed exactly.
- Your wallet, managed positions, and settings live in
app-config/, and any custom server/bot configuration you set up lives in the optional .env file at the project root. Neither is replaced by extracting a new release alongside the old one. If you want to preserve them, copy app-config/ (and .env, if it exists) from your old install into the new one before first start.
If the About dialog does not show an update notice but you believe one is available, confirm you have network access to api.github.com and reload the app.
Supported Liquidity Pool Managers
- 9mm V3 — Concentrated liquidity (Uniswap V3 fork) on PulseChain. LP Ranger manages V3 NFT positions created through the 9mm Pro Liquidity Manager.
Supported Blockchains
- PulseChain — EVM-compatible Layer 1 blockchain (Chain ID 369).