beatzxbt / bybit-smm

bybit simple market maker
MIT License
398 stars 125 forks source link

Add functions for weighted mid_price. #2

Closed LevBeta closed 11 months ago

LevBeta commented 11 months ago

Functions are not coded for simplicity (reading) but more for performance.

2x the time for the simple mid_price, on my benchmark

This function uses the following formula:

$WMID = P^b (1 - I) + P^a I$

$I=\frac{Q_b}{Q_b+Q_a}$