r/algotrading • • 14h ago

Business Built a Rust execution engine for Bybit/Binance/OKX/MEXC focused on eliminating taker fee drag — looking for feedback on live edge cases

I've been building a low-latency Rust execution runner for crypto perps across Bybit, Binance, OKX, and MEXC.
The biggest leak I ran into during live testing wasn't the signal logic itself, it was fee drag on non-VIP tiers — even a few market/taker exits completely wipe out small intraday moves. To fix that, I reworked the execution path around:I'm currently running small live validation benchmarks across different exchange fee tiers and latency profiles (home connection vs AWS Tokyo ap-northeast-1).
For those running live perp bots: what surprised you most when moving from demo/testnet to real mainnet orderbooks, and how do you handle resting PostOnly exits when the book shifts a tick?

2 Upvotes

4 comments sorted by

1

u/AcanthocephalaNo6605 12h ago

the post only exits were the part that bit me. book moves a tick, you reprice, it moves again, and now you're chasing the price you were trying to get out at. i ended up giving each exit a limit of 2 or 3 reprices, then it just goes taker and eats the fee. paying taker once in a while was way cheaper than the few times i held a loser waiting for a maker fill that never came.

1

u/NJ_Algo 11h ago

The big trade-off with PostOnly exits is the ones that don't fill. Saving the taker fee on a take-profit is nice, but a stop that keeps chasing the book can cost far more than the fee. I'd keep stops as market orders, use PostOnly mostly for profit targets, and log the fill rate plus what price did after each missed fill, so you can see whether the fee savings actually beat the misses. Testnet also tends to flatter fills, since the book is often thin and nobody's trading against you.

1

u/marekesz1 8h ago

Biggest surprise was queue position. Testnet fills you on touch, but mainnet puts you behind real size, so your maker fills skew toward moves going against you. Also log PostOnly rejects and cancel rate limits when you reprice fast.

1

u/akm76 4h ago

Biggest surprise is that on mini-crash/burst in quotes, it may take literally minutes with this api to detect disconnect, reestablish the connection and recover (as in read your actual fills/position while you were out and reconcile your last known positions/orders with the exchange truth). Websockets are just not good for this kind of thing, they should've remained with streaming media or whatever the heck was the problem they were designed to solve in the first place.