Skip to content

Commit

Permalink
Merge pull request #66 from yuichiroaoki/update_conf
Browse files Browse the repository at this point in the history
Update conf
  • Loading branch information
yuichiroaoki authored Mar 15, 2022
2 parents 90085c0 + 36528f0 commit 893a05e
Show file tree
Hide file tree
Showing 13 changed files with 811 additions and 684 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ test
Dockerfile
.dockerignore
dist
.husky
.vscode

.yarn/*
!.yarn/patches
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v2
Expand Down
785 changes: 785 additions & 0 deletions .yarn/releases/yarn-3.2.0.cjs

Large diffs are not rendered by default.

631 changes: 0 additions & 631 deletions .yarn/releases/yarn-berry.cjs

This file was deleted.

4 changes: 2 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
yarnPath: .yarn/releases/yarn-berry.cjs

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.2.0.cjs
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ yarn start

Edit [src/config.ts](https://github.com/yuichiroaoki/poly-flashloan-bot/blob/main/src/config.ts)

[Optimal Bot Configuration](https://github.com/yuichiroaoki/poly-flashloan-bot/wiki/Optimal-Bot-Configuration)

If you have deployed your own contract, replace `flashloan address` to your deployed smart contract address.

```typescript
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"ts-node": "latest",
"typescript": "latest"
},
"packageManager": "yarn@3.0.2",
"packageManager": "yarn@3.2.0",
"lint-staged": {
"*.{js,json,md,sol,ts}": [
"prettier --config .prettierrc.json --write --ignore-unknown"
Expand Down
8 changes: 4 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { ERC20Token } from "./constants/addresses";
export const renderInterval = 1 * 1000;

// interval of price check (ms)
export const interval = 10 * 1000;
export const interval = 4 * 1000;

export const loanAmount = 1000;
export const loanAmount = 10000;
export const diffAmount = 10; // Not enough amount to return loan

//export const chainId = 1;// Ethereum
Expand All @@ -21,7 +21,7 @@ export const explorerURL = "https://polygonscan.com";
*/

export const baseTokens = [
ERC20Token.DAI,
// ERC20Token.DAI,
// ERC20Token.WETH,
ERC20Token.USDC,
ERC20Token.USDT,
Expand Down Expand Up @@ -53,7 +53,7 @@ export const protocols =
"POLYGON_SUSHISWAP,POLYGON_QUICKSWAP,POLYGON_APESWAP,POLYGON_JETSWAP,POLYGON_WAULTSWAP,POLYGON_UNISWAP_V3";

export const gasLimit = 15000000;
export const gasPrice = 30; // gwei
export const gasPrice = 100; // gwei

export const routeParts = [
[10000],
Expand Down
3 changes: 0 additions & 3 deletions src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,9 @@ export const ERC20Token: erc20Token = {
type PoolMap = { [pair: string]: string };

export const dodoV2Pool: PoolMap = {
USDC_DAI: "0xaaE10Fa31E73287687ce56eC90f81A800361B898",
USDT_DAI: "0xDa43a4aAB20D313Ab3AA07d8E09f3521F32a3D83",
WETH_USDC: "0x5333Eb1E32522F1893B7C9feA3c263807A02d561",
WMATIC_USDC: "0x10Dd6d8A29D489BEDE472CC1b22dc695c144c5c7",
USDT_USDC: "0xA0020444b98f67B77a3d6dE6E66aF11c87da086e",
WBTC_USDC: "0xe020008465cD72301A18b97d33D73bF44858A4b7",
};

type RouterMap = { [protocol: string]: string };
Expand Down
4 changes: 1 addition & 3 deletions src/flashloan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ const Flashloan = new ethers.Contract(
type testedPoolMap = { [erc20Address: string]: string[] };

const testedPools: testedPoolMap = {
DAI: [dodoV2Pool.USDC_DAI],
WETH: [dodoV2Pool.WETH_USDC],
USDC: [dodoV2Pool.WETH_USDC, dodoV2Pool.USDC_DAI],
USDT: [dodoV2Pool.USDT_DAI],
USDC: [dodoV2Pool.WETH_USDC],
WMATIC: [dodoV2Pool.WMATIC_USDC],
};

Expand Down
12 changes: 3 additions & 9 deletions test/checkBalanceDodo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@ describe("DODO pool check", () => {
for (const [name, poolAddr] of Object.entries(dodoV2Pool)) {
test(name, async () => {
const dodoPool = new ethers.Contract(poolAddr, DodoPool.abi, provider);
if (poolAddr !== dodoV2Pool.WBTC_USDC) {
expect(
(await dodoPool._BASE_RESERVE_()).gt(getBigNumber(10000, 6))
).toBe(true);
} else {
expect((await dodoPool._BASE_RESERVE_()).gt(getBigNumber(1, 8))).toBe(
true
);
}
expect(
(await dodoPool._BASE_RESERVE_()).gt(getBigNumber(10000, 6))
).toBe(true);
expect(
(await dodoPool._QUOTE_RESERVE_()).gt(getBigNumber(10000, 6))
).toBe(true);
Expand Down
21 changes: 0 additions & 21 deletions test/dodoPrice.test.ts

This file was deleted.

19 changes: 10 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Manual changes might be lost - proceed with caution!

__metadata:
version: 4
version: 6
cacheKey: 8

"@babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.0":
Expand All @@ -21,7 +21,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/core@npm:7.16.5, @babel/core@npm:^7.1.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.7.2, @babel/core@npm:^7.7.5":
"@babel/core@npm:^7.1.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.7.2, @babel/core@npm:^7.7.5":
version: 7.16.5
resolution: "@babel/core@npm:7.16.5"
dependencies:
Expand Down Expand Up @@ -2695,15 +2695,16 @@ dotenv@latest:
dependencies:
node-gyp: latest
checksum: 97ade64e75091afee5265e6956cb72ba34db7819b4c3e94c431d4be2b19b8bb7a2d4116da417950c3425f17c8fe693d25e20212cac583ac1521ad066b77ae31f
conditions: os=darwin
languageName: node
linkType: hard

"fsevents@patch:fsevents@^2.3.2#~builtin<compat/fsevents>, fsevents@patch:fsevents@~2.3.2#~builtin<compat/fsevents>":
version: 2.3.2
resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin<compat/fsevents>::version=2.3.2&hash=1cc4b2"
resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin<compat/fsevents>::version=2.3.2&hash=18f3a7"
dependencies:
node-gyp: latest
checksum: 78db9daf1f6526a49cefee3917cc988f62dc7f25b5dd80ad6de4ffc4af7f0cab7491ac737626ff53e482a111bc53aac9e411fe3602458eca36f6a003ecf69c16
conditions: os=darwin
languageName: node
linkType: hard

Expand Down Expand Up @@ -3592,7 +3593,7 @@ husky@latest:
languageName: node
linkType: hard

"jest-resolve@npm:27.4.5, jest-resolve@npm:^27.4.5":
"jest-resolve@npm:^27.4.5":
version: 27.4.5
resolution: "jest-resolve@npm:27.4.5"
dependencies:
Expand Down Expand Up @@ -4762,11 +4763,11 @@ resolve@^1.20.0:

"resolve@patch:resolve@^1.20.0#~builtin<compat/resolve>":
version: 1.20.0
resolution: "resolve@patch:resolve@npm%3A1.20.0#~builtin<compat/resolve>::version=1.20.0&hash=00b1ff"
resolution: "resolve@patch:resolve@npm%3A1.20.0#~builtin<compat/resolve>::version=1.20.0&hash=07638b"
dependencies:
is-core-module: ^2.2.0
path-parse: ^1.0.6
checksum: bed00be983cd20a8af0e7840664f655c4b269786dbd9595c5f156cd9d8a0050e65cdbbbdafc30ee9b6245b230c78a2c8ab6447a52545b582f476c29adb188cc5
checksum: a0dd7d16a8e47af23afa9386df2dff10e3e0debb2c7299a42e581d9d9b04d7ad5d2c53f24f1e043f7b3c250cbdc71150063e53d0b6559683d37f790b7c8c3cd5
languageName: node
linkType: hard

Expand Down Expand Up @@ -5487,11 +5488,11 @@ typescript@latest:

"typescript@patch:typescript@latest#~builtin<compat/typescript>":
version: 4.5.4
resolution: "typescript@patch:typescript@npm%3A4.5.4#~builtin<compat/typescript>::version=4.5.4&hash=32657b"
resolution: "typescript@patch:typescript@npm%3A4.5.4#~builtin<compat/typescript>::version=4.5.4&hash=bda367"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: db7fe40618f600c22a17db25bd727acbef509d8a4bd9a514f1b8c146f3cf9dd79478c5a8cd13c48a60d1ee4463319d9f72b6445f9e445f81bce6192d205d1811
checksum: eda87927f9cfb94aca9b5e47842daf37347ad3073133e17f556fbb6c18f3493c5b551eedab0f4b26774235ddb7acbe0087250d5285f72ce6819a0891dd5a74ed
languageName: node
linkType: hard

Expand Down

0 comments on commit 893a05e

Please sign in to comment.