@@ -18,7 +18,7 @@ Optional arguments:
18
18
```
19
19
20
20
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.
22
22
23
23
```
24
24
{
@@ -29,7 +29,28 @@ UniswapV2 WETH/DAI pair and `flashloan` is the [Flash.sol](./Flash.sol) contract
29
29
}
30
30
```
31
31
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
33
54
34
55
### Local Testnet
35
56
@@ -47,10 +68,16 @@ In another terminal, deploy the contracts: `npx truffle migrate --reset`
47
68
48
69
This deploys MakerDAO, Yield, UniswapV2, [ Multicall] ( https://github.com/makerdao/multicall ) and the Flashloan contract.
49
70
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 :
51
72
52
73
```
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
+ }
54
81
```
55
82
56
83
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:
98
125
./src/set_eth_price.js 175
99
126
```
100
127
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
-
109
128
## 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