Skip to content

Commit

Permalink
build: upgrade package version to 1.1.1
Browse files Browse the repository at this point in the history
fix: bug regarding "tx.wait(1)" never resolving when Flashbots provider is used
refactor: rename "helpers" to "utils"
build: fix issue re building Docker image on macOS
docs: update README.md
  • Loading branch information
scorpion9979 committed Aug 23, 2023
1 parent 41400ef commit 656e131
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-slim AS base
FROM --platform=linux/amd64 node:16-slim AS base
LABEL author="scorpion9979 <ahmed.i.tawefeeq@protonmail.com>"
WORKDIR /liquidator

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ $ docker-compose up
### Using Kubernetes

```bash
$ kubectl create configmap hifi-liquidator-js-config-map --from-literal=network-name=homestead --from-literal=persistence=true --from-literal=selected-account=0 --from-literal=silent-mode=false --from-literal=selected-strategy=uniswap-v3
$ kubectl create configmap hifi-liquidator-js-config-map --from-literal=network-name=homestead --from-literal=persistence-enabled=true --from-literal=selected-account=0 --from-literal=selected-strategy=uniswap-v3
$ kubectl create secret generic hifi-liquidator-js-secret --from-literal=alchemy-key="<ALCHEMY_KEY>" --from-literal=infura-key="<INFURA_KEY>" --from-literal=wallet-seed="<WALLET_SEED>"
$ kubectl apply -f persistentvolumeclaim.yaml
$ kubectl apply -f deployment.yaml
Expand Down
2 changes: 1 addition & 1 deletion deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
secretKeyRef:
name: hifi-liquidator-js-secret
key: wallet-seed
image: us-west3-docker.pkg.dev/liquidation-bots/hifi/hifi-liquidator-js:1.1.0
image: us-west3-docker.pkg.dev/liquidation-bots/hifi/hifi-liquidator-js:1.1.1
name: hifi-liquidator-js
resources:
limits:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hifi/liquidator-js",
"description": "Utility for automatically liquidating underwater accounts in Hifi",
"version": "1.1.0",
"version": "1.1.1",
"author": {
"name": "Hifi",
"email": "contact@hifi.finance",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getFlashbotsURL, isTrueString } from "./helpers";
import * as networkConfig from "./network-config.json";
import { Strategy as UniswapV2Strategy } from "./strategies/uniswap-v2";
import { Strategy as UniswapV3Strategy } from "./strategies/uniswap-v3";
import { NetworkName, StrategyName } from "./types";
import { getFlashbotsURL, isTrueString } from "./utils";
import { Wallet, providers, utils } from "ethers";

require("dotenv").config();
Expand Down
2 changes: 1 addition & 1 deletion src/strategies/base.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DUST_EPSILON, HTOKENS, LAST_SYNCED_BLOCK, VAULTS } from "../constants";
import { Logger, batchQueryFilter, initCache } from "../helpers";
import { StrategyArgs, Cache, Htokens, NetworkConfig, Vault, Vaults, StrategyName } from "../types";
import { Logger, batchQueryFilter, initCache } from "../utils";
import { IBalanceSheetV2 } from "@hifi/protocol/dist/types/contracts/core/balance-sheet/IBalanceSheetV2";
import { IHToken } from "@hifi/protocol/dist/types/contracts/core/h-token/IHToken";
import { BalanceSheetV2__factory } from "@hifi/protocol/dist/types/factories/contracts/core/balance-sheet/BalanceSheetV2__factory";
Expand Down
4 changes: 2 additions & 2 deletions src/strategies/uniswap-v2/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { UNISWAP_V2_INIT_CODE_HASH } from "../../constants";
import { addressesAreEqual, getUniswapV2PairInfo } from "../../helpers";
import { StrategyArgs } from "../../types";
import { addressesAreEqual, getUniswapV2PairInfo } from "../../utils";
import { BaseStrategy } from "../base";
import { MinInt256 } from "@ethersproject/constants";
import { IUniswapV2Pair } from "@hifi/flash-swap/dist/types/contracts/uniswap-v2/IUniswapV2Pair";
Expand Down Expand Up @@ -58,7 +58,7 @@ export class Strategy extends BaseStrategy {
const gasLimit = await contract.estimateGas.swap(...swapArgs);
const gasPrice = await contract.provider.getGasPrice();
const tx = await contract.swap(...swapArgs, { gasLimit, gasPrice });
const receipt = await tx.wait(1);
const receipt = await this.provider.waitForTransaction(tx.hash, 1, 600_000);
return receipt;
}
}
2 changes: 1 addition & 1 deletion src/strategies/uniswap-v3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class Strategy extends BaseStrategy {
const gasLimit = await this.flashUniswapV3.estimateGas.flashLiquidate(flashLiquidateArgs);
const gasPrice = await this.flashUniswapV3.provider.getGasPrice();
const tx = await this.flashUniswapV3.flashLiquidate(flashLiquidateArgs, { gasLimit, gasPrice });
const receipt = await tx.wait(1);
const receipt = await this.provider.waitForTransaction(tx.hash, 1, 600_000);
return receipt;
}
}
File renamed without changes.

0 comments on commit 656e131

Please sign in to comment.