You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: