r/quant • u/Eyoba_19 • 1d ago
Tools What do you think of the way I'm calculating liquidity on my options legs from NBBO prices?
This is part of a project I started yesterday for a box spread scanner, I need to calculate the liquidity on each leg to rank the entire box spread amongst multiple pairs, so here's what I'm doing is:
Say an option with ask: $92 and bid: $90 and ask_size: 15 and bid_size: 20
Get the mid and spread first
1. Mid = ask + bid/2 = 92+90/2 = $91 and Spread = ask-bid = $2
Calculate the relative spread in bps by dividing spread over mid and multiplying by 100
2. realtive_spread_bps = spread/mid = 2/91 * 100= ~220 bps
Take 10,000 and divide by the relative spread, (+1 is in case of 0)
3. 10,000/ (relative_spread_bps +1) = 10,000/220 = 45
Total size is bid+ ask size
4. total_size = bid_size+ ask_size = 15 + 20 = 35
5. size_score = min(35, 10,000) = 35
Get liquidity from spread score and size score
6. liquidity = spread_score * size_score = 45 * 35 = 1,575
Here's a gist from my codebase: https://gist.github.com/Eyob94/767af6f6216db1bdc5b3e021cb5d26da
Update:
The options are constituents of a box spread, for those who're not aware, a box spread is basically a 4 leg option combo that you can use to lend or borrow money at fixed rates close to the SOFR and has a few other benefits compared to a regular bank loan, SBLOC or margin loan. You can search up about them or check boxpsreads.io as well.
For those who're mentioning delta should be part of the equation, the reason I'm pushing back is because for every strike you'd buy/sell both the call and the put, effectively netting a 1 or -1 delta, will delta still be beneficial then?
•
u/Puzzleheaded_Use_814 1d ago
If you want a good metric maybe you can do this:
- delta at bid/ask
- Spread in bps
- find the ratio of order of magnitude between median spread and median delta?
- Do min(spread, ratio* delta) or the average between the 2 instead of min.
•
u/NatGaz 22h ago
Why do you look at the spread in bps and not in ticks (genuine question) ? I'm bad at options.
If Option1 has a BBO 1.5 / 1.6 and Option2 has a BBO 3.1 / 3.2 (same underlying let's say), Option1 seems more valuable than Option2 ? Because at the end, you will delta-hedge and then balance/manage in a smart way the Gamma of the book, I don't get why Option1 should be prefered.
•
u/Eyoba_19 1d ago
I’m still not convinced on how a delta has anything to do with the liquidity of an option bro, would love if you can explain that to me
•
u/NatGaz 22h ago
Let's say delta is 5% or 10%. How much would you quote ?
•
u/Eyoba_19 4h ago
So, I think I should've explained a bit about box spreads at first, but the issue is that for every strike you buy both the call and the put, so the delta is effectively 1 or -1
•
•
u/Puzzleheaded_Use_814 1d ago
It's quite bad... first because you are not scaling numbers properly, what makes you think 10,000 and 35 are comparable? How many times the min is dominated by left term versus right term?
Also, 1 option is not a comparable unit between different instruments, you need to sum the delta in USD or USD*vol, otherwise how can you compare 2 stocks with different price value?