The protocol specified its core invariant x * y = k
in README.md that doesn't account for any extra incentive given to encourage more trading among users. However in TSwapPool::_swap
, there's an extra output token incentive given to user upon every 10th swap. This breaks the protocol invariant resulting its core invariant doesn't hold anymore.
In TSwapPool::_swap
, the function implements a transfer of extra 1e18 output token to user upon every 10th swap. However, there's no corresponding adjustment on input token to balance back its core invariant of x * y = k
Add the following test to test/unit/TSwapPool.t.sol
The test above shows consistent delta after each swap but fails at 10th swap iteration indicating the protocol invariant is no longer hold as the amount of weth in the pool reduced with no adjustment made to the pool token to tune back the protocol invariant of x * y = k
Protocol invariant of x * y = k
doesn't hold when extra incentive token given to user upon 10th swap of their protocol trading usage, affecting the protocol logic and claimed core invariant feature
Manual review
The protocol shall consider either do the corresponding adjustment to the input token amount when an extra incentive of output token is given out upon the 10th swap. Alternatively, the protocol could just discard the scheme of giving out extra token to keep the core invariant stay unchanged.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.