18
API rate limit hit me hard on my last trading bot run
I was running an arbitrage bot on Binance last Tuesday and it hit their 1200 weight limit per minute. The bot froze mid trade and I lost $340 before I could kill the script. Now I hardcode delays between every order to keep it under 10 requests per second. Anyone else find a cleaner way to handle rate limits without killing your edge?
3 comments
Log in to join the discussion
Log In3 Comments
dianaanderson29d ago
Yeah "hit their 1200 weight limit per minute" is rough. I do something similar to what you're doing now but I use exponential backoff instead of hard delays. That way if I get close to the limit the script slows down automatically instead of just guessing at 10 per second. I also spread my orders across multiple API keys on the same account if the exchange allows it. For Binance specifically I route different order types to different endpoints since market orders and limit orders have different weight costs. It's not a perfect fix but it keeps me from freezing up during those fast moves.
6
julia_anderson1mo ago
I used to think rate limits were just something you could push past and it would be fine. But reading your story about losing $340 because of a frozen bot really changed my mind. I had a similar thing happen on Coinbase where my script tried to send three orders at once and got a 429 error. The delay between each order is annoying but it beats watching your money disappear. Now I just treat rate limits like a speed bump you gotta respect, not a challenge to beat.
5
dianahayes1mo ago
1200 weight per minute is brutal, especially when you're mid trade. I just split my orders into smaller chunks with a timer between each one. It slows things down but nothing gets stuck and I haven't lost money since.
4