{"id":20433910,"url":"https://github.com/flashbots/mev-geth-demo","last_synced_at":"2026-01-23T14:44:27.616Z","repository":{"id":42680710,"uuid":"319278589","full_name":"flashbots/mev-geth-demo","owner":"flashbots","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-11T21:13:02.000Z","size":1585,"stargazers_count":99,"open_issues_count":0,"forks_count":39,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-11-15T00:05:39.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flashbots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-07T10:09:22.000Z","updated_at":"2025-08-13T16:00:49.000Z","dependencies_parsed_at":"2024-11-15T08:34:58.334Z","dependency_job_id":null,"html_url":"https://github.com/flashbots/mev-geth-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flashbots/mev-geth-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fmev-geth-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fmev-geth-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fmev-geth-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fmev-geth-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flashbots","download_url":"https://codeload.github.com/flashbots/mev-geth-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fmev-geth-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28694457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T14:15:13.573Z","status":"ssl_error","status_checked_at":"2026-01-23T14:09:05.534Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-15T08:22:27.184Z","updated_at":"2026-01-23T14:44:27.600Z","avatar_url":"https://github.com/flashbots.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MEV GETH Demo\n\nLaunches an MEV GETH node, and shows how a miner may profit from it by accepting MEV\nbundles either via direct `block.coinbase` smart contract \"bribes\", or with extra transactions that pay\nthe block's coinbase if it's known ahead of time.\n\n## Quickstart\n\n```\ngit clone https://github.com/flashbots/mev-geth\ncd mev-geth \u0026\u0026 make geth \u0026\u0026 cd ..\ngit clone https://github.com/flashbots/mev-geth-demo\ncd mev-geth-demo\nyarn\nGETH=../mev-geth/build/bin/geth ./run.sh\nyarn run demo-simple\nyarn run demo-contract\n```\n\n## Bundle Submission\n\n### Direct miner transfer\n\n```javascript\nimport { ethers } from 'ethers'\nimport { FlashbotsBundleProvider } from \"ethers-flashbots\";\n\n// create the base provider\nlet base = new ethers.providers.JsonRpcProvider(\"http://localhost:8545\")\n// wrap it with the mev-geth provider, the Flashbots MEV-GETH node can be on a different host/port\nlet provider = new FlashbotsBundleProvider(base, \"http://mev-geth-api.com\")\n\nconst user = ethers.Wallet.createRandom().connect(provider)\nconst nonce = await user.getTransactionCount()\n\nconst COINBASE_ADDRESS = \"0x2222222222222222222222222222222222222222\"\nconst bribe = ethers.utils.parseEther('0.042')\nconst txs = [\n    {\n        signer: user,\n        transaction: {\n            to: \"0x1111111111111111111111111111111111111111\",\n            value: ethers.utils.parseEther('0.1'),\n            nonce: nonce,\n        },\n    },\n    {\n        signer: user,\n        transaction: {\n            // The coinbase address of the mining pool of your choice\n            to: COINBASE_ADDRESS,\n            value: bribe,\n            nonce: nonce + 1,\n        }\n    },\n]\n\nconst blk = await provider.getBlockNumber()\n// `result` contains the tx hashes for all txs in the bundle\nconst result = await provider.sendBundle(txs, blk + 1);\nawait result.wait()\n```\n\n### Contract Transfer\n\n```javascript\nimport { ethers } from 'ethers'\nimport { FlashbotsBundleProvider } from \"ethers-flashbots\";\n\n// create the base provider\nlet base = new ethers.providers.JsonRpcProvider(\"http://localhost:8545\")\n// wrap it with the mev-geth provider, the Flashbots MEV-GETH node can be on a different host/port\nlet provider = new FlashbotsBundleProvider(base, \"http://mev-geth-api.com\")\nconst user = ethers.Wallet.createRandom().connect(provider)\n\n// We assume the following contract is deployed:\n// \n// contract Bribe {\n//     function bribe() payable public {\n//         // do whatever else you want here.\n//         block.coinbase.transfer(msg.value);\n//   }\n// }\nconst ADDRESS = \"0x1111111111111111111111111111111111111111\"\nconst ABI = [\"function bribe() payable\"]\nconst contract = new ethers.Contract(ADDRESS, ABI, user)\n\nconst txs = [\n  {\n      signer: user,\n      transaction: await contract.populateTransaction.bribe({\n        value: ethers.utils.parseEther(\"0.216321768999\"),\n      })\n  },\n];\n\nconst blk = await provider.getBlockNumber()\n// `result` contains the tx hashes for all txs in the bundle\nconst result = await provider.sendBundle(txs, blk + 1);\nawait result.wait()\n```\n\n## Expected Outputs\n\nThe scripts should give you the following outputs (re-run if they fail, the test may be flaky due to timing):\n\n### Simple\n\n```\nyarn run demo-simple\nyarn run v1.22.4\n$ ts-node scripts/demo.ts\nFaucet 0xd912AeCb07E9F4e1eA8E6b4779e7Fb6Aa1c3e4D8\nFunding account...this may take a while due to DAG generation in the PoW testnet\nOK\nBalance: 1000000000000000000\nSubmitting bundle\nnull\n{\n  minimumNonceByAccount: { '0x203f54b5F444552447aC71e26EB5AC3f5e3dfaC9': 1 }\n}\nblockNumber: 16\nblockNumber: 17\nblockNumber: 18\nblockNumber: 19\nblockNumber: 20\nblockNumber: 21\nBundle mined\nTransaction mined {\n  to: '0xd912AeCb07E9F4e1eA8E6b4779e7Fb6Aa1c3e4D8',\n  from: '0x203f54b5F444552447aC71e26EB5AC3f5e3dfaC9',\n  contractAddress: null,\n  transactionIndex: 1,\n  gasUsed: BigNumber { _hex: '0x5208', _isBigNumber: true },\n  logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n  blockHash: '0x746e55600e4c8e99d086c9437a2029ddb5977c386cc9638de1e7734fe932108c',\n  transactionHash: '0x2d78109fb01f205685049c5870d5ff5ccc3e7059757cc31a113ae23d5a0e692a',\n  logs: [],\n  blockNumber: 17,\n  confirmations: 10,\n  cumulativeGasUsed: BigNumber { _hex: '0xa410', _isBigNumber: true },\n  status: 1,\n  byzantium: true\n}\nMiner before 1031000000000000000000\nMiner after 1033066666666660000000\nProfit (ETH) 0.06666666666\nProfit equals bribe? true\n✨  Done in 15.48s.\n```\n\n### Contract\n\n```\nyarn run demo-contract                                                    \u003c\u003c\u003c\nyarn run v1.22.4\n$ ts-node scripts/contract-bribe-demo.ts\nFunding account...this may take a while due to DAG generation in the PoW testnet\nDeploying bribe contract...\nDeployed at: 0x8A7946D23E5096E8d7C81327d4608454B9c5CF8b\nSubmitting bundle\nnull\n{\n  minimumNonceByAccount: { '0x23C9f032F8763a884e6ce6df838ebf5aEdc4B236': 1 }\n}\nblockNumber: 90\nblockNumber: 91\nblockNumber: 92\nblockNumber: 93\nblockNumber: 94\nBundle mined\nTransaction mined {\n  to: '0x8A7946D23E5096E8d7C81327d4608454B9c5CF8b',\n  from: '0x23C9f032F8763a884e6ce6df838ebf5aEdc4B236',\n  contractAddress: null,\n  transactionIndex: 0,\n  gasUsed: BigNumber { _hex: '0x70c8', _isBigNumber: true },\n  logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n  blockHash: '0x4e9a4c65b650dafaf4fb11856bbc6b74eb1050cba719d7a6d50518429035feb8',\n  transactionHash: '0x7f9f615ec4dd49131d9d7722b036c7d7bf506983138e063a762a656b7e4c4346',\n  logs: [],\n  blockNumber: 91,\n  confirmations: 9,\n  cumulativeGasUsed: BigNumber { _hex: '0x70c8', _isBigNumber: true },\n  status: 1,\n  byzantium: true\n}\nMiner before 1177066666666660000000\nMiner after 1179282988435659000000\nProfit (ETH) 0.216321768999\nProfit equals bribe? true\n✨  Done in 24.23s.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fmev-geth-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashbots%2Fmev-geth-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fmev-geth-demo/lists"}