Skip to content

Commit 1a2eb12

Browse files
committed
fix: update readme
1 parent 06c7c3f commit 1a2eb12

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

README.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Optional arguments:
1818
```
1919

2020
Your contracts config file should be in the following format where `uniswap` is the
21-
UniswapV2 WETH/DAI pair and `flashloan` is the [Flash.sol](./Flash.sol) contract.
21+
UniswapV2 WETH/DAI pair and `flashloan` is the [Flash](./Flash.sol) contract.
2222

2323
```
2424
{
@@ -29,7 +29,28 @@ UniswapV2 WETH/DAI pair and `flashloan` is the [Flash.sol](./Flash.sol) contract
2929
}
3030
```
3131

32-
## Demo
32+
## Building and Running
33+
34+
```
35+
cargo build --release
36+
./target/release/yield-liquidator \
37+
--config ./addrs.json \
38+
--private-key ./private_key \
39+
--url wss://kovan.infura.io/ws/v3/fd8b88b56aa84f6da87b60f5441d6778 \
40+
--interval 7000 \
41+
--file state.json \
42+
```
43+
44+
## How it Works
45+
46+
On each block:
47+
1. Checks if any of our submitted transactions have been mined
48+
2. Updates our dataset of borrowers debt health & liquidation auctions with the new block's data
49+
3. Trigger the auction for any undercollateralized borrowers
50+
4. Try participating in any auctions which are worth buying
51+
52+
53+
## Testing
3354

3455
### Local Testnet
3556

@@ -47,10 +68,16 @@ In another terminal, deploy the contracts: `npx truffle migrate --reset`
4768

4869
This deploys MakerDAO, Yield, UniswapV2, [Multicall](https://github.com/makerdao/multicall) and the Flashloan contract.
4970

50-
Now we run the liquidator (the Multicall address must be provided explicitly):
71+
Now we run the liquidator as before, by also including the `multicall` contract's address:
5172

5273
```
53-
RUST_LOG=yield_liquidator=trace cargo run -- --multicall D1Ed8059452f26360ba3DbD423cBfC955e9518cC
74+
{
75+
"controller" : "0xd160C973a098608e2D7d6E43C64Eee48766800D1",
76+
"liquidations" : "0xbC0200F0AAD7C1c0bBB1CC7885E1e796DFFac3e0",
77+
"uniswap": "0xbC0200F0AAD7C1c0bBB1CC7885E1e796DFFac3e0",
78+
"flashloan": "0xbC0200F0AAD7C1c0bBB1CC7885E1e796DFFac3e0"
79+
"multicall": "0xbC0200F0AAD7C1c0bBB1CC7885E1e796DFFac3e0"
80+
}
5481
```
5582

5683
Finally, you can create a liquidation opportunity by running `npx truffle exec scripts/create_liquidation_opportunity.js`.
@@ -98,16 +125,4 @@ Finally, you can create a liquidation opportunity by running:
98125
./src/set_eth_price.js 175
99126
```
100127

101-
## How it Works
102-
103-
On each block:
104-
1. Checks if any of our submitted transactions have been mined
105-
2. Updates our dataset of borrowers debt health & liquidation auctions with the new block's data
106-
3. Trigger the auction for any undercollateralized borrowers
107-
4. Try participating in any auctions which are worth buying
108-
109128
## Known Bugs
110-
111-
1. receipt & unknown decoding from RPC?
112-
2. too low nonce when used from the outside
113-
3. how to find uniswap situation. should price go up or down? how do we know? replace error with proper warning

0 commit comments

Comments
 (0)