SBF Profile picture
3 Mar, 16 tweets, 3 min read
1) How I learned to stop worrying and love rate limits
2) NOT TRADING ADVICE
3) There are two mistakes everyone makes when they write their first trading bot.

The first is not the subject here, but I'll mention it in passing because it's everywhere and wild and hugely impactful:

The Golden Ratio.
4) When you adjust your models too quickly based on your trades, you end up setting a parameter above The Golden Ratio.

E.g. if you show $1,000 of bids within 1% of the market, and you decrease your model by 1% for every $100 you buy, then you'll... do some crazy shit.
5) Anyway...

So what about the other mistake?

Well, let's say you want to provide liquidity. A common strategy is:

Send a bid 0.20% below the best bid, and an offer 0.20% above the best offer.
6) Who knows if that makes money or not; that's not the point here.

The point is that this will do something silly.

a) Let's say the market is 100.45 @ 100.48. It'll send a 100.25 bid.

b) Now say someone bids 100.46. It'll cancel its 100.25 bid and send a 100.26 bid.
7) In fact, every time the best bid changes, the bot cancels its bid and places a new one.

What's wrong with that?

Well: if the best bid is 100.46.....

...who cares if you bid 100.25 vs 100.26?
8) I dare you to tell me that you have a trading strategy in a messy industry where you feel confident about $100.25 vs $100.26 bids when the market is at $100.46.
9) 0.20% was, probably, just an approximation anyway, meant to say "idk, more than 0.05%, and way less than 1%".

So, sure, you could cancel your 100.25 and place a 100.26. Or, you know, you could not. You could just keep your 100.25 bid out there.
10) But if it's all the same, why am I bothering to write about it?

Because placing orders uses a scarce resource: matching engine capacity.
11) If an exchange can handle 5k orders/second, and it's already processed 4,999, then there's only one slot left.

Alice wants to buy 1 BTC.

Bob wants to update his 100.25 bid to 100.26.

But there's only room for one.

I sure hope Alice gets her trade!
12) _This_ is why ratelimits exist.

Because no matter how many orders your exchange can handle, if 100 traders are updating 10 orders each on 50 markets on each side every 0.01% market move, that's 100,000 orders sent when BTC goes up 0.01%.

100,000 orders, and no actual trades
13) Bots can easily expand to fill whatever limits they're given.

In doing so, they sometimes cannibalize all important orders, replacing them with unimportant jiggling of irrelevant orders.
14) Market makers often reach out to us, asking for higher ratelimits. I used to just grant them!

Then I took a look at what was actually going on.

And 90% of the time, they were flickering some orders once per second 25bps away from the market.
15) That's where the ratelimits were going.

We might build a tool to let users see what their orders are doing. I think a lot would be pretty surprised: many FTX traders send 50x as many orders per trade as others, even if both are only providing and not taking!
16) And it's a shame, because in the end it's a public resource.

FTX's ratelimits set a fairly constant orders/$ traded, and many of the top firms aren't close to hitting theirs.

If you're blowing through yours, ask yourself: what are most of your orders actually doing?

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with SBF

SBF Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @SBF_Alameda

25 Feb
1) Interesting notes from the Coinbase S1:

sec.gov/Archives/edgar…
2) $1b of expenses. How do you spend $1b? Apparently split between:

--transaction expenses ($135m)
--"Technology" ($270m)
--ads ($50m)
--G&A (prob payroll) ($280m)
--other ($125m)
3) Revenue is 95% *retail* trading fees.

Why retail?

Because they charge ~1-10%!!!

Read 5 tweets
22 Feb
1) What is @RaydiumProtocol?

What makes it a step forward for DeFi?

raydium.io
2) Well, it's an AMM, built on Solana.

So, sure, you can swap assets in a second with $0.00002 gas fees.

And the blockchain can handle billions of trades per day.
3) But it is more than that.

Wee, you can use raydium.io/#/pool to add liquidity to the AMM, and you can use raydium.io/#/swap to trade.

But you can also use dex.raydium.io/#/market/HZyhL… to trade.

That's an orderbook!
Read 9 tweets
20 Feb
1) One note on valuations:

Lots of projects have "yield" or "inflation" or something like that.

Does that mean that you'll lose to holding them?
2) It depends!

Well, really, it depends on the market.

Sometimes everything goes up. Sometimes everything goes down.
3) But another important point:

Let's say there's 10%/year inflation.

Do those new tokens go to:

a) the old token holders
b) some other group
Read 7 tweets
16 Feb
1) I recently wrote an FTX investor update.

While some of it is sensitive, I thought I'd share a redacted version of it here.
2) NOT INVESTMENT ADVICE
3) Writing investor updates for FTX is uniquely weird, because so much of the business is publicly available.

If you want to know about our trading volumes, that’s public. If you want to know about our revenue -- well, you can mostly back it out from the FTT burns.
Read 12 tweets
9 Feb
1) We're really sorry about the messages today on Blockfolio.

We've also now figured out what happened. Here's the story.
2) First, we should have had stricter controls on which accounts could push signal updates. This is our fault, and earlier tonight we significantly increased the old security around it, moving it closer to in line with the security we have around trading functionality.
3) There were about 30 minutes of off and on availability issues while we completely purged all of the offensive content from the system; beyond that, @blockfolio remained online today.
Read 9 tweets
9 Feb
1) Really, really sorry about the messages in @blockfolio today.

2) No trading features/funds/etc. were at risk. Those are part of a totally separate part of the system and are in line with FTX's standards.

The affected portion was around display and news/Signal.
3) Over the next month I'll be leading a security review of the old, non-trading-related parts of Blockfolio to bring them in line with the standards set by trading, and by FTX more generally.
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!