ryuzaki Profile
ryuzaki

@0xRyuzaki

Followers
5,863
Following
647
Media
25
Statuses
367

quant research & dev // simplifying life

Joined May 2021
Don't wanna be here? Send us removal request.
Explore trending content on Musk Viewer
@0xRyuzaki
ryuzaki
3 years
My last thread on market making concluded that managing inventory risk is key to staying in the MM business This one’s dives into exactly what that means, and I’ll walk through a cheeky math model for how to do it as a full automated / algorithmic trader
12
158
842
@0xRyuzaki
ryuzaki
2 months
if you’re trying to do quant and genuinely need this reference you are not going to make it brother
@pyquantnews
PyQuant News 🐍
2 months
Need a reference for algebra? Here's a cheat sheet you can download:
Tweet media one
5
75
551
31
31
760
@0xRyuzaki
ryuzaki
3 years
going offline for 3 months to do a dopamine detox and also to make 9 figs in MEV, see you guys in a bit
13
11
572
@0xRyuzaki
ryuzaki
28 days
Every week this dumbass account re-discovers that open source software is free
@quantscience_
Quant Science
28 days
Why python is insane for algorithmic trading: 1. Visualization: Plotly ($0) 2. Data analysis: Pandas ($0) 3. Market Data: OpenBB ($0) 4. Technical indicators: TA-lib ($0) 5. Machine Learning: Scikit Learn ($0) Total cost: $0
Tweet media one
11
158
1K
13
14
379
@0xRyuzaki
ryuzaki
2 years
Modern VCs are this weird intersection between philosophers and capitalists which makes them uniquely annoying in a way no group has ever been
6
19
313
@0xRyuzaki
ryuzaki
3 months
Kinda interesting how 2 of the top HFs ever, Citadel and Renaissance, are known for polar opposite cultures. Citadel being this cutthroat corporate revolving door vs. Renaissance being a chill academic vibe that nobody ever leaves. And don’t get me started on Bridgewater
5
8
287
@0xRyuzaki
ryuzaki
3 years
worth keeping this on your desk
Tweet media one
5
28
251
@0xRyuzaki
ryuzaki
2 months
good reminder
Tweet media one
3
13
231
@0xRyuzaki
ryuzaki
2 years
My favorite type of market participants to date are tradfi L/S equity type dudes who came in, spread some comps and ran a DCF on like PissAssCoin and are down 98% on spot
5
8
204
@0xRyuzaki
ryuzaki
2 years
To round out the trilogy, I figured I'd write a third and final thread with some more qualitative insights and thoughts on market making and profitable liquidity provision No math this time, but lots of important concepts to understand in practice
5
30
190
@0xRyuzaki
ryuzaki
2 years
Getting started as a quant is about putting down the fucking research papers and immersing yourself in as much real market data as possible Papers are stale & noisy; reading doesn't get you paid All you need to know is how to iteratively follow a data-driven scientific method
4
9
164
@0xRyuzaki
ryuzaki
11 days
😭
Tweet media one
2
7
164
@0xRyuzaki
ryuzaki
3 years
gm crypto twitter thought I'd kick things off by dropping some knowledge on electronic market making a thread on how institutions are built by programming computers to buy low sell high
4
31
154
@0xRyuzaki
ryuzaki
2 years
Tweet media one
7
5
128
@0xRyuzaki
ryuzaki
2 years
Love playing chess, make an absolutely redacted move, and watching my opponent hesitate on the obvious response because they can’t tell if it was a mistake or I’m actually seeing 5 steps into the future
7
5
120
@0xRyuzaki
ryuzaki
2 years
A useful thing that market making taught me about life is that there’s more value in knowing what could happen and reacting fast when it does than the fool’s game of trying to predict everything everywhere all at once
0
5
123
@0xRyuzaki
ryuzaki
3 years
deeply internalizing the 'fuck around and find out' mentality is so critical to success in any scientific/engineering or entrepreneurial environment
1
8
114
@0xRyuzaki
ryuzaki
3 months
Let’s say you had to pick 1 book to take a good mathematican who knows nothing about markets and give them the minimum viable knowledge to do quant research What book would you pick?
12
9
116
@0xRyuzaki
ryuzaki
3 years
Sorry this thread was a billion tweets long, I feel like a VC influencooor Hope it was a helpful starting point and at least kinda understandable MM is a pretty complex game and this is one of the harder parts of it
21
1
97
@0xRyuzaki
ryuzaki
2 years
Crypto as a whole widely touts the arrival of “institutions” as a bull case when in reality the arrival of retail en masse has driven more absurdly bullish price action than any institution ever could
2
5
76
@0xRyuzaki
ryuzaki
2 years
Maybe I’m old school, but a lot of things about SBF made me implicitly dislike him Treats his physical health like shit, talks way too fast, talks to people like they’re 4 years old, uses philanthropy to justify absurd greed, promotes the cringiest everyman image I’ve ever seen
7
1
80
@0xRyuzaki
ryuzaki
10 days
Need 3 things for market making: 1. Good sense of fair value -> Picking up the pennies 2. Good sense of counterparty’s informedness -> Knowing when to dodge the steamroller 3. Low-latency system -> Knowing how to dodge it fast Add a sprinkle of risk mgmt and that’s it
3
2
78
@0xRyuzaki
ryuzaki
3 years
A few preliminaries you should know market structure & terminology basics if you don’t already (e.g. order types, LOBs, spreads), this is a good intro, you should read the original thread first, this one is more advanced,
@0xRyuzaki
ryuzaki
3 years
gm crypto twitter thought I'd kick things off by dropping some knowledge on electronic market making a thread on how institutions are built by programming computers to buy low sell high
4
31
154
3
7
65
@0xRyuzaki
ryuzaki
1 month
One of the simplest fair price “forecasts” is to use the most dominant exchange/mkt by volume and quote around it everywhere else There will be a lead-lag effect where info from Big Venue is ahead of Small Venue and it’s your job as market efficiency plumber to bring it there
@Dub0x3A
dub
1 month
so ppl literally do just quote around binance / bybit lmfao * Gemini quoting around ByBit's Spot market
Tweet media one
8
7
195
1
1
65
@0xRyuzaki
ryuzaki
2 years
the elites won’t tell you this but salmon + green tea >> addy
6
3
59
@0xRyuzaki
ryuzaki
2 years
The line between quant and discretionary trading isn't as firm as beginners often think Trading is *always* discretionary, a quant only uses more stats to aid their judgment Referring to quant as "systematic" trading is truer to practice in my experience
4
5
58
@0xRyuzaki
ryuzaki
21 days
Crypto HFT teams picking a language
Tweet media one
3
2
65
@0xRyuzaki
ryuzaki
3 years
The model here is from the paper “HFT in a limit order book” by Avellaneda & Stoikov. The derivation is non-trivial so I’ll focus on the motivation and results here
1
1
60
@0xRyuzaki
ryuzaki
1 year
after years of writing websocket connections in c++ I’ve just discovered node.js and man what the fuck
9
1
59
@0xRyuzaki
ryuzaki
3 years
many think that making good decisions with poor information is a sign of intelligence, but it’s mostly luck the smartest people are mostly focused on finding ways to get more information until the move is clear nothing is truly hard or stressful when you’re well informed
1
7
55
@0xRyuzaki
ryuzaki
17 days
@quantymacro Once in an interview they told me: "make a market on the number of companies in the S&P 500" I replied fast: "69 @ 420, 7 up" Everybody clapped and now I get to personally click the "liquidate retail" button at CitSec when Ken tells me to
1
0
55
@0xRyuzaki
ryuzaki
3 years
the model part is where it gets harder if this gets any interest I'll follow up with an ELI5 thread on the math behind a classical model from academia (Avellaneda & Stoikov) it isn't the full picture, but it's definitely a strong starting point to being profitable as a MM
4
1
51
@0xRyuzaki
ryuzaki
3 years
munger definitely gets a lot of hate around CT, and like yeah I get it, but he was once not so different from us
Tweet media one
7
7
48
@0xRyuzaki
ryuzaki
3 years
Future things to consider if you really wanna print money: - how you define the fair value of an asset (is the mid-price really good or is it unreliable sometimes?) - how do tick sizes and exchange rules affect your strategies? - how do you incorporate alpha into your pricing?
1
2
41
@0xRyuzaki
ryuzaki
3 years
if you (yes you, anon) wanted to do this for yourself, the minimum you'd need is a model for managing inventory risk and software to place LOs orders for you on an exchange according to your strategy for software BitMEX has a good starting point:
1
1
42
@0xRyuzaki
ryuzaki
3 years
A few ways: (1) Resize your hedge with a market order on B (2) Widen your quotes to adjust for uncertainty (3) Skew your quotes based on your delta (4) Skew your quotes based on alpha signals
2
3
37
@0xRyuzaki
ryuzaki
3 years
Let's start with some motivation Consider a pawn shop When a customer arrives wanting to sell, you do a few things: (1) Value their stuff best you can (2) Offer to buy it below your valuation (3) If they accept, store it until you can flip it for more than you paid for it
1
2
36
@0xRyuzaki
ryuzaki
3 years
A&S defines the indifference price as r(s,q,t) = s – q * gamma * sigma^2 * (T – t) where: s = mid-price q = inventory gamma = risk-aversion param sigma = volatility T = end time t = current time
1
2
36
@0xRyuzaki
ryuzaki
3 years
Every MM and their mother knows this paper so there’s no unique alpha here, *but* it is the foundation of many models and you should know it too And ofc none of this financial advice, just theoretical quanty shit
2
2
34
@0xRyuzaki
ryuzaki
3 years
can someone explain why I keep seeing PFOF presented as "front-running" ? I'm legit confused don't the trades print to the tape in order like any other market? I always thought the benefit to MMs was just retail flow is as noisy / low toxicity as it gets
9
1
35
@0xRyuzaki
ryuzaki
1 year
heartbreaking: the worst person you know just made a great point
@nntaleb
Nassim Nicholas Taleb
1 year
Let me be blunt. Those who are afraid of AI feel deep down that they are impostors & have no edge. If you have a 1) clear mind, 2) a deep, not just cosmetic, undertanding of your specialty, 3) and/or are original enough to reinvent yourself when needed, AI will be your friend.
718
2K
13K
3
0
35
@0xRyuzaki
ryuzaki
3 years
Principally, the risks are: (1) bad valuations make you trade at bad prices (2) you buy something but can't find anyone to sell it to (3) price moves adversely b/w the time you buy and sell (4) you bought too much and run out of cash until you sell some
1
2
33
@0xRyuzaki
ryuzaki
1 year
when you drop so much alpha in threads that you’re able to drop an alpha thread of alpha threads
@chameleon_jeff
jeff.hl
1 year
1/ Building a crypto HFT system is a challenging and rewarding journey. A mega-thread covering: Trading strategies ("what") The infrastructure and latency optimization ("how") Exchange selection ("where") Market dynamics ("who") What I wish I knew when getting started 🧵
43
157
984
3
3
35
@0xRyuzaki
ryuzaki
2 years
advice to young people: put a satellite dish on the roof of your dorm room to get real time stock quotes this will give you real time stock quotes and also an inspiring narrative to raise billions in capital on for the next 20 years
1
2
33
@0xRyuzaki
ryuzaki
2 years
Ok that wraps it up, I've officially leaked as much alpha as I can on the subject, my boss would kill me if I had one See you guys in the orderbooks!
4
0
34
@0xRyuzaki
ryuzaki
3 years
imagine feeling like a good trader and someone shows you a backtest of a bot that trades off your timeline and massively underperforms feels very bridgewater-esque are you signal or noise anon?
@monkasalami
MONKASALAMI
3 years
@HsakaTrades im already sniping your tweets sentiment
Tweet media one
50
32
661
2
1
32
@0xRyuzaki
ryuzaki
3 years
learning rust so I literally never have to touch a cmake file again
4
2
32
@0xRyuzaki
ryuzaki
3 years
linkedin is one big competition for who’s the most alpha wagie
3
1
32
@0xRyuzaki
ryuzaki
2 years
all alpha is contrarianism but all contrarianism is definitely not alpha be mindful of when something different is actually better for you vs. just different
1
3
27
@0xRyuzaki
ryuzaki
2 years
hello friends, happy to say I am back from my hiatus not 9 figures richer but have improved my life in many meaningful areas
4
2
30
@0xRyuzaki
ryuzaki
2 years
“If he’s algo trader I’m tooth fairy” - @insilicobunker
1
0
26
@0xRyuzaki
ryuzaki
2 years
I’m not in debt I swear bro I’m just long inflation
1
1
29
@0xRyuzaki
ryuzaki
1 month
The elites won't tell you this but you should use 100x lev on all LOs for a MM strategy. If you know you're holding it for 30 secs and max DD per position is 50 bps nothing can actually go wrong
2
1
30
@0xRyuzaki
ryuzaki
3 years
2022 goals (1) shitpost more (2) start a firm (3) become ungovernable
0
1
28
@0xRyuzaki
ryuzaki
3 years
if you listen to @SBF_FTX interviews, the guy clearly first became a multimillionaire through the repeated application of that mindset + common sense, and I really believe almost anyone can do this
3
0
28
@0xRyuzaki
ryuzaki
3 years
That’s roughly the MM business Your store is your portfolio and the inventory you keep in it is financial assets, I like this comparison because it makes the term inventory risk clearer If you’re running a business like this what are your major risks?
1
1
29
@0xRyuzaki
ryuzaki
3 years
what the fuck is an indifference price I’m glad you asked it’s the price at which you’d be indifferent to buying/selling one more unit of the asset you’re trading in simplest terms, it answers “how cheap would I need to this thing to be to reasonably buy more of it?”
1
2
29
@0xRyuzaki
ryuzaki
3 years
How do you quantify uncertainty in the future value of the asset? You should’ve said volatility (i.e. variance of returns over a lagging period) The takeaway is that to implement (2), our MM model should widen its pricing when volatility is high
1
3
25
@0xRyuzaki
ryuzaki
3 years
in crypto there are @AlamedaTrabucco , @wintermute_t , @mgnr_io , @B2C2Group , @jumptrading , and many more operating as liquidity providers and running these strategies across hundreds of markets and exchanges all staffed with galaxy brains and for good reason
2
1
27
@0xRyuzaki
ryuzaki
2 years
if you wanna make it as an entrepreneur stop reading VC substacks (extremely soy) and start reading robber barons biographies (extremely chad)
1
1
25
@0xRyuzaki
ryuzaki
2 years
My take on the morning routine discourse, which is an asinine discourse with good intentions, is the following is optimal: 1) 2 mins cold-ish shower (~6/10 cold) 2) Brush teeth, dress well 3) 10 mins sunlight (walk to office or deli) Total: 30 minutes and 0 dollars
1
1
28
@0xRyuzaki
ryuzaki
2 years
Recently been thinking of building something combining advanced market analytics with a low-friction alpha research workflow The goal being to provide the same type of tooling that quant prop firms could build internally to a broader audience of traders w/o software skills
11
1
23
@0xRyuzaki
ryuzaki
3 years
this is formally known as adverse selection + inventory risk adverse selection = your counterparty is informed and you're def on the wrong side of the trade inventory risk = your book is skewed long/short due to an imbalance in buyers/sellers (you'd like to be delta neutral)
1
1
25
@0xRyuzaki
ryuzaki
3 years
The optimal spreads are: d(a) + d(b) = gamma * sigma^2 * (T-t) + (2 / gamma) ln(1 + (gamma / k)) where: d(a), d(b) = ask spread, bid spread k = orderbook density param everything else the same
1
1
26
@0xRyuzaki
ryuzaki
3 years
Sanity check - why do we do this? Because trading happens both ways, and to sell something you must own it. Hedging like this lets you own it without assuming market risk Now you only care about diff b/w the position on A and B (delta), which varies as your orders fill on A
1
2
24
@0xRyuzaki
ryuzaki
2 years
the cost of taking risks is potentially losing your capital the cost of not taking them is dying with regrets if you were on your deathbed, how much would you pay to get rid of all those regrets?
2
2
23
@0xRyuzaki
ryuzaki
3 years
It’s purely reactive, not predictive If you have alpha signals, you could incorporate those into the MM model as well to position yourself more favorably for the future state of the market, but this is obvious This can greatly help to reduce adverse selection but is hard
1
2
24
@0xRyuzaki
ryuzaki
2 years
@macrocephalopod indoor shrimp farms
0
0
23
@0xRyuzaki
ryuzaki
3 years
This is attractive if your delta is too negative - the asymmetry adjusts the probability of getting fills in the direction you want Important to emphasize this skew isn't based on future predictions, it’s only adjusting pricing based on the current state of *your* portfolio
1
2
24
@0xRyuzaki
ryuzaki
3 years
A&S specifically defines the value function u(s,x,q,t) = max E [ -exp(-gamma (X_t + q_T S_T)) ] where: max is over delta(a), delta(b) E = expected value X_t = cash q_t = inventory S_t = mid-price (X, q, s are all stochastic)
1
1
25
@0xRyuzaki
ryuzaki
3 years
Based on the previous equations, A&S models lambda(delta) ~ A exp(-k delta) where A = frequency of MOs k = alpha * K K = proportionality constant You’d typically do a regression against market data to get at a good value of K, but I’ve said enough for now
1
1
22
@0xRyuzaki
ryuzaki
2 years
I tend not to trust engineers who dress or present themselves poorly, because good engineering and systems design is a fundamentally creative, opinionated, and aesthetic process - it cannot be done well by someone lacking basic aesthetic sensibilities
3
1
23
@0xRyuzaki
ryuzaki
3 years
For (2) Suppose XYZ has a mid-price of $100, what’s the difference between quoting $99 @ $101 vs. $95 @ $105? Namely the tradeoff is high volume + low margins vs. low volume + high margins The latter also gives you more room for uncertainty in the future value of the asset
1
2
23
@0xRyuzaki
ryuzaki
3 years
Adjusting your hedge is the easiest way, but it’s relatively expensive You gotta pay taker fees and cross the spread on B, hedging can eat into margins p badly We should focus more on techniques 2-4 instead to make more money
1
2
23
@0xRyuzaki
ryuzaki
3 years
If your buys/sells are filled evenly, your delta stays close to zero, but if flow is very one-sided, you could get into trouble if you don’t adapt How do you adapt to one-sided flow?
1
2
23
@0xRyuzaki
ryuzaki
2 months
Been writing Python for like 8 years and I still don't really understand how the import system works Idk why but it's like the quant dev equivalent of centering a div
1
1
27
@0xRyuzaki
ryuzaki
3 years
so how do you fix this? there are roughly two ways (1) you can try to predict the direction of the market over short time frames and trade with it (2) you can adjust your quotes dynamically to manage your inventory, keeping your market risk low while capturing spreads
1
1
24
@0xRyuzaki
ryuzaki
1 year
I miss mgnr
3
0
24
@0xRyuzaki
ryuzaki
3 years
Finally let’s talk about modeling order flow Specifically, we’d consider the frequency, size distribution, and impact of market orders on price Let’s say frequency is constant, like total volume / avg. size of order
1
1
22
@0xRyuzaki
ryuzaki
2 years
@godcomplex96 @therobotjames dude's get into trading and focus on anything and everything except actually making money
0
0
20
@0xRyuzaki
ryuzaki
3 months
@BeatzXBT @over_termin_ai_ @quant_arb @Vertox_DF @quantbeckman @nik_algo @cryptoflashboy_ @Dub0x3A @GoshaawkTrades @laurentzeimes My only advice is to worry less about inventory mgmt and more about alpha + latency. If you only focus on inventory you’ll be getting picked off on every trade basically & only be making money when you trade against pure noise
1
0
24
@0xRyuzaki
ryuzaki
3 months
The greatest achievements in my life have not come from the pursuit of greatness so much as the avoidance of boredom. For me it doesn’t seem to work any other way
0
1
23
@0xRyuzaki
ryuzaki
3 years
A&S provides a 2-step procedure for optimally providing liquidity (1) Compute an “indifference” price (2) Compute the optimal spreads based on (1)
1
2
22
@0xRyuzaki
ryuzaki
3 years
ok a hint: what happens if the market tanks? who's gonna be buying all that shit right as it's nuking? that's right, your dumb ass
1
1
21
@0xRyuzaki
ryuzaki
3 years
If q > 0, r < s indicating a desire to sell, and vice-versa with q < 0 indicating a desire to buy If sigma >> 1, volatility is high and your pricing is further from mid-price That captures the basics of what we want already
1
1
22
@0xRyuzaki
ryuzaki
3 years
and if it starts mooning, you're gonna be selling right when you'd make more money holding basically with every trade you get filled, there's a decent chance you're gonna be on the wrong side of it the old saying: "I don't wanna be in any club that'll have me as a member"
1
1
21
@0xRyuzaki
ryuzaki
2 years
This is why you might hear people saying that modern MM is more like cheap alpha execution rather than true liquidity provision The spreads help you break-even while the directional bets from your alpha generates the real PnL
2
1
23
@0xRyuzaki
ryuzaki
1 year
tell me you’ve never met a low income person without telling me you’ve never met a low income person
@Austen
Austen Allred
1 year
McDonald’s is the point of highest preference falsification in society. Nobody claims to like it or go there. $23 Billion/yr revenue.
1K
457
7K
2
0
22
@0xRyuzaki
ryuzaki
3 years
A good market making model should manage for all of these Let’s think about the flip side of what a profitable MM operation should look like again
1
1
20
@0xRyuzaki
ryuzaki
2 years
A keen, thesis-driven investor might note that the catalysts of this crash - a hedge fund and a centralized lending platform blowing up - have absolutely no bearing on the fundamental value or usage of the Ethereum blockchain
4
0
22
@0xRyuzaki
ryuzaki
2 years
(just gonna leave this here)
Tweet media one
2
1
22
@0xRyuzaki
ryuzaki
3 years
so that's the basic game we're playing as a MM: manage inventory risk so we can stay in business it's a lot like selling options or insurance - you make small premiums (spreads) most of the time and occasionally lose big on tail risk events
1
2
21
@0xRyuzaki
ryuzaki
2 years
in earnest, I've been on a hiatus from trading for the last 6 months, having shut off my bots back in june consumed by feelings of tiredness and uncertainty
2
0
21
@0xRyuzaki
ryuzaki
2 years
And I want to emphasize the importance of not victim blaming yourself here when SBF should literally be headed for jail time
@lawmaster
Larry Cermak
2 years
@CL207 The loss I can live with, it’s what it is. But what really really annoys me is how I could misread the situation so badly and get fucked myself. And that’s despite seeing all the sketchy shit on chain. Never trusting any crypto company again
32
11
378
0
0
20
@0xRyuzaki
ryuzaki
3 years
Let’s say XYZ/USDT trades on exchanges A and B and you wanna make a market in it on A You go long $100k XYZ on A and short $100k XZY on B at the start of the trading day, now you have a delta-neutral position on A to use for use for providing liquidity
1
2
20
@0xRyuzaki
ryuzaki
2 years
hodl is massive psyops for the majority of coins a bag of rocks doesn’t get any heavier if you hold it for 10 hours vs. 10 mins, your arms just get weaker
1
1
16
@0xRyuzaki
ryuzaki
3 years
In A&S, the params you have control over are gamma (personal risk-aversion), k, and T (end-time) With those you can compute the reservation price, the optimal spreads to quote around it, and begin market making with some inventory control
2
1
20
@0xRyuzaki
ryuzaki
2 years
gf said she wished there was an easy way to sell her kohls cash for dollars I said I'm .65 bid at .95, 100 up and she slapped me
1
0
19
@0xRyuzaki
ryuzaki
3 years
if you have direct market access, you can code a bot to post LOs for you and effectively be a MM and in crypto, all exchanges have free APIs so there are really no (financial) barriers to entry so a question: what stops just anyone from doing this and printing infinite money?
1
0
20
@0xRyuzaki
ryuzaki
3 years
also note that if you're familiar with AMMs, what I'm talking about is the same concept as impermanent loss generally the rewards have to be super high to compensate LPs for the IL, which is always bound to happen over enough time (excluding like stablecoin pools)
1
1
20