{"id":21470684,"url":"https://github.com/manifoldfinance/bundle-simulator","last_synced_at":"2025-07-15T07:31:27.595Z","repository":{"id":52213517,"uuid":"472788852","full_name":"manifoldfinance/bundle-simulator","owner":"manifoldfinance","description":"Standalone simulator for debugging bundles","archived":false,"fork":false,"pushed_at":"2022-07-07T12:31:59.000Z","size":43,"stargazers_count":26,"open_issues_count":1,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-05-19T00:36:35.172Z","etag":null,"topics":["brownie","bundle","ethereum","flashbots","foundry","mev","nix","simulator","solidity"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manifoldfinance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-22T13:51:00.000Z","updated_at":"2024-05-16T11:24:14.000Z","dependencies_parsed_at":"2022-09-09T09:40:30.341Z","dependency_job_id":null,"html_url":"https://github.com/manifoldfinance/bundle-simulator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manifoldfinance%2Fbundle-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manifoldfinance%2Fbundle-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manifoldfinance%2Fbundle-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manifoldfinance%2Fbundle-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manifoldfinance","download_url":"https://codeload.github.com/manifoldfinance/bundle-simulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226027923,"owners_count":17562134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brownie","bundle","ethereum","flashbots","foundry","mev","nix","simulator","solidity"],"created_at":"2024-11-23T09:28:43.405Z","updated_at":"2024-11-23T09:28:44.243Z","avatar_url":"https://github.com/manifoldfinance.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bundle Simulator\n\nStandalone repo for simulating specific bundles that need debugging.\n\n## Requirements\n\nHave installed the following:\n\n- Nix (or Brownie directly)\n- ganache-cli (npm install ganache-cli)\n\n## Use Brownie\n\nJust issue the following command:\n\n```sh\nnix-shell\n```\n\nAfter a couple of minutes you should be inside of `nix-shell` with brownie in our `PATH`. We can quickly double check with:\n\n```sh\nwhich brownie\n```\n\n## Run simulations\n\nUse `scripts/backrun_test1.py` as a template to construct bundle specifics. Note also the target block number for the bundle.\n\n### Create a fork\n\nBy default brownie includes a list of providers that can be checked with:\n\n```sh\nbrownie networks list\n```\n\nCreate a fork at a specific block for the bundle. Note that the fork will need to occur at target block number - 1.\n\n```sh\nbrownie networks add development backrun1 cmd=\"ganache-cli\" host=http://127.0.0.1 fork=\"$ETH_RPC_URL@14430476\" accounts=10 mnemonic=brownie port=8545 timeout=100\n```\n\n### Run script\n\n```sh\nbrownie run backrun_test1.py --network backrun1\n```\n\nResult:\n\n```python\nRunning 'scripts/backrun_test1.py::main'...\n\nDeploy flashloan contract\nTransaction sent: 0xf4223827831aea7b60c3169ebf1191c22a84cd104708ec050e6da07e36a06fac\n  Gas price: 0.0 gwei   Gas limit: 6721975   Nonce: 34\n  AaveFlashloanMultiRouter.constructor confirmed   Block: 14430478   Gas used: 1930680 (28.72%)\n  AaveFlashloanMultiRouter deployed at: 0xa54A0c47330a78E2C1abcD22BB477Dc760fC77b5\n\nApproving User swap\nTransaction sent: 0x04cc7d99ed3fd237f535960f9cc2a52135e5d0a1bd8b5bde295f9dccd86a7e70\n  Gas price: 0.0 gwei   Gas limit: 6721975   Nonce: 19\n  Transaction confirmed   Block: 14430479   Gas used: 30103 (0.45%)\n\nUser swap\nTransaction sent: 0x5399fef87774f51195ebaf854e9fd75b5ec1a71eeb73c14a7a2a56a22b88b975\n  Gas price: 0.0 gwei   Gas limit: 6721975   Nonce: 20\n  Transaction confirmed   Block: 14430480   Gas used: 156025 (2.32%)\n\nBackrun arb\nPlatform pre-arb weth balance:  1113136168719190148\nTransaction sent: 0x97ce6a340493a7332cfb7ca395e022c5bc7d8acbc9d334661d60ceba4d76d440\n  Gas price: 0.0 gwei   Gas limit: 6721975   Nonce: 35\n  AaveFlashloanMultiRouter.call confirmed   Block: 14430481   Gas used: 443855 (6.60%)\n\nPlatform post-arb weth balance:  1160664762353910714\n```\n\n### Debugging\n\n[See Brownie docs for info on tx tracing](https://eth-brownie.readthedocs.io/en/stable/core-transactions.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanifoldfinance%2Fbundle-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanifoldfinance%2Fbundle-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanifoldfinance%2Fbundle-simulator/lists"}