{"id":16979273,"url":"https://github.com/yuichiroaoki/flash-swap-example","last_synced_at":"2025-03-22T15:30:32.703Z","repository":{"id":38350639,"uuid":"395476147","full_name":"yuichiroaoki/flash-swap-example","owner":"yuichiroaoki","description":"Example of Flash Swaps","archived":false,"fork":false,"pushed_at":"2021-08-13T03:50:11.000Z","size":156,"stargazers_count":80,"open_issues_count":2,"forks_count":37,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-18T12:04:32.990Z","etag":null,"topics":["ethtereum","flashswap","hardhat","kybernetwork","solidity","uniswap"],"latest_commit_sha":null,"homepage":"https://medium.com/coinmonks/tutorial-of-flash-swaps-of-uniswap-v3-73c0c846b822","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuichiroaoki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-13T00:23:48.000Z","updated_at":"2024-12-09T19:18:34.000Z","dependencies_parsed_at":"2022-09-21T11:20:24.476Z","dependency_job_id":null,"html_url":"https://github.com/yuichiroaoki/flash-swap-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuichiroaoki%2Fflash-swap-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuichiroaoki%2Fflash-swap-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuichiroaoki%2Fflash-swap-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuichiroaoki%2Fflash-swap-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuichiroaoki","download_url":"https://codeload.github.com/yuichiroaoki/flash-swap-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244978335,"owners_count":20541836,"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":["ethtereum","flashswap","hardhat","kybernetwork","solidity","uniswap"],"created_at":"2024-10-14T01:45:17.639Z","updated_at":"2025-03-22T15:30:32.101Z","avatar_url":"https://github.com/yuichiroaoki.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flash Swap Example\nExample of Flash Swaps\n\n## Installation and Setup\n\n### 1. Install [Node.js](https://nodejs.org/en/) \u0026 [yarn](https://classic.yarnpkg.com/en/docs/install/#windows-stable), if you haven't already.\n\n### 2. Clone This Repo\nRun the following command.\n```console\ngit clone https://github.com/yuichiroaoki/flash-swap-example.git\n```\n\n## Quickstart\nRight now this repo only works with hardhat mainnet fork.\n\n### 1. Setup Environment Variables\nYou'll need an ALCHEMY_MAINNET_RPC_URL environment variable. You can get one from [Alchemy website](https://alchemy.com/?r=33851811-6ecf-40c3-a36d-d0452dda8634) for free.\n\nThen, you can create a .env file with the following.\n\n```\nALCHEMY_MAINNET_RPC_URL='\u003cyour-own-alchemy-mainnet-rpc-url\u003e'\n```\n\n### 2. Install Dependencies\nRun the following command.\n```console\nyarn install\n```\n\n### 3. Compile Smart Contracts\nRun the following command.\n```console\nyarn compile\n```\n\n### 4. Execute Flash Swaps 🔥\nRun the following command.\n```console\nyarn flashswaps\n```\n\nExpected Outputs\n```\n$ yarn flashswaps\nyarn run v1.22.5\n$ npx hardhat run scripts/flashswaps.ts\nNo need to generate any newer typings.\ndeployer's initial balance 0\ndeployer's ending balance 4.860772792026915\nCongrats! You earned 4.860772792026915 DAI !!\nDone in 40.72s.\n```\n\n## References\n### PairFlash\nA sample flash swap contract from Uniswap official docs.\n\n[Docs](https://docs.uniswap.org/protocol/guides/flash-integrations/final-contract) / [GitHub](https://github.com/Uniswap/uniswap-v3-periphery/blob/flash-pair-example/contracts/examples/PairFlash.sol) / [Test](https://github.com/Uniswap/uniswap-v3-periphery/blob/flash-pair-example/test/PairFlash.spec.ts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuichiroaoki%2Fflash-swap-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuichiroaoki%2Fflash-swap-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuichiroaoki%2Fflash-swap-example/lists"}