├── .gitignore ├── all-data ├── amm └── maker-mcd ├── calc_mev.py ├── cff-models ├── execution.k ├── instability.k ├── intermediate.k ├── maker.k ├── mcd_maker.k ├── mev.k ├── simple.k ├── uniswap.k └── uniswapv2.k ├── data-scripts ├── active_region.py ├── configure.sh ├── exchanges.py ├── get_token_names.py ├── get_top_uniswapv2_pairs.py ├── get_uniswapv2_pairs.py ├── get_uniswapv2_relayers.py ├── get_uswap_logs.py ├── get_uswapv2_logs.py ├── persistence.py ├── uniswapv1_reserves.py ├── uniswapv2_reserves.py └── uniswapv2_trades.py ├── execution_times.sh ├── find_mev.py ├── find_mev_kprove_uniswapv2.py ├── find_mev_krun_maker.py ├── find_mev_krun_mcd.py ├── find_mev_krun_uniswapv2.py ├── find_mev_uniswapv1.py ├── find_mev_uniswapv2.py ├── find_risky_cdps.py ├── find_uniswap_bounds.py ├── kutils.py ├── maker-data ├── actions.py └── mcd │ ├── calc_cdp_state.py │ ├── configure.sh │ ├── get_core_maker_logs.py │ ├── maker_fees.py │ ├── maker_spot_prices.py │ └── parse_maker_logs.py ├── mcd_mev_from_logs.py ├── mev_from_logs.py ├── parse_output.py ├── plot_scripts ├── plot_convergence.py ├── plot_execution_times.py └── plot_mev.py ├── process_data.py ├── proofs ├── execution.k ├── instability.k ├── proof.k ├── run_proof.sh ├── toy.k └── uniswapv2.k ├── requirements.txt ├── run_all_experiments.sh ├── run_all_random_experiments.sh ├── run_convergence_experiments.sh ├── run_intractable_experiments.sh ├── run_liquidated_mcd_experiments.sh ├── run_maker_experiments.py ├── run_mcd_experiments.py ├── run_parallel_exp.py ├── run_parallel_exp.sh ├── run_random_experiments.sh ├── run_tractable_experiments.sh ├── run_uniswapv1_experiments.py ├── run_uniswapv1_experiments.sh ├── run_uniswapv2_experiments.py ├── tests ├── boundmaker.k ├── mevverification.k ├── test ├── test2 ├── test3 ├── test4 ├── test5 ├── test6 ├── test7 ├── test_maker ├── test_maker2 └── testlq ├── uniswap.py ├── uniswapv2.py └── validation └── validate.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/.gitignore -------------------------------------------------------------------------------- /all-data/amm: -------------------------------------------------------------------------------- 1 | ../data-scripts/ -------------------------------------------------------------------------------- /all-data/maker-mcd: -------------------------------------------------------------------------------- 1 | ../maker-data/mcd/ -------------------------------------------------------------------------------- /calc_mev.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/calc_mev.py -------------------------------------------------------------------------------- /cff-models/execution.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/cff-models/execution.k -------------------------------------------------------------------------------- /cff-models/instability.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/cff-models/instability.k -------------------------------------------------------------------------------- /cff-models/intermediate.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/cff-models/intermediate.k -------------------------------------------------------------------------------- /cff-models/maker.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/cff-models/maker.k -------------------------------------------------------------------------------- /cff-models/mcd_maker.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/cff-models/mcd_maker.k -------------------------------------------------------------------------------- /cff-models/mev.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/cff-models/mev.k -------------------------------------------------------------------------------- /cff-models/simple.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/cff-models/simple.k -------------------------------------------------------------------------------- /cff-models/uniswap.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/cff-models/uniswap.k -------------------------------------------------------------------------------- /cff-models/uniswapv2.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/cff-models/uniswapv2.k -------------------------------------------------------------------------------- /data-scripts/active_region.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/active_region.py -------------------------------------------------------------------------------- /data-scripts/configure.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/configure.sh -------------------------------------------------------------------------------- /data-scripts/exchanges.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/exchanges.py -------------------------------------------------------------------------------- /data-scripts/get_token_names.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/get_token_names.py -------------------------------------------------------------------------------- /data-scripts/get_top_uniswapv2_pairs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/get_top_uniswapv2_pairs.py -------------------------------------------------------------------------------- /data-scripts/get_uniswapv2_pairs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/get_uniswapv2_pairs.py -------------------------------------------------------------------------------- /data-scripts/get_uniswapv2_relayers.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/get_uniswapv2_relayers.py -------------------------------------------------------------------------------- /data-scripts/get_uswap_logs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/get_uswap_logs.py -------------------------------------------------------------------------------- /data-scripts/get_uswapv2_logs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/get_uswapv2_logs.py -------------------------------------------------------------------------------- /data-scripts/persistence.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/persistence.py -------------------------------------------------------------------------------- /data-scripts/uniswapv1_reserves.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/uniswapv1_reserves.py -------------------------------------------------------------------------------- /data-scripts/uniswapv2_reserves.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/uniswapv2_reserves.py -------------------------------------------------------------------------------- /data-scripts/uniswapv2_trades.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/data-scripts/uniswapv2_trades.py -------------------------------------------------------------------------------- /execution_times.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/execution_times.sh -------------------------------------------------------------------------------- /find_mev.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/find_mev.py -------------------------------------------------------------------------------- /find_mev_kprove_uniswapv2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/find_mev_kprove_uniswapv2.py -------------------------------------------------------------------------------- /find_mev_krun_maker.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/find_mev_krun_maker.py -------------------------------------------------------------------------------- /find_mev_krun_mcd.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/find_mev_krun_mcd.py -------------------------------------------------------------------------------- /find_mev_krun_uniswapv2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/find_mev_krun_uniswapv2.py -------------------------------------------------------------------------------- /find_mev_uniswapv1.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/find_mev_uniswapv1.py -------------------------------------------------------------------------------- /find_mev_uniswapv2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/find_mev_uniswapv2.py -------------------------------------------------------------------------------- /find_risky_cdps.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/find_risky_cdps.py -------------------------------------------------------------------------------- /find_uniswap_bounds.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/find_uniswap_bounds.py -------------------------------------------------------------------------------- /kutils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/kutils.py -------------------------------------------------------------------------------- /maker-data/actions.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/maker-data/actions.py -------------------------------------------------------------------------------- /maker-data/mcd/calc_cdp_state.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/maker-data/mcd/calc_cdp_state.py -------------------------------------------------------------------------------- /maker-data/mcd/configure.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/maker-data/mcd/configure.sh -------------------------------------------------------------------------------- /maker-data/mcd/get_core_maker_logs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/maker-data/mcd/get_core_maker_logs.py -------------------------------------------------------------------------------- /maker-data/mcd/maker_fees.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/maker-data/mcd/maker_fees.py -------------------------------------------------------------------------------- /maker-data/mcd/maker_spot_prices.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/maker-data/mcd/maker_spot_prices.py -------------------------------------------------------------------------------- /maker-data/mcd/parse_maker_logs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/maker-data/mcd/parse_maker_logs.py -------------------------------------------------------------------------------- /mcd_mev_from_logs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/mcd_mev_from_logs.py -------------------------------------------------------------------------------- /mev_from_logs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/mev_from_logs.py -------------------------------------------------------------------------------- /parse_output.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/parse_output.py -------------------------------------------------------------------------------- /plot_scripts/plot_convergence.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/plot_scripts/plot_convergence.py -------------------------------------------------------------------------------- /plot_scripts/plot_execution_times.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/plot_scripts/plot_execution_times.py -------------------------------------------------------------------------------- /plot_scripts/plot_mev.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/plot_scripts/plot_mev.py -------------------------------------------------------------------------------- /process_data.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/process_data.py -------------------------------------------------------------------------------- /proofs/execution.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/proofs/execution.k -------------------------------------------------------------------------------- /proofs/instability.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/proofs/instability.k -------------------------------------------------------------------------------- /proofs/proof.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/proofs/proof.k -------------------------------------------------------------------------------- /proofs/run_proof.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/proofs/run_proof.sh -------------------------------------------------------------------------------- /proofs/toy.k: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /proofs/uniswapv2.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/proofs/uniswapv2.k -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | matplotlib 2 | pandas 3 | -------------------------------------------------------------------------------- /run_all_experiments.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_all_experiments.sh -------------------------------------------------------------------------------- /run_all_random_experiments.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_all_random_experiments.sh -------------------------------------------------------------------------------- /run_convergence_experiments.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_convergence_experiments.sh -------------------------------------------------------------------------------- /run_intractable_experiments.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_intractable_experiments.sh -------------------------------------------------------------------------------- /run_liquidated_mcd_experiments.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_liquidated_mcd_experiments.sh -------------------------------------------------------------------------------- /run_maker_experiments.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_maker_experiments.py -------------------------------------------------------------------------------- /run_mcd_experiments.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_mcd_experiments.py -------------------------------------------------------------------------------- /run_parallel_exp.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_parallel_exp.py -------------------------------------------------------------------------------- /run_parallel_exp.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_parallel_exp.sh -------------------------------------------------------------------------------- /run_random_experiments.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_random_experiments.sh -------------------------------------------------------------------------------- /run_tractable_experiments.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_tractable_experiments.sh -------------------------------------------------------------------------------- /run_uniswapv1_experiments.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_uniswapv1_experiments.py -------------------------------------------------------------------------------- /run_uniswapv1_experiments.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_uniswapv1_experiments.sh -------------------------------------------------------------------------------- /run_uniswapv2_experiments.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/run_uniswapv2_experiments.py -------------------------------------------------------------------------------- /tests/boundmaker.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/tests/boundmaker.k -------------------------------------------------------------------------------- /tests/mevverification.k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/tests/mevverification.k -------------------------------------------------------------------------------- /tests/test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/tests/test -------------------------------------------------------------------------------- /tests/test2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/tests/test2 -------------------------------------------------------------------------------- /tests/test3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/tests/test3 -------------------------------------------------------------------------------- /tests/test4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/tests/test4 -------------------------------------------------------------------------------- /tests/test5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/tests/test5 -------------------------------------------------------------------------------- /tests/test6: -------------------------------------------------------------------------------- 1 | 0 in 100 gets 10; 2 | -------------------------------------------------------------------------------- /tests/test7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/tests/test7 -------------------------------------------------------------------------------- /tests/test_maker: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/tests/test_maker -------------------------------------------------------------------------------- /tests/test_maker2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/tests/test_maker2 -------------------------------------------------------------------------------- /tests/testlq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/tests/testlq -------------------------------------------------------------------------------- /uniswap.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/uniswap.py -------------------------------------------------------------------------------- /uniswapv2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/uniswapv2.py -------------------------------------------------------------------------------- /validation/validate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defi-formal/cff/HEAD/validation/validate.py --------------------------------------------------------------------------------