Skip to content

Commit

Permalink
Fix up last lint error for unspecified return type
Browse files Browse the repository at this point in the history
  • Loading branch information
epheph committed Jan 4, 2021
1 parent 91c47e1 commit 58104c4
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Arbitrage.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export interface CrossedMarketDetails {
sellToMarket: EthMarket,
}

type MarketsByToken = { [tokenAddress: string]: Array<EthMarket> }
export type MarketsByToken = { [tokenAddress: string]: Array<EthMarket> }

// TODO: implement binary search (assuming linear/exponential global maximum profitability)
const TEST_VOLUMES = [
8 changes: 7 additions & 1 deletion src/UniswappyV2EthPair.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import { UNISWAP_PAIR_ABI, UNISWAP_QUERY_ABI } from "./abi";
import { UNISWAP_LOOKUP_CONTRACT_ADDRESS, WETH_ADDRESS } from "./addresses";
import { CallDetails, EthMarket, MultipleCallData, TokenBalances } from "./EthMarket";
import { ETHER } from "./utils";
import { MarketsByToken } from "./Arbitrage";

// batch count limit helpful for testing, loading entire set of uniswap markets takes a long time to load
const BATCH_COUNT_LIMIT = 100;
@@ -15,6 +16,11 @@ const blacklistTokens = [
'0xD75EA151a61d06868E31F8988D28DFE5E9df57B4'
]

interface GroupedMarkets {
marketsByToken: MarketsByToken;
allMarketPairs: Array<UniswappyV2EthPair>;
}

export class UniswappyV2EthPair extends EthMarket {
static uniswapInterface = new Contract(WETH_ADDRESS, UNISWAP_PAIR_ABI);
private _tokenBalances: TokenBalances
@@ -70,7 +76,7 @@ export class UniswappyV2EthPair extends EthMarket {
return marketPairs
}

static async getUniswapMarketsByToken(provider: providers.JsonRpcProvider, factoryAddresses: Array<string>) {
static async getUniswapMarketsByToken(provider: providers.JsonRpcProvider, factoryAddresses: Array<string>): Promise<GroupedMarkets> {
const allPairs = await Promise.all(
_.map(factoryAddresses, factoryAddress => UniswappyV2EthPair.getUniswappyMarkets(provider, factoryAddress))
)
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FlashbotsBundleProvider } from "@flashbots/ethers-provider-bundle";
import { BigNumber, Contract, providers, Wallet } from "ethers";
import { Contract, providers, Wallet } from "ethers";
import { BUNDLE_EXECUTOR_ABI } from "./abi";
import { UniswappyV2EthPair } from "./UniswappyV2EthPair";
import { FACTORY_ADDRESSES } from "./addresses";

0 comments on commit 58104c4

Please sign in to comment.