RSS Amplifier

idea canvas · Mar 4, 2026

#31 Coding an arb strategy with Claude

0
Sign in to vote or save

tzedonn · idea canvas

Back in December, I had the idea to code up a systematic trading bot for a specific arbitrage I have spotted on Polymarket.

I started using Cursor along with Sonnet/Opus but as someone who hasn’t written production code professionally, there is still quite a lot of inertia as you face many system errors and have to repeatedly prompt the AI to fix it (yes, I’m complaining as a privileged post-Claude vibe coder).

One fine day I finally decided to try Claude Code, and everything changed. The biggest difference to me is that Claude Code was able to:

  1. Use your computer via CLI to execute commands, install new packages, create & edit files, manage git, SSH to an AWS instance, etc.

  2. “One-shot” tasks by writing a detailed prompt via Planning mode, troubleshooting system-level issues via CLI, and running unit tests to ensure the output was correct, otherwise it would recursively fix the code

Within two days, I had the first version of my Telegram bot which alerts me if a potential arbitrage has appeared. I would click trade it, as I wanted to make sure the bot is correctly identifying arbs first.

example of the telegram alert

After a week of adding arbitrage strategies and refining the code, I managed to get it to a point where I was confident enough in the reliability of the algo and also my understanding of market microstructure (I was also getting tired of manual click trading). So I gave it $500 to play around with.

It quickly deployed that $500, then I topped it up to $1000, then $3000.. and after topping up for a week, it was managing ~$150k autonomously. The strategy has a ~15-20% APR and a maximum capacity of probably ~$200-250k.

Ideally it would be a y=mx line but the start of the Iran war on the last day of Feb brought about insane volatility which made my algos go a little crazy (only one leg manages to execute), so I had to make quick fixes right before a wedding. This volatile moment ended up being very profitable, even though the algo was lost money at the start of the war.

pnl charts on polymarket can be a bit wonky but this is still somewhat decent looking

Whenever you have a profitable strategy, you should always ask why it exists.

My best guess is that the strategy is slightly hard to code and maxes out at ~$30k/yr in profits1 which is not interesting enough for a quant engineer to do (they get paid >$200k/yr at a fund). But Claude Code lowers that fixed cost to ~$300 in credits2, making the long tail of small arbs suddenly viable (even to the unemployed kek).

This got me thinking a lot about how the trading industry will change with Coding Agents.

As the cost to build and maintain infra decreases, arbs with small capacity become viable, until more participants drive those inefficiencies away too and so the market more efficient.

More broadly, we’re in the early innings of AI reducing headcount in the “implementation layer” across trading (e.g., analysts building dashboards and running backtests). A PM with an army of AI agents can now run a wider ticker universe than a PM with a team of human analysts ever could.

This pushes everyone up the stack. Every software engineer will have to grow into a Product Manager, and every trader/analyst will grow into a Portfolio Manager — managing a team of AI agents doing the grunt work while you make the higher-level decisions.

Anything that can be done to a “good enough” level will eventually be handled by AI agents: translating specs into code, auditing, compliance, paralegal work. But trading and investing is largely a relative, zero-sum arena, so being “good enough” doesn’t make money, only being better than your counterparty makes money.

That’s why I don’t think it’ll be fully automated by AI Agents. Instead of competing on who has the best analysts, you’re competing on who has the best AI agent setup with the most differentiated insight. Because if everyone has that alpha, it’s not alpha.

Three months ago I couldn’t ship a working bot, and now I have a live bot managing a decently profitable strategy. It really feels like a one-person hedge fund doesn’t sound so crazy anymore.

1

~$200k capacity x ~15% APR = ~$30k per year

2

I’ve recently switched to using Codex 5.3 as it’s much more economical — $20pm and I’ve never hit limits, while I hit Claude Max limits within a few hours and pay $10-30 a DAY in credits to use it. I think Codex works better for trading-related coding and find it both faster and cheaper (hearing the same from friends using AI for trading).

No posts

Read the original on tzedonn.substack.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.