Using the PerpAccount class
mcshel opened this issue · comments
mpetac commented
Hi,
I am trying to use getAverageOpenPrice()
function of the PerpAccount
class, but I am missing some documentation / examples. What exactly is the events
argument? Is there perhaps some other way of getting the "Avg Entry Price" that is displayed on the Web UI of the exchange?
Thanks for your help in advance!
Maximilian Schneider commented
Events should contain trade history filtered for the current market. See usage here: https://github.com/blockworks-foundation/mango-ui-v3/blob/2d824c22138e30be6d9600ec52392d58bb5cc774/hooks/usePerpPositions.tsx#L43