r/algotrading • u/Fearless-Celery3392 • 3d 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
[removed]
1
Upvotes
1
u/AcanthocephalaNo6605 2d 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 2d 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 2d 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 2d 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.
1
u/Delicious_Actuary903 2d ago
Yeah, moving from testnet to mainnet humbled me pretty fast. On testnet the book basically sits still and lets you fill whatever you want. On mainnet, the top of the book disappears the second your packet hits the wire, and you find out the hard way that Binance's
GTXand Bybit/OKX post-only flags reject things completely differently when price ticks through you mid-flight.Going from home internet to Tokyo (
ap-northeast-1) definitely cuts down the stale-quote rejects, though during real volatility spikes your order acks and WebSocket book updates will still race each other.For resting
PostOnlyexits when the book shifts a tick, I stopped chasing endlessly. If you reprice on every single tick, you just end up playing whack-a-mole and watching a green trade turn red while you're busy canceling and replacing.What actually worked for me was capping it at 2 or 3 reprices max. If it still doesn't fill or momentum starts running against me, I just cross the spread and eat the taker fee. I also keep
PostOnlystrictly for take-profits—trying to save 4 bps on a stop-loss is a great way to get run over when the book gaps. And definitely slapreduce_onlyon every exit order, otherwise one lagged book update during a fast tick will accidentally flip your position.1
u/djawlagml 2d ago
one thing that surprised me: maker isn't actually free at non-VIP tiers. on bybit/okx it's roughly 2bp maker vs 5.5bp taker, so the whole gain is about 3.5bp per exit. if repricing drops your fill rate by even 20% and a missed exit runs 10bp before it fills, you're net negative — and it still looks fine in the logs because the fee line got smaller.
the number that fixed my tuning was realized cost per exit in bp, not the fee table: (fill price - target) / target plus the reprice count. exits that missed and ended as taker were costing me ~4x what my fee assumptions said. after that i stopped optimizing the fee and started optimizing the fill.