We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi team,
Thanks for the great package!
I found the current price and size calculation for the fill event (SIDE = BUY) in the below links may be wrong at least for Dex V3.
pyserum/pyserum/market/core.py
Lines 104 to 107 in d0938e9
The potential update will be. Reference from
https://github.com/project-serum/serum-ts/blob/4cdea04ffbc6fd68392d8f8608ba5c7524007d4e/packages/serum/src/market.ts#L1138-L1164
if event.event_flags.bid: side = Side.BUY price_before_fees = ( event.native_quantity_paid + event.native_fee_or_rebate if event.event_flags.maker else event.native_quantity_paid - event.native_fee_or_rebate ) price = (price_before_fees * self.state.base_spl_token_multiplier()) / ( self.state.quote_spl_token_multiplier() * event.native_quantity_released ) size = event.native_quantity_released / self.state.base_spl_token_multiplier() else: side = Side.SELL price_before_fees = ( event.native_quantity_released - event.native_fee_or_rebate if event.event_flags.maker else event.native_quantity_released + event.native_fee_or_rebate ) price = (price_before_fees * self.state.base_spl_token_multiplier()) / ( self.state.quote_spl_token_multiplier() * event.native_quantity_paid ) size = event.native_quantity_paid / self.state.base_spl_token_multiplier()
The text was updated successfully, but these errors were encountered:
Hey @pgCanal , do you mind creating a PR for this?
Sorry, something went wrong.
No branches or pull requests
Hi team,
Thanks for the great package!
I found the current price and size calculation for the fill event (SIDE = BUY) in the below links may be wrong at least for Dex V3.
pyserum/pyserum/market/core.py
Lines 104 to 107 in d0938e9
The potential update will be. Reference from
https://github.com/project-serum/serum-ts/blob/4cdea04ffbc6fd68392d8f8608ba5c7524007d4e/packages/serum/src/market.ts#L1138-L1164
The text was updated successfully, but these errors were encountered: