Skip to content

Commit

Permalink
Fixed incorrect swap amount handling
Browse files Browse the repository at this point in the history
  • Loading branch information
igorsereda committed Feb 6, 2025
1 parent 6262105 commit e003d8b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dex_screener/service/dex/omnipool/omnipool_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ async def register_swap(cls, event: SubstrateEvent[OmnipoolBuyExecutedPayload |

case _:
raise InvalidEventDataError(f'Unhandled Omnipool Swap Event: {event}.')
if minor_amount_in * minor_amount_out == 0:
cls.logger.warning('Invalid Swap Event: minor amount must be natural!')
return

asset_in = await Asset.get(id=asset_in_id)
asset_out = await Asset.get(id=asset_out_id)
Expand Down

0 comments on commit e003d8b

Please sign in to comment.