TSWAP protocol relies on maintaining a constant product invariant for its liquidity pools. The invariant formula, š„ā
š¦=š , where
š„ and š¦ are the reserves of two tokens in the pool, ensures balanced trading and liquidity provision. Tokens that implement a fee on transfer mechanism can disrupt this invariant, leading to potential issues within the protocol.
Fee on transfer tokens impose a fee whenever they are transferred between addresses. This means that the amount of tokens sent is not equal to the amount of tokens received. When such tokens are used within TSWAP pools, the constant product invariant xā y=k no longer holds due to the reduced token amount post-transfer.
For example, if a token with a 1% transfer fee is involved, transferring 100 tokens will result in only 99 tokens being received. This discrepancy breaks the TSWAP invariant, causing the liquidity pool to miscalculate reserves and leading to imbalanced pools.
Incorrect Pricing: The pool will miscalculate token prices due to incorrect reserve balances, leading to potentially unfair trades and arbitrage opportunities.
Liquidity Provider Losses: Liquidity providers might incur unexpected losses as their share of the pool's value can decrease due to the miscalculation.
Deploy a token contract implementing a fee on transfer mechanism (e.g., a 1% fee on each transfer).
Create a TSWAP liquidity pool with this token and another standard token.
Perform a swap on TSWAP involving the fee on transfer token.
Observe the incorrect pricing and reserve imbalance in the pool due to the fee deducted during the token transfer.
Manual Review
Token Compatibility Check: Ensure that tokens added to Tswap pools do not implement a fee on transfer mechanism.
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.