Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Incorporate Protocol fee within Uniswap v3 swap simulation. #41

Open
0xKitsune opened this issue Jan 2, 2023 · 0 comments
Open

Incorporate Protocol fee within Uniswap v3 swap simulation. #41

0xKitsune opened this issue Jan 2, 2023 · 0 comments

Comments

@0xKitsune
Copy link
Owner

For Uniswap V3 Swap simulation, the protocol needs to be incorporated.

     // if the protocol fee is on, calculate how much is owed, decrement feeAmount, and increment protocolFee
            if (cache.feeProtocol > 0) {
                uint256 delta = step.feeAmount / cache.feeProtocol;
                step.feeAmount -= delta;
                state.protocolFee += uint128(delta);
            }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant