Borgy - πŸŽ’ (@michaelborg05) header
Borgy - πŸŽ’ (@michaelborg05) profile picture
Australia
Joined June 2012
Photo by Borgy - πŸŽ’ (@michaelborg05)Photo by Borgy - πŸŽ’ (@michaelborg05)Photo by Borgy - πŸŽ’ (@michaelborg05)Photo by Borgy - πŸŽ’ (@michaelborg05)Photo by Borgy - πŸŽ’ (@michaelborg05)Photo by Borgy - πŸŽ’ (@michaelborg05)Photo by Borgy - πŸŽ’ (@michaelborg05)Photo by Borgy - πŸŽ’ (@michaelborg05)Photo by Borgy - πŸŽ’ (@michaelborg05)Photo by Borgy - πŸŽ’ (@michaelborg05)
Borgy - πŸŽ’ retweeted
1000x leverage and a dream. Today a new era is born on Degen Mode. Kuromi The Degen 戦士, the animated series is live, only on Bullet. Go big or go home, Kuromi chan.
1000x leverage. Zero fees. Instant execution. DEGEN MODE. ACTIVATED. βŒ–
26
12
2
61
5,245
Borgy - πŸŽ’ retweeted
FCM, DCM, DCO secured. @Backpack is The American Perpetuals Exchange.
Following Monday’s exchange and clearinghouse license approvals, Backpack has secured NFA approval to operate as a Futures Commission Merchant (FCM). The first CFTC regulated exchange to bring leveraged perpetuals with unified global liquidity onshore. πŸ‡ΊπŸ‡Έ Join the waitlist for first access: backpack.exchange/us?v=2
80
73
20
522
36,114
Borgy - πŸŽ’ retweeted
Part 4: Move next to the exchange Same bot, same code. Moving it off my laptop to a $0.10/hour server in Tokyo took end-to-end latency from 211ms to 27ms. That's almost 90% gone without touching the code. Part 3 was Amdahl's law: the code takes microseconds, the network takes tens of milliseconds. You can't optimise the speed of light, so you move closer. Easiest win in the whole series. Pick the zone by measuring Binance's matching engine lives in AWS Tokyo, which has several zones, basically separate data centres. AWS shuffles zone names per account, so use zone IDs. Our probe (code linked below) spins up a tiny server in each zone, times 100 handshakes to Binance and deletes itself. A few cents. apne1-az4: 0.5ms apne1-az1 and az2: ~2ms 4x closer just by picking the right building. Don't use a burstable box Lightsail and EC2's `t` instances only guarantee you a slice of a CPU on the sizes a bot would use, 20% on Lightsail's $12 and $24 plans. Go over and you burn credits, run out and you get throttled. A quoting bot is always on and busiest when the market moves, which is the worst time to get throttled. Remember, we care a lot about low jitter during volatility (will be in the weeds optimisations on this in future tweets). Lightsail is great for a website. For this you want EC2: a c8g.large, where the CPU is yours. Do it in code, not clicks The whole setup is Terraform. Server, zone, firewall and permissions all live in a template. Using the AWS UI is terrible and annoying, and the sooner you switch to IaC (infra-as-code) the better, trust me. One command up, one command down, so no forgotten box on next month's bill. Same build every time, in any zone or account. Also recommend setting up ssh keys to access your box (or use SSM) and use a static IP (called EIP in AWS) so that you can get your IP ranges whitelisted on exchanges you trade on, and they don't change if you replace the box. Two freebies The clock syncs to Amazon's time service inside the data centre. My laptop was 288ms off in part 3, now it's microseconds, so the network numbers are finally useful and accurate. The bot key never touches disk. It sits encrypted in AWS Parameter Store and gets pulled into memory at startup. Always use delegate/scoped API keys not root access private keys, and never store them anywhere on your infra in plaintext. Scoreboard, p50 End-to-end: 211ms to 27ms Binance to us: ~40ms to 1.6ms πŸ”₯ Order to live on Bullet: 24.6ms (to be addressed next) What's left is mostly order to live, because the bot cancels, waits, then places. Part 5 fixes the sockets, part 6 stops the blocking calls.
Part 3: Measure once, cut twice: telemetry and Amdahl's law Most people optimise their bot without ever measuring it. It's like trying to lose weight without a scale. The bot from part 2 runs from my laptop in Singapore. It felt slow, and my first instinct was to dive into the Rust decision code and optimise the shit out of it. I was very wrong. It was nowhere near the bottleneck. Then I remembered Kevin Bowers' @jump_firedancer talks at Breakpoint, and measured first. One trip, step by step The bot now timestamps every step from a Binance price update to our new order resting on Bullet, and exports it all to Grafana. Averaged over 5 minutes: 1. Inside Binance: 0.4ms 2. Binance to us: 41.6ms 3. Waiting in our queue: 0.010ms 4. Our code deciding (tick-to-trade): 0.0057ms 5. Order to live on Bullet: 190ms End-to-end: 232ms Amdahl's law Speeding up one part only helps as much as that part's share of the total. Our trading logic is 0.002% of the trip. Make it 99% faster and the whole trip gets about 0.002% faster. Days of work, basically nothing to show for it. That's the whole point of measuring: know where to look before you spend your time, or Amdahl's Street Justice (as Kevin Bowers likes to call it) gets you. And the numbers already tell us what to fix: β€’ Binance to us (41.6ms) is distance. Part 4 moves the bot next to the exchange. Hint hint, colocation. β€’ Order to live (190ms) is our naive executor. It cancels the old order, waits for Bullet to confirm, then places the new one, and waits on every request. Part 6 fixes that. Two traps when measuring β€’ Use Rust --release builds. Debug builds skip the compiler's optimisations, and made our code look 3-5x slower than it really is. More on squeezing Rust in part 9. β€’ Sync your clocks. Binance to us compares Binance's clock with your laptop's, so if yours is off, the number is off. Mine drifted 433ms behind, so messages arrived before they were sent. That's why end-to-end only uses the exchanges' clocks. Details in the github Now everything is timed and we have a target. Measure first, then fix the biggest number. Tomorrow we move the bot to Tokyo, next to the exchange.
18
7
2
158
11,040
Borgy - πŸŽ’ retweeted
Backpack is coming home to the USA. πŸ‡ΊπŸ‡Έ We’ve received landmark CFTC approval to establish the first-ever derivatives exchange powered by one order book with unified global liquidity. Leveraged perpetuals. Crypto collateral. Cross-margin. 24/7 trading. Join the waitlist: backpack.exchange/us LFG πŸŽ’
417
527
415
3,186
697,298
Borgy - πŸŽ’ retweeted
MILLISECOND Two years of engineering in 15 seconds:
5
6
1
44
4,107
Borgy - πŸŽ’ retweeted
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.
Would people be interested if I wrote up a guide on latency optimization and colocation tricks for perp exchanges?
71
54
9
1,056
124,874
Borgy - πŸŽ’ retweeted
Milestone unlocked: $40m+ Daily Trading Volume and $4m+ Open Interest! Another week, another Bullet W 🫑
11
4
1
31
16,854
Borgy - πŸŽ’ retweeted
When Solana gets faster, Bullet gets faster.πŸ”οΈ The Alpenglow consensus upgrade has reduced the Bullet desposit time to under a second. Fast speeds. $0 fees to trade. Bullet mentioned. πŸ‘‘
πŸ‘‘πŸ‘‘πŸ‘‘
1
4
25
27,235
Borgy - πŸŽ’ retweeted
You ready to compete? BULLET ROYALE drops tomorrow with ZERO Trading Fees. No trading fees means more of every winning trade stays yours. The trader with the highest PNL takes the top prize, with rewards for the top 20 traders. Trade hard. Pay zero fees. Keep the upside.
8
7
29
27,140
Borgy - πŸŽ’ retweeted
Milestone unlocked: $10m+ daily trading volume. Upwards 🫑
8
2
1
30
19,116
Borgy - πŸŽ’ retweeted
September was an absolute blur, looking back on it we actually shipped a bunch of cool updates, and finally cracked a few big milestones (10m volume, 2m OI) 🚒 Bullet Liquidity Provider (BLP) was finally opened to public deposits, and the $300k cap filled the same day. We've extensively tested the strategy for 3 months and it's been overall profitable, with a 2.37 Sharpe and ~100% APY on the last 30 days annualised. Deposit caps will be opening up again this week, keep notis on πŸ”” Speed. We benchmarked end-to-end execution against other perp venues. Bullet came in at ~8ms, ahead of Lighter and HL (Nado just recently improved their p50 a lot to ~7ms, congrats to them, we will get you back xd). Our matching engine runs at ~250Β΅s, and most of the remaining time goes to the network, and there's a lot we have flagged to improve still. Thankfully still have the lowest p999 (tail latency) of any DEX by a factor of 4x. Collateral. You can now post SOL and jitoSOL as margin, meaning no hassle to sell your beloved bags to stables. We built the jitoSOL integration with @jito_sol, so your collateral keeps earning staking yield while you trade. New Markets. We listed RAY, BNC, UNI and NEAR, and PUMP and DOGE go live tomorrow. We also automated most of our listing pipeline, so a new market now takes us about 15 minutes end to end. Expect a lot more of them, and quickly. People under-appreciate the operational burden of exchange listings, and we've spent a bunch of time seeing how it can largely be automated. We're aiming to list 2 new markets every week. Liquidity. Most majors (BTC/ETH/SOL) are now consistently 0.1-0.5bps wide at the top of the book (!!), which is testament to why we've been hell bent on building the fastest execution stack on the market. @AphelionTrading is now providing very competitive liquidity on Bullet. They were the highest-volume onchain market maker on Solana from last cycle, and true friends and legends that I am grateful to be working with again. Fees. We cut trading fees across every tier, and volume picked in accordance. We are going to continue experimenting with fee structures that reduce friction to onboarding for new traders evaluating our product, our goal being to provide the best cost for the average perps consumer (spread + fees). Affiliates. More than 100 affiliates have signed up since we launched the program. Form linked below. Product. We shipped subaccounts, isolated margin, and vault infrastructure that lets anyone launch and run their own vault.
7
14
56
5,821
Borgy - πŸŽ’ retweeted
Bullet Liquidity Provider (BLP) is Bullet's automated market-making vault. The Vault quotes both sides of every perp market, layered from tight to wide around reference prices from centralized venues, and earns the spread plus a maker rebate when its orders fill. The strategy is designed to be beta neutral. As inventory builds, it skews quotes toward flat, both per market and across beta-weighted exposure in crypto, stocks and commodities. Its taking logic adapts to its risk position, actively working down beta exposure as it builds. Hard position limits apply per market, and there is no external hedge. Deposits are pooled as margin for those quotes, and depositors share the PnL pro rata: β€’ Users can deposit USDC and share in the vault’s overall PnL β€’ No management fees or profit-sharing deductions β€’ Deposits have a 24-hour lock-up period β€’ Withdrawals take 24 hours to process β€’ Depositors share the downside if extreme volatility or market manipulation creates losses
4
4
31
27,299
Borgy - πŸŽ’ retweeted
Until now, deposits into the BLP was a Team-only perk. Today, we are sharing it with all our users: β†’ 1,000 USDC max per wallet β†’ 300,000 USDC total capacity β†’ First come, first served
15
6
2
53
30,629
Borgy - πŸŽ’ retweeted
Backpack launches the first 24/7 brokerage for real US equities. International investors can now buy and sell select US equities on Backpack 24/7/365. Not synthetic. Not derivatives. Real shares β€” tradable around the clock. Via the first always-on market infrastructure connecting direct TradFi brokerage access with 1:1 redeemable onchain liquidity. Starting with SpaceX (SPCX), Micron (MU), and SanDisk (SNDK). More coming. Capital doesn’t sleep. Markets shouldn’t close.
112
125
72
652
128,708
Borgy - πŸŽ’ retweeted
There are three main licenses in Europe covering different regulated activities: - MiCA (crypto-asset services) - MiFID II (investment services) - PSD2 (payments) Today, only a select few companies in the digital asset industry have attained any of these. Even fewer have all three. It's been a long grind, but I’m proud to say Backpack is one of them. Doing this in one country is really hard. It takes a whole team, years of work, and an enormous amount of patience to get it done. Doing it in every country around the world is another thing altogether. There's no short cut. Just years and years of relentless execution. Things that are invisible in the short term, but for which in the long term they add up. Every day we get a little bit closer to building a truly global, crypto-native financial institution for the future of money. Today, we're a little bit closer. 🧱🧱🧱
Backpack EU has secured its MiCA license and Payment Institution license from the Bank of Latvia. Combined with our MiFID II license, Backpack EU is now tri-licensed across crypto, brokerage, and payments. This milestone strengthens our ability to serve users across all 27 EU member states while upholding the trust, transparency, and regulatory standards required to connect onchain and traditional financial markets.
74
110
27
552
74,946
Borgy - πŸŽ’ retweeted
Replying to @Backpack
@Backpack , stay in your lane. You can't improve old money. We can trade any time between 9am-4pm weekdays , Only 24hrs to settle a trade, we can trade international with a few simple forms and 72hrs notice. You can't improve perf... 4pm. I'll finish this post tomorrow
Are your tokenized stocks giving you the real thing? On/off-ramp securities between traditional brokers and @solana. Soon.
1
1
4
91
Wall street won't know what hit it Fock it
1
3
32
Borgy - πŸŽ’ retweeted
With the CFTC putting the full force of law behind regulated perps, with the SEC bringing securities onchain, with SpaceX, the biggest IPO in history, about to pop, a new era of crypto is forming. Until now, crypto has operated as a parallel financial system. Segregated assets, segregated markets, segregated users, and segregated products. We went from the ICO craze, to DeFi summer, to the proliferation of L1s, Ethereum Killers, L2s and the like, to the NFT boom, the memecoin mania, the perp DEX craze, and the rise of DATs. As crazy as it once sounded, today, the old financial system is merging with the new one. And what follows is the next evolution in global market structure that will forever change the landscape for securities around the world. It’s not about one blockchain or one token vs another. It’s about crypto making the leap into Modern Finance to grow the industry 100x alongside the largest pools of capital in the world. Finally, it’s time for the old guard to meet the new. So what’s next? The dawn of the crypto native stock broker.
63
74
31
420
56,200
Borgy - πŸŽ’ retweeted
Stake more, unlock better utility. Staking page is now live: backpack.exchange/bp
263
135
155
1,054
713,271
Borgy - πŸŽ’ retweeted
68
43
15
430
29,690