-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Description
I plan on working on this. Any resources / API on how price impact can be found? Currently plan on looking at the bid / ask slab. Will traverse down bids until order size is filled. The price tick of this bid will be the new price, from which price impact will be calculated.
Pseudocode:
let unfilled_order_size = toAmount
let bids = [b1, b2, b3, ...]
let current_bid
for bid in bids {
current_bid = bid
unfilled_order_size -= bid.size
if unfilled_order_size <= 0 {
break
}
}
price_impact = mid_price - current_bid.price
price_impact_percentage = 100 * price_impact / mid_price
munanadi
Metadata
Metadata
Assignees
Labels
No labels