properties icon indicating copy to clipboard operation
properties copied to clipboard

Adding UniswapV2 properties

Open tuturu-tech opened this issue 1 year ago • 1 comments

Initial draft of UniswapV2 basic properties.

Providing liquidity

  • always increases K
  • always increases LP token supply
  • always increases user LP token supply
  • never impacts token prices
  • always increases token reserves

Withdrawing liquidity

  • always decreases K
  • always decreases LP token supply
  • always decreases user LP token supply
  • never impacts token prices
  • always decreases token reserves

Swapping

  • never decreases K
  • swapping in both directions does not result in tokens gained
  • always increases user token out balance
  • price of tokenIn always decreases
  • price of tokenOut always increases

Blockers: Properties fail with ErrorUnrecognizedOpcode https://github.com/crytic/echidna/issues/984, so far haven't been able to figure out why Cons: Only tests UniswapV2 pair and router. Next step will be to generalize this so the properties can be easily used in a harness for testing UniV2-based AMMs

tuturu-tech avatar Jul 07 '23 15:07 tuturu-tech