TypeScript project for mirroring spot flow on STON.fi / DeDust and perpetual flow on Storm Trade (TON). This repo wires official SDKs, wallet sends, and sizing helpers; you still need a TradeSource (TonAPI, indexer, or mempool watcher) to detect a leader wallet and emit CopySignal objects.
npm install
cp .env.example .env
# edit .env — never commit real mnemonics
npm run validate-confignpm run dev -- validate-config
npm run build && npm start -- validate-config| Variable | Purpose |
|---|---|
WALLET_MNEMONIC |
Required — space-separated BIP39 phrase for the follower wallet |
TON_NETWORK |
mainnet (default) or testnet |
TON_ENDPOINT |
Toncenter JSON-RPC URL |
TONCENTER_API_KEY |
Optional Toncenter API key |
COPY_SCALE |
Multiplier vs leader size (default 1) |
MAX_NOTIONAL_NANOTON |
Cap on native TON offer (spots) and TON collateral (Storm), in nanotons |
STORM_ORACLE_URL / STORM_API_URL |
Storm Trade endpoints (defaults for mainnet/stage) |
STON_NATIVE_MASTER |
STON API native TON master override |
DeDust swaps in this scaffold use the mainnet factory (MAINNET_FACTORY_ADDR). Use TON_NETWORK=mainnet for that path.
src/dex/types.ts—SpotSwapIntent,StormPerpIntentsrc/dex/ston-swap.ts— STON simulation API + router messagessrc/dex/dedust-swap.ts— volatile pool swap (native or jetton in)src/dex/storm-perp.ts—StormTradingSdk.createMarketOpenOrder+ wallet sendsrc/copy-trading/scaling.ts—COPY_SCALE+ TON capsrc/copy-trading/engine.ts—CopyTradingEngine.executeRawsrc/copy-trading/source.ts—TradeSourceinterface to implement
MIT