{"id":13465240,"url":"https://github.com/yieldprotocol/yield-liquidator","last_synced_at":"2025-03-25T16:31:30.893Z","repository":{"id":45288099,"uuid":"285298429","full_name":"yieldprotocol/yield-liquidator","owner":"yieldprotocol","description":"Utility for force-closing undercollateralized Yield Protocol loans and participating in dutch auctions with liquidity sourced by Uniswap flash loans","archived":false,"fork":false,"pushed_at":"2021-01-17T12:42:27.000Z","size":246,"stargazers_count":224,"open_issues_count":1,"forks_count":54,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-08T07:02:32.337Z","etag":null,"topics":["ethereum","flashloan","keeper","liquidator","uniswap","yield-protocol"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/yieldprotocol.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}},"created_at":"2020-08-05T13:37:06.000Z","updated_at":"2025-02-21T10:31:31.000Z","dependencies_parsed_at":"2022-08-04T02:30:23.991Z","dependency_job_id":null,"html_url":"https://github.com/yieldprotocol/yield-liquidator","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/yieldprotocol%2Fyield-liquidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yieldprotocol%2Fyield-liquidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yieldprotocol%2Fyield-liquidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yieldprotocol%2Fyield-liquidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yieldprotocol","download_url":"https://codeload.github.com/yieldprotocol/yield-liquidator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245500200,"owners_count":20625521,"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":["ethereum","flashloan","keeper","liquidator","uniswap","yield-protocol"],"created_at":"2024-07-31T15:00:24.174Z","updated_at":"2025-03-25T16:31:30.612Z","avatar_url":"https://github.com/yieldprotocol.png","language":"Rust","readme":"# Yield Protocol Liquidator\n\nLiquidates undercollateralized fyDAI-ETH positions using Uniswap V2 as a capital source.\n\nThis liquidator altruistically calls the `Liquidations.liquidate` function for any\nposition that is underwater, trigerring an auction for that position. It then tries\nto participate in the auction by flashloaning funds from Uniswap, if there's enough\nprofit to be made.\n\n## CLI\n\n```\nUsage: ./yield-liquidator [OPTIONS]\n\nOptional arguments:\n  -h, --help\n  -c, --config CONFIG      path to json file with the contract addresses\n  -u, --url URL            the Ethereum node endpoint (HTTP or WS) (default: http://localhost:8545)\n  -p, --private-key PRIVATE-KEY\n                           path to your private key\n  -i, --interval INTERVAL  polling interval (ms) (default: 1000)\n  -f, --file FILE          the file to be used for persistence (default: data.json)\n  -m, --min-profit MIN-PROFIT\n                           the minimum profit per liquidation (default: 0)\n```\n\nYour contracts' `--config` file should be in the following format where `Uniswap` is the\nUniswapV2 WETH/DAI pair and `Flash` is the [Flashloan](./Flash.sol) contract.\n\n```\n{\n   \"Controller\" : \"0xd160C973a098608e2D7d6E43C64Eee48766800D1\",\n   \"Liquidations\" : \"0xbC0200F0AAD7C1c0bBB1CC7885E1e796DFFac3e0\",\n   \"Uniswap\": \"0xbC0200F0AAD7C1c0bBB1CC7885E1e796DFFac3e0\",\n   \"Flash\": \"0xbC0200F0AAD7C1c0bBB1CC7885E1e796DFFac3e0\"\n}\n```\n\nThe `--private-key` _must not_ have a `0x` prefix. Set the `interval` to 15s for mainnet.\n\n## Building and Running\n\n```\n# Build in release mode\ncargo build --release\n\n# Run it with \n./target/release/yield-liquidator \\\n    --config ./addrs.json \\\n    --private-key ./private_key \\\n    --url http://localhost:8545 \\\n    --interval 7000 \\\n    --file state.json \\\n```\n\n## How it Works\n\nOn each block:\n1. Bumps the gas price of all of our pending transactions\n2. Updates our dataset of borrowers debt health \u0026 liquidation auctions with the new block's data\n3. Trigger the auction for any undercollateralized borrowers\n4. Try participating in any auctions which are worth buying\n\nTake this liquidator for a spin by [running it in a test environment](TESTNET.md).\n","funding_links":[],"categories":["Projects using rust / ethers-rs"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyieldprotocol%2Fyield-liquidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyieldprotocol%2Fyield-liquidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyieldprotocol%2Fyield-liquidator/lists"}