classic-grid: an eight-venue equal-spacing grid bot in TypeScript
Classic grid bot: Extended / RISEx / Decibel / N1 / Phoenix
At a glance
- What is it?
- A self-hosted TypeScript grid bot that runs the same classic equal-spacing strategy across Extended, RISEx, Decibel, N1, Phoenix, Phoenix2, Nado and PopDEX, with a local dashboard and a dry-run default. The hard part is not the grid math, it is keeping eight different venue APIs honest about fills, margin and PnL.
- Who is it for?
- Adopt classic-grid if you already hold API credentials on one or more of the eight supported venues and you want the grid logic, the re-seed-after-fill rule and the dashboard in one readable TypeScript codebase you control.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 36 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- beibei030/classic-grid338 ★ · +3
| Repository | 2026-09-17 | 2026-11-25 |
|---|---|---|
| beibei030/classic-grid | 335 | 338 |
3 Stars in the last 69 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What classic-grid solves, and for whom
Running a grid on one exchange is a weekend script. Running the same grid on eight is a reconciliation problem. Each venue has its own order semantics, its own fee model, its own notion of what a realized fill is, and its own rate limit. The README frames the project around exactly those frictions: a fill that leaves a hole in the ladder, a restart that wipes the book, official statistics endpoints that grow until Node runs out of heap, and PnL figures that do not mean the same thing from venue to venue.
The intended user is an operator who already trades perps and already has API credentials. The repository is a template, not a service. According to the README, production operation needs one step beyond cloning: cp .env.example .env, fill in your own keys, and leave the rest of the code untouched. There is no hosted control plane, no account, no telemetry. If you want a bot you can read end to end before you point it at margin, this is the shape of it.
The equal-spacing ladder and the fill-replacement rule
The strategy is deliberately plain. Levels are spaced equally around the current price; below spot you place buys, above spot you place sells. When a buy fills, the bot places the adjacent sell one level up. When a sell fills, it places the adjacent buy one level down. The README states the intent as one order per level, which is what prevents the ladder from developing a gap after a fill.
Two guards run at startup. The first checks that the grid spacing exceeds the round-trip fee, so a fill cannot be structurally unprofitable before the position even moves. The second is a margin pre-check. Both are described in the README as startup validations rather than runtime ones, which matters: they gate the initial seed, not every subsequent replacement order.
A skipBand parameter suppresses orders inside a narrow band around the current price. That is a practical concession to venues where the tightest levels would be filled instantly and churn fees. The core lives in src/grid.ts, and the README points there for anyone modifying strategy rather than plumbing.
One executor interface across eight venue adapters
src/venues/ holds one adapter per venue plus a shared types.ts and an index.ts. The README describes a uniform VenueExecutor surface with snapshot and apply as the required methods, and cancelAll and closePosition as optional. That optionality is the honest part of the design: venues differ in what they let you cancel and close atomically, so the interface does not pretend otherwise.
The main loop in src/loop.ts follows snapshot, then plan, then apply. Configuration, anchor selection and environment parsing sit in src/config.ts. Each adapter carries its own dependencies, and package.json shows how far apart they are: @decibeltrade/sdk, @ellipsis-labs/rise, @n1xyz/nord-ts, @nadohq/client, @aptos-labs/ts-sdk, @solana/web3.js and viem all appear as direct dependencies. The README notes that PopDEX is an on-chain CLOB reached through viem signing and a gasless relay broadcast, which is a different execution path from the REST-based venues.
SOFT_RESUME is the recovery mechanism. On restart the bot resumes from a local anchor and tops up only the missing levels instead of cancelling the whole book. Without it, a process restart during a volatile minute would pull every order and re-seed at a worse anchor.
Install and a first dry run
Node.js 20 or newer is required, per both the README badge and the engines field in package.json. Install dependencies first.
npm installThen create your environment file from the template. The README is explicit that .env is never committed and that secrets/ and data/ are excluded by .gitignore.
cp .env.example .envOpen .env and enable only the venues you actually hold credentials for. The VENUES key takes a comma-separated list, and the template ships with all eight enabled.
VENUES=extended,phoenix
DRY_RUN=1
LIVE_CONFIRM=
DASHBOARD_PORT=8088Before placing anything, run one dry pass. The README recommends this step and states that it prints each venue's anchor, level count, spacing, size and risk pre-check without sending orders.
DRY_RUN=1 npm start -- --onceLive trading requires both switches to agree: DRY_RUN=0 and LIVE_CONFIRM=YES. The README gives this as the live command.
DRY_RUN=0 LIVE_CONFIRM=YES npm startThe dashboard listens on http://127.0.0.1:8088/ by default, with /api/snapshot as the machine-readable JSON endpoint. On Windows the README shows the PowerShell equivalent, using Copy-Item and $env:DRY_RUN rather than the bash forms above.
Default parameters are aggressive, and the README says so
The shipped defaults are not conservative. Extended, Decibel, N1, Phoenix, Phoenix2, Nado and PopDEX each default to 80 levels at 30x leverage. RISEx defaults to 46 levels at 25x with a narrower half-band of plus or minus 3 percent, and the README attaches a warning to that row: order sizes run large there, so reduce risk. GRID_MARGIN_FRAC defaults to 0.7, meaning 70 percent of budget is treated as margin.
Half-bands range from plus or minus 3 percent on RISEx to plus or minus 5 percent on Decibel and N1. At 30x, a price move that clears the half-band is a materially different event than it would be at 3x. The README's own disclaimer names liquidation risk directly. Treat the parameter table as a starting point that reflects one operator's configuration, not as a risk-managed default set.
Per-venue overrides exist for the three values that matter most: *_LEVERAGE, *_HALF_BAND and *_EQUITY_USD. Anything you change should be changed there rather than in the shared globals, because the globals apply across every enabled venue at once.
Where classic-grid is the wrong tool
The README's own challenge table is the best evidence of the limits. Venue PnL definitions do not agree: Extended is read from closed-position history, while RISEx and Decibel use fill-level realized values. If you plan to aggregate a single PnL number across venues and act on it, you are comparing figures that were computed differently. The README also notes that position notional differs across venues because the net-position path differs, and that the practical approach is to match full-grid notional first and net level count second.
Rate limits and open-order caps are handled per venue through maxOpenOrders, write frequency, intervals and error deduplication. That is mitigation, not elimination. On a venue with a low cap, an 80-level ladder may simply not fit, and the bot's response is to work within the cap rather than to reshape the strategy.
Restart behavior is a local-anchor design. SOFT_RESUME depends on local state being intact. If you run the process somewhere with an ephemeral filesystem, or you clear the data directory, you lose the anchor and the recovery path degrades to something closer to a full re-seed. The README does not document a rollback procedure for a partially applied plan, so if apply fails midway through a venue's order set, the recovery story is whatever that adapter's next snapshot produces.
How it differs from a general-purpose grid bot
The obvious comparison is a mature multi-exchange grid bot such as Hummingbot or Freqtrade, and the difference is scope rather than quality. Those projects expose a strategy framework, a backtester and a wide connector catalogue, and their grid strategies are one option among many. classic-grid does one thing: equal-spacing grid with fill replacement, across eight named venues, with a local dashboard.
That narrowness buys concreteness. The README documents per-venue quirks that a general framework would abstract away: Decibel's tick and lot alignment before encoding, PopDEX's on-chain CLOB path with viem signing and gasless relay broadcast, N1's PostOnly behavior, and the different PnL sources per venue. A generic connector layer tends to normalize those differences, and normalization is exactly where a grid bot's accounting drifts from the exchange's.
The cost is the inverse. There is no backtester in the repository layout, no paper-trading engine beyond DRY_RUN, and no strategy plugin surface. If you want to test a different grid shape, you edit src/grid.ts.
Licence, maintenance and what an upgrade costs you
The project is MIT licensed, and the LICENSE file sits at the repository root. MIT permits commercial use and modification; the practical implication for a trading bot is that you can fork it, change the strategy and keep the changes private. The README's disclaimer states the software is provided as is and is not investment advice, and it asks users not to paste private keys into issues. That is a repository convention, not a licence term.
On maintenance: the last push to main was on 2026-08-19, and the repository is not archived. The repository has no published GitHub releases, and package.json carries version 0.2.0 while the README describes a working production setup, which suggests changes land on main rather than through tagged releases. Plan to track the branch rather than pin a version.
The upgrade cost is dominated by dependencies, not by the grid code. package.json pins SDKs for Aptos, Decibel, Rise, N1 and Nado alongside Solana web3, viem, Hyperliquid and undici. A breaking change in any one of those affects one adapter. The test script runs a single file, test/grid.test.ts, so adapter behavior is not covered by the repository's own tests. If you run more than one venue, that is the gap to close yourself before upgrading.
Editorial conclusion
Adopt classic-grid if you already hold API credentials on one or more of the eight supported venues and you want the grid logic, the re-seed-after-fill rule and the dashboard in one readable TypeScript codebase you control. Do not adopt it if you expect the repository to hold your keys, your ledger or a hosted service: the README states the open-source template ships without private keys, API keys, Telegram tokens, server addresses or ledger files, and your .env and secrets/ directory stay on your own machine. Before funding anything, run DRY_RUN=1 npm start -- --once and read the printed anchor, level count, spacing, size and risk pre-check for the venue you actually have credentials for; then confirm that venue's tick and lot alignment, because the README lists Decibel tick/lot as a solved problem rather than a uniform guarantee across adapters.
Frequently asked questions
What does classic-grid look like when it runs?
It seeds an equal-spacing ladder around the current price, with buys below spot and sells above, then replaces each fill with the adjacent opposite order. A local dashboard serves a KPI overview, per-venue status, an order-level axis and a PnL calendar at http://127.0.0.1:8088/, with /api/snapshot as JSON.
What is classic-grid used for?
It runs a classic equal-spacing grid strategy on perpetuals across Extended, RISEx, Decibel, N1, Phoenix, Phoenix2, Nado and PopDEX from one TypeScript codebase. The README positions it as an open-source template that ships without private keys, API keys, Telegram tokens, server addresses or ledger files.
What does a classic-grid layout look like in the dashboard?
The dashboard includes a total KPI panel, a today-detail view, per-venue status, a horizontal axis of resting order levels so you can see whether spacing is even, and a calendar PnL view. Official volume, fee and closed-position PnL figures are pulled on a throttle.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/beibei030-classic-grid)Star history chart for your README
[](https://hysenlabs.com/projects/beibei030-classic-grid)Was this useful?