Skip to content

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

01 Copy Bot

Automatically mirror any wallet's positions on 01.xyz in real-time.

Built with the @n1xyz/nord-ts SDK. Supports position open/close/flip/adjust with configurable capital ratio.


Features

  • Real-time sync — subscribes to target wallet via SDK stream
  • Parallel execution — all orders fire simultaneously
  • Position diff engine — open, close, flip, and size-adjust
  • Periodic verify — re-syncs every 5s to catch missed events
  • Precision handling — respects each market's sizeDecimals

Requirements

  • Node.js v25+
  • A funded 01.xyz account
  • Solana wallet private key (base58)

Setup

git clone https://github.com/omgmad/01-copy-bot
cd 01-copy-bot
npm install

Apply the required SDK patch after npm install:

# Find the line (usually ~87412)
grep -n "rawResp\|arrayBuffer" node_modules/@n1xyz/nord-ts/dist/index.common.js | grep "rawResp"

# Apply fix (replace LINE_NUMBER with actual line)
sed -i 'LINE_NUMBERs/.*/  const rawResp = new Uint8Array(await response.response.arrayBuffer());/' \
  node_modules/@n1xyz/nord-ts/dist/index.common.js

Configuration

cp .env.example .env
PRIVATE_KEY=your_base58_private_key
TARGET_WALLET=wallet_address_to_copy
CAPITAL_RATIO=0.01
CLUSTER=mainnet
RPC_URL=https://solana-rpc.publicnode.com

CAPITAL_RATIO

Your capital divided by the target's margin in use.

Example: You have $100, target uses $10,000 margin
CAPITAL_RATIO = 100 / 10000 = 0.01

Run

npm run bot

To run multiple bots (different wallets) simultaneously:

# Terminal 1
screen -S bot1
cd ~/01-copy-bot && npm run bot

# Terminal 2
screen -S bot2
cd ~/01-copy-bot-2 && npm run bot

# Detach: Ctrl+A, D
# Reattach: screen -r bot1

How It Works

Target wallet stream
        │
        ▼
   computeDiff()
  ┌─────┴──────┐
toOpen  toClose  toFlip  toAdjust
  │       │       │        │
  └───────┴───────┴────────┘
          │
    applyDiff() ← parallel execution
          │
    periodicVerify() ← every 5s

File Structure

src/
├── index.ts     entry point
├── engine.ts    copy logic, diff engine
├── client.ts    SDK wrapper, order placement
├── config.ts    env config
├── logger.ts    colored terminal output
└── types.ts     TypeScript interfaces

Notes

  • bigint: Failed to load bindings warning is harmless — pure JS fallback is used
  • Re-apply the SDK patch after every npm install
  • Use the 01 Monitor dashboard to watch live performance

Built by @0mgm4d · Trade on 01.xyz

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages