# Crypto Cross exchange arbitrage trading bot

**URL:** <https://onehack.st/t/crypto-cross-exchange-arbitrage-trading-bot/320744>\
**Category:** Discussion & Solutions\
**Tags:** solved\
**Created:** [April 5, 2026, 7:28am UTC](https://onehack.st/t/crypto-cross-exchange-arbitrage-trading-bot/320744 "2026-04-05T07:28:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmad\_Ahmad\_raza](https://onehack.st/user_avatar/onehack.st/ahmad_ahmad_raza/32/154023_2.png) [@Ahmad\_Ahmad\_raza](https://onehack.st/u/Ahmad_Ahmad_raza)\
**Post date:** [April 5, 2026, 7:28am UTC](https://onehack.st/t/crypto-cross-exchange-arbitrage-trading-bot/320744/1 "2026-04-05T07:28:09Z")

</div>

I want make crypto cross exchange arbitrage trading telegram bot. I don’t know about coding. I use ChatGPT for coding but he give me always rong code logic and tomuch missing my requirement logic in the code. So please if any one know about it help me

---

<div class="post-metadata">

**Author:** ![Hyper\_PX](https://onehack.st/user_avatar/onehack.st/hyper_px/32/170320_2.png) [@Hyper\_PX](https://onehack.st/u/Hyper_PX)\
**Post date:** [April 6, 2026, 4:53am UTC](https://onehack.st/t/crypto-cross-exchange-arbitrage-trading-bot/320744/2 "2026-04-06T04:53:09Z")

</div>

I dont know much about crypto, but recently I am vibe coding. From my experience, I can tell you, ChatGPT is BS for coding, more hallucination. Use claude

---

<div class="post-metadata">

**Author:** ![Dennis\_Gaturu](https://onehack.st/user_avatar/onehack.st/dennis_gaturu/32/23174_2.png) [@Dennis\_Gaturu](https://onehack.st/u/Dennis_Gaturu)\
**Post date:** [April 6, 2026, 9:36am UTC](https://onehack.st/t/crypto-cross-exchange-arbitrage-trading-bot/320744/3 "2026-04-06T09:36:36Z")

</div>

Yes your right Claude is much better at coding and also I tried vibe coding a similar project in python but the spreads usually die faster so I switched to a betting ARB system cross platform generally in day I can get 4-5% if you compound that’s better for me compared to the crypto one and less hustle

---

<div class="post-metadata">

**Author:** ![TheStrength](https://onehack.st/user_avatar/onehack.st/thestrength/32/46753_2.png) [@TheStrength](https://onehack.st/u/TheStrength)\
**Post date:** [April 28, 2026, 4:35pm UTC](https://onehack.st/t/crypto-cross-exchange-arbitrage-trading-bot/320744/4 "2026-04-28T16:35:32Z")

</div>

Hey — sounds like you’re frustrated, not stuck. Big difference. Reading your post carefully:

🔸 You want a crypto cross-exchange arbitrage bot — buy a coin where it’s cheap, sell where it’s pricier, pocket the gap  
🔸 You want the controls in Telegram — start, stop, see how it’s doing, all from your phone  
🔸 You don’t code, so ChatGPT is your pair-programmer, and it keeps producing logic that’s broken or missing pieces

That’s the question you typed. The bigger question hiding underneath: “how does someone like me — non-coder, AI as my pair-programmer — actually get a working crypto bot in 2026?”

That’s a different question with a much friendlier answer. Three things change everything 👇

⚡ The 30-second answer

🟢 Right now (5 min) → stop asking AI to “make a Telegram arbitrage bot.” That phrase guarantees broken code — the job has three separate parts, and ChatGPT crams them into one file  
🟢 This weekend → open [passivbot](https://github.com/enarjord/passivbot) (free, runs on Binance/Bybit/OKX/KuCoin/Hyperliquid). Read the README slowly. Don’t run it yet  
🟢 When you feel ready → fork it, change config lines, run on testnet (fake money mode) for 2 weeks, then go live with $200  
🟢 The unexpected angle → skip cross-exchange spot arb entirely. The retail edge in 2026 is funding-rate arb on a single exchange. No transfers. No racing Jump Trading on speed. Details below 👇

| What’s bugging you | What actually works | Time |
| --- | --- | --- |
| ChatGPT writes wrong code | Switch to [Claude Code](https://claude.com/claude-code) + a `CLAUDE.md` spec file | 1 hour |
| Cross-exchange transfers are slow | Pre-funded balance model | Mindset shift |
| Cross-exchange spot is dead for retail | Pivot to funding-rate arb on ONE exchange | Same effort |
| Building from scratch keeps breaking you | Fork [passivbot](https://github.com/enarjord/passivbot) or [ynhy513](https://github.com/ynhy513/funding-rate-arbitrage) | Weekend |
| Telegram bot keeps failing | Telegram = control panel, NOT the trading engine | Day-1 lesson |

> [@](#):
>
> One thing I’ll vouch for personally: the people I see actually shipping bots aren’t writing better prompts. They’re writing a numbered spec file with exact error codes, then letting Claude Code build module-by-module. There’s [a public 14-session walkthrough](https://dev.to/ji_ai/building-an-ai-trading-bot-with-claude-code-14-sessions-961-tool-calls-4o0n) where the dev got stuck for weeks asking “make trading bot work” — the moment he wrote “detect position mode on startup, store as enum, retry ErrCode 10001 with mode re-detection” the bot built itself.
> 
> Specs over prompts. Once you see this, you can’t unsee it.

─ ─ ─ 🪙 ─ ─ ─

Below are the deep-dives. Open whichever one is bugging you — they’re independent, no need to read in order.

> **🛠 STEP 1 — Stop using ChatGPT for this. Switch to Claude Code.**
>
> ChatGPT works fine for snippets. For a 500-line trading bot with five files that talk to each other, it can’t keep track of what it wrote 20 messages ago.
> 
> Claude Code (Anthropic’s AI in command-line form — it can read and write files in a folder you point it at, like a coworker who actually opens your project) keeps the whole codebase in view across sessions.
> 
> What to do:  
> [olist]  
> [li]Go to [claude.com/claude-code](https://claude.com/claude-code), download[/li]  
> [li]Point it at an empty folder[/li]  
> [li]You’re done with step 1[/li]  
> [/olist]
> 
> ⚠ If you see “command not found” when you try to run it: that just means the install path didn’t get added to your terminal — restart the terminal or follow the install guide’s “verify” section. Bob Ross moment, no panic.

> **📋 STEP 2 — Make a CLAUDE.md spec file (full template inside)**
>
> In your project folder, create a file called `CLAUDE.md`. This is the document Claude reads first every time you start a new session.
> 
> Write your requirements as numbered rules in plain English. Here’s the template — only change the [bracketed] parts:
> 
> ```auto
> # Trading Bot Spec
> 
> ## Goal
> Delta-neutral funding rate arbitrage bot.
> "Delta-neutral" means: I'm long the spot coin AND short the
> same amount on perpetual futures, on the SAME exchange.
> If BTC goes up $1000, my spot wins $1000, my short loses $1000,
> net zero. I don't care about price direction.
> What I DO collect: the funding rate paid every 8 hours.
> 
> ## Exchange
> Use ONE exchange for v1. Pick: [Binance / Bybit / OKX]
> Mode: hedge mode (allows long + short on same coin)
> API permissions: TRADE ONLY. Never enable withdraw permission.
> IP whitelist: [my VPS IP, set this on the exchange dashboard]
> 
> ## Coins to monitor
> Start with: [BTC, ETH, SOL] — only 3, expand later.
> 
> ## When to enter a trade
> 1. Check funding rates every 60 seconds.
> 2. Enter ONLY if funding rate >= 0.02% per 8 hours
> AND has been positive for 3 consecutive 8h periods.
> 3. Position size: max 15% of total capital per coin.
> 4. Total deployment: max 60% of capital. Keep 40% reserve.
> 
> ## When to exit a trade
> 1. Funding rate drops below 0.005% per 8h.
> 2. Emergency: delta exposure exceeds 2% (rebalance immediately).
> 3. Hard stop: total drawdown > 5% — close everything.
> 
> ## Order execution rules (this is where ChatGPT gets it wrong)
> 1. Fire spot-buy AND perp-short SIMULTANEOUSLY.
> Use Python's asyncio.gather(). NEVER sequential.
> 2. Use FOK (Fill-or-Kill) order type if exchange allows it.
> FOK = "fill the whole order at this price right now,
> or cancel — no partial fills."
> 3. If only one leg fills within 2 seconds, close that
> lone leg at market and log as failed_arb.
> 
> ## State files
> - STATUS.md: current positions, last funding collection,
> total PnL, last error. Updated every minute.
> - positions.json: live position state, atomically written.
> - trades.csv: append-only trade log.
> 
> ## Telegram bot (separate process, thin layer)
> Commands the user types in Telegram:
> /start - resume engine
> /stop - pause engine, keep positions open
> /closeall - emergency close everything
> /status - show current positions and PnL
> /pnl - show today/week/total profit-loss
> 
> Alerts to push:
> - position opened
> - position closed
> - one leg failed (urgent)
> - drawdown warning (urgent)
> - API error (urgent)
> 
> ## Tech stack — non-negotiable
> Language: Python 3.11
> Async library: asyncio (NOT threading, NOT multiprocessing)
> Exchange API library: ccxt (one library that talks to 100+ exchanges)
> Telegram: python-telegram-bot
> Config: .env file via python-dotenv
> Storage: SQLite for trades, JSON for live state
> 
> ## Hard rules — never violate
> - Never store API keys in source code, only in .env
> - Never enable API withdraw permission
> - Always paper trade for 2 full weeks before live
> - Day 1 live: deploy max 5% of total capital
> ```
> 
> Save this. Now you’ve done what 95% of people who fail at AI-built bots never do: you wrote down what you actually want.
> 
> ⚠ If Claude asks a clarifying question while reading the spec (“Which exchange specifically? You wrote a list.”): that’s the bot doing its job — narrowing your spec where it’s vague. Answer one at a time.

> **🍴 STEP 3 — Which fork should you pick?**
>
> You don’t write this from scratch. Pick ONE of these. They’re all alive (commits this month):
> 
> 🥇 [enarjord/passivbot](https://github.com/enarjord/passivbot) — most popular, multi-exchange, hedge mode supported, [active 2026 releases](https://github.com/enarjord/passivbot/releases), real backtester. Community config repo: [JohnKearney1/PassivBot-Configurations](https://github.com/JohnKearney1/PassivBot-Configurations) — these are configs other people are running successfully.
> 
> 🥈 [ynhy513/funding-rate-arbitrage](https://github.com/ynhy513/funding-rate-arbitrage) — purpose-built for funding-rate arb, Telegram alerts already wired in, simpler to read. Best fit for your stated goal.
> 
> 🥉 [Ibarakilol/futures-arbitrage-bot](https://github.com/Ibarakilol/futures-arbitrage-bot) — Russian dev’s lighter Telegram bot for futures arbitrage scanning. Good entry point if the others feel heavy.
> 
> What “fork” means: click the green “Fork” button on GitHub → `git clone` your fork to your laptop → now it’s yours to edit. You haven’t touched the original code yet.
> 
> > [@](#):
> >
> > ⛔ Skip Hummingbot for now. Famous, well-marketed — but its cross-exchange strategy has [a documented rate-oracle bug](https://github.com/hummingbot/hummingbot/issues/5068), [config errors as recent as April 2025](https://github.com/hummingbot/hummingbot/issues/7573), and [spot-to-perpetual hedging the community begged for since 2021 still isn’t built](https://github.com/hummingbot/hummingbot/issues/4900). Powerful framework, but the floor is too far below where you’d land.

> **🧮 STEP 4 — The pre-funded balance trick (architecture secret nobody explains)**
>
> Here’s the part nobody tells beginners. ChatGPT didn’t tell you this; YouTube tutorials skip it; SaaS platforms hide it as a “drawback” in their FAQ.
> 
> You don’t move crypto between exchanges in real time. You can’t.
> 
> A Bitcoin transfer takes 10–60 minutes to confirm. A crypto arb opportunity disappears in 200 milliseconds. Those don’t fit. The fix:
> 
> Keep capital on BOTH exchanges before any trade happens.
> 
> > $5K USDT and $5K worth of BTC on Exchange A  
> > Same setup on Exchange B
> 
> When a price gap opens, you sell BTC where it’s pricier (using BTC you already have there) and simultaneously buy BTC where it’s cheaper (using USDT you already have there). Both legs use existing balances. No transfer. No race.
> 
> You only rebalance (move funds across) once a week or month, when one side runs low. That’s a slow planned move during low-volatility hours, not during a trade.
> 
> > [@](#):
> >
> > This is the difference between “transfers” and “balances.”
> > 
> > When you read trading-bot tutorials, “transfers” is the model that doesn’t work for retail. “Pre-funded balances” is the model that does.

> **⚡ STEP 5 — Why your ChatGPT code keeps crashing (the asyncio thing)**
>
> When you spec the trading logic, the literal sequence matters. ChatGPT writes this sequentially by default — which is wrong:
> 
> ```auto
> WRONG (what ChatGPT writes by default):
> 1. buy BTC on Exchange A
> 2. wait for fill confirmation
> 3. sell BTC on Exchange B
> ← spread closed during step 2, second leg fills at a loss
> ```
> 
> ```auto
> RIGHT (what real arb code does):
> 1. fire BOTH orders simultaneously via asyncio.gather()
> 2. await both fills in parallel
> 3. if only one leg fills (partial fill), failover_manager
> closes the lone position immediately
> ```
> 
> The keyword you want in your spec: “FOK” (Fill-or-Kill) orders — exchange-side atomic execution; either both legs fill at the price you wanted, or neither fills.
> 
> Combined with `asyncio.gather()` in Python, this is the technical pattern that separates working arb code from broken arb code.
> 
> [BJF Trading explains it directly](https://bjftradinggroup.com/crypto-arbitrage/): “Both orders fire simultaneously via the bot — not sequentially. Sequential execution risks the gap closing before the second leg fills.”
> 
> Put that exact phrase in your prompt. ✅

> **🤖 STEP 6 — Wire up Telegram LAST (it's a thin layer)**
>
> When the engine is running (paper-trading on testnet for 2 weeks first), THEN add the Telegram bot. About 50 lines of code using the [python-telegram-bot](https://python-telegram-bot.org/) library.
> 
> The pattern: your Telegram bot reads `STATUS.md` and `positions.json`, formats the contents, sends them when you type `/status`. It does NOT make trading decisions. The trading engine does that. The Telegram bot is a notification window with buttons.
> 
> What you’ll see when this works: you type `/status` in Telegram on your phone, bot replies with:
> 
> ```auto
> BTC long: 0.05
> Perp short: 0.05
> Unrealized PnL: +$12.30
> Last funding collection: 4h ago
> ```
> 
> That’s the moment you’ve built a real thing. Feels small. It’s the whole game.

> **🛡 Reality budget — pick your tier honestly**
>
> | Your situation | What to actually do |
> | --- | --- |
> | Under $500 to play with | Stick with [Pionex’s built-in spot-futures arb bot](https://www.pionex.com/). They take 10% of profit, but at this size it’s worth it for the safety rails |
> | $1K–$5K | Fork passivbot or ynhy513, paper trade 2 weeks, deploy live on Binance/Bybit only |
> | $5K+ and patience | Build the full custom thing per CLAUDE.md spec above. Run on a $6/month VPS, deploy 5% on day 1, scale slowly |
> | Bot is losing on testnet after 2 weeks | It WILL lose worse on live. Fix the strategy or pick a different one. Don’t go live hoping testnet was wrong |
> | You want overnight money | Wrong sub. Crypto arb in 2026 is slow, boring, single-digit percent monthly when it works. The “easy money” era ended in 2021 |
> 
> Universal rules for any tier:  
> 🔹 VPS (a $6/month rented computer in a data center, runs 24/7) — don’t run from your laptop, sleeping = bot dies  
> 🔹 API permissions: trade only, NEVER withdraw  
> 🔹 IP-whitelist the VPS on your exchange — Binance, Bybit, OKX all support it  
> 🔹 Paper trade first — every project I linked has a paper-trading or testnet mode. Two weeks minimum  
> 🔹 Drawdown is normal — even good bots see 15–25% during bad market conditions

> **be-creative**
>
> 🎁 The angle you didn’t ask for, but you should know
> 
> If you got this far, here’s the unexpected one: prediction-market arbitrage on Polymarket and Kalshi is currently easier and more profitable for retail than crypto cross-exchange.
> 
> CoinDesk reported in [February 2026](https://www.coindesk.com/markets/2026/02/21/how-ai-is-helping-retail-traders-exploit-prediction-market-glitches-to-make-easy-money) that a fully automated bot generated nearly $150,000 from 8,894 trades exploiting “sum-to-one” arb — when YES + NO contracts on a 5-minute Bitcoin prediction trade at $0.97 combined instead of $1.00, you buy both sides and pocket the 3 cents at settlement.
> 
> The article quotes a key insight:
> 
> > [@](#):
> >
> > “Liquidity is one constraint. Many short-duration prediction contracts remain relatively shallow compared with large crypto derivatives venues. Attempting to deploy significant capital can move prices against the trader.”
> 
> Translation: too small for hedge funds to bother, perfect size for retail.
> 
> The architecture is identical to what you wanted — WebSocket feed, simultaneous orders, Telegram alerts. [QuantVPS has a working architecture write-up](https://www.quantvps.com/blog/automated-trading-polymarket) you can hand to Claude Code as a spec.
> 
> Why this matters for your project: same skill stack, less competition, smaller capital floor, fresher hunting ground. Worth a look once your crypto bot is running.

─ ─ ─ 🪙 ─ ─ ─

You said ChatGPT was “too much missing my requirement logic in the code” — that exact phrase tells me you’re already thinking like a spec author, you just didn’t have the right tool to receive it.

Switch to Claude Code, write the requirements as numbered rules in `CLAUDE.md`, and the gap closes. The fact that you noticed missing logic in AI output already puts you ahead of most people who try this.

[center]One question back, answer in one word:  
Which exchange do you already have an account on with API access — Binance, Bybit, OKX, or none yet?

That single answer tells me which fork to point you to first. 🎯[/center]
