How I made $6K PnL in 30 days on $10K principal market making perps ($158m+ volume).
The strat was entirely built by me and my quant, Claude (he won a national math competition in China).
Last night I asked if you'd want a guide. Hundreds of you said yes, so here it is: HFT for Dummies.
The honest timeline when I did it:
- Days for basic harness and venue integrations.
- Weeks to get it semi-competitive.
- Months to really tune and get it properly profitable.
This series can hopefully shortcut the learning curve for you.
I've been writing trading bots since 2017. It's how I got into crypto (free market data!), and how I met my co-founder.
Back then the barrier was high. You had to know how to code, to study data to find alpha, and to grind devops to have systems not blow up in production. Thankfully I taught myself Python and later Rust, but not everyone has a CS degree.
Nowadays with LLMs, anyone can have a skilled quant in their pocket. I use it for data analysis, strategy tuning, research and alpha generation and infra optimisation. It's a ridiculous time saver.
I'm extremely bullish on one-person quant shops. I think this will be a huge trend this next decade as finance comes on chain and market data and connectivity are accessible to anyone. I've already met many hobbyists who've made a living trading on e.g. Hyperliquid, enough so to quit their day jobs.
What we'll be building
A delta-neutral, reference-price market maker.
Binance is where most price discovery happens. We stream its market data, use it as a reference price, and quote a bid and an ask around it on another venue. I'm using @Bulletxyz because it's the one I know best.
Market making is the business of picking up pennies. Mine are under half a basis point per dollar. Enough pennies add up at the scale of millions of volume.
The catch is speed. If the market moves and you're slow to update, someone lifts your stale quote and you're the exit liquidity. It's a fun game of algorithmic cat and mouse.
On Bullet, takers get a 100ms speed bump. Why? It gives soon-to-be market makers like you a safety buffer so you don't get steamrolled by billion dollar firms with microwave towers.
The goal
The goal: tick to order sent in under 10ms. Stretch goal: under 1ms, which is very achievable if you're determined. We'll also focus on minimising jitter (randomness) because your slowest orders are the ones that will lose you the most pnl.
Agenda:
I'll aim to post one topic a day, going from easy wins, and getting progressively more deep in the weeds. If you work at any HFT firm this will all be elementary stuff, but hopefully it's helpful for newcomers.
Saving seconds
1. Basic intro to algo-trading (this post)
2. Running a simple market maker from your laptop
3. Measure once, cut twice: telemetry and Amdahl's law
4. AWS: Infra and colocation
Saving millis
5. Stop polling: websockets are your friend
6. Optimising order execution
7. How to not get rekt by API rate limits
8. Linux tuning: CPU pinning, IRQs and other nerd stuff
Saving micros (diminishing returns, but fun)
9. Optimising the hot path with CPU profiling in Rust
10. AWS: the last mile
11. Bonus: nonces (and other DeFi quirks)
I'll try share some open source code along with it. Don't expect to be beating Jump in the orderbooks just yet. It should be a good baseline that you can extend and take it as far as you want (you can take it pretty far!).
Tomorrow: setting up a basic MM in Rust, the architecture of which will roughly follow the diagram attached below.
@TomOsborneSI 0 cost to launch a token too - would just have it so tickers are unique to reduce vamps
Main theory is ant meme gets tokenised so once meme = symbol + derivatives then there isn’t much past that in terms of ability to vamp
@SpuddyA7X Fees are only there so the protocol makes money, if you remove that aspect and just have an immutable launchpad for the love of the game A it doesn’t need fees
Gas fees could probably also be potentially paid for by the pool also
@LH_exe Highly doubt it, any journalist worth their salt knows his playbook now
Only way BP is getting in the news will be due to the heightened security alert the met will put out
Tone deaf programming.
Can tell you now what will happen (every time at his talks) - Whole thing is an act
* turns up 5/10 mins late
* rushes in flaps around on the podium rambling for a couple mins
* spouts off some pre-prepared garbage about UK being finance capital
* collects his speaking fee
Former Prime Minister of the United Kingdom. Former Mayor of London.
@BorisJohnson led the country for three years and this city for eight. He’s on stage at Breakpoint, November 15-17.
@czamaru@JohnCena Been to pretty much every good restaurant in London & can confirm it’s mediocre compared to pretty much anywhere else in the world for 4x the price
Even the ones with 3 month waitlists are average at best
@toly Ah yes let’s platform one of the worst PMs who has historically been anti crypto & slowed down UK adoption of blockchain through regulation
Much better than platforming UK founders who have pushed the solana chain forward.
@LH_exe Ain’t no one coming to a solana event to see this clown talk
They should put their energy into highlighting UK founders & products on solana 🤷
at 4096 lanes per call, across the set of proposed operations we see a wallclock speedup of 11.7x-47.6x for 64-bit integers and 10.3x-45.1x for 128-bit integers. the proposed cost model results in a 6.1x-20.0x reduction in cu consumption for 64-bit operations and an 11.1x-60.5x reduction for 128-bit operations
https://t.co/mDPhdVvljb
Metaplex Genesis 🤝 @Rugcheckxyz
Genesis vesting is now integrated into RugCheck, bringing greater transparency to token supply and holder concentration.