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
When an overflow happen during DEX execution, the engine closes the specific position that was tentatively filled and restarts the process of routing and filling the batch. This approach is predicated on attributing the overflow onto a position (or trading function) rather than the specified swap input. But since trades are aggregated into batches, the effective upper bound on a batch is the minimum of u128::MAX, or all the the circulating supply for that token in the shielded pool. While processing such a large batch at once is unlikely, we still have to deal with the fact that approaching this number increases the likelihood of overflow occurring during internal dex calculations.
Solution
We should detect and split large batches into smaller chunks that are sequentially executed by the DEX engine (to avoid introducing any meaningful notion of economic ordering).
The text was updated successfully, but these errors were encountered:
Context
When an overflow happen during DEX execution, the engine closes the specific position that was tentatively filled and restarts the process of routing and filling the batch. This approach is predicated on attributing the overflow onto a position (or trading function) rather than the specified swap input. But since trades are aggregated into batches, the effective upper bound on a batch is the minimum of
u128::MAX
, or all the the circulating supply for that token in the shielded pool. While processing such a large batch at once is unlikely, we still have to deal with the fact that approaching this number increases the likelihood of overflow occurring during internal dex calculations.Solution
We should detect and split large batches into smaller chunks that are sequentially executed by the DEX engine (to avoid introducing any meaningful notion of economic ordering).
The text was updated successfully, but these errors were encountered: