Note that we forego querying the feeTo() parameter from the factory (which saves us an extra storage slot for the factory, an SREAD to get the factory address, and an external call to the factory) to save on gas fees which could add up to thousands of $ a year. This is only a problem during the time interval between Uniswap Governance toggling fees on/off and liquidity being added/removed from the pair. Even when this problem is "active" it leads to at most 0.05% divergence which is insignificant relative to the drift caused by the hop delay.
I still need to write tests for this, so PR is incomplete. I just wanted to get eyes early on the core logic change in
seek()
. The logic was grabbed from this open PR from the Uniswap repo: https://github.com/Uniswap/uniswap-v2-periphery/pull/49/files#diff-1ca606855db4c3aae71e6ff06e4d93cf326acb5eeaa92f38e7dde3143f80618aNote that we forego querying the
feeTo()
parameter from the factory (which saves us an extra storage slot for thefactory
, anSREAD
to get the factory address, and an external call to thefactory
) to save on gas fees which could add up to thousands of $ a year. This is only a problem during the time interval between Uniswap Governance toggling fees on/off and liquidity being added/removed from the pair. Even when this problem is "active" it leads to at most 0.05% divergence which is insignificant relative to the drift caused by thehop
delay.