Skip to content

Instantly share code, notes, and snippets.

@chuckbergeron
Last active September 11, 2023 19:27
Show Gist options
  • Save chuckbergeron/360ec7686f4a2a10c15573370a1c6fd6 to your computer and use it in GitHub Desktop.
Save chuckbergeron/360ec7686f4a2a10c15573370a1c6fd6 to your computer and use it in GitHub Desktop.
PoolTogether v5 Hyperstructure - Arbitrage Bot, Finding Liquidation Pairs
const liquidationPairFactoryContract = new ethers.Contract(
liquidationPairFactoryAddress,
LiquidationPairFactoryAbi,
readProvider
);
let liquidationPairContracts: Contract[] = [];
const numPairs = await liquidationPairFactoryContract.totalPairs();
for (let i = 0; i < numPairs; i++) {
const liquidationPairAddress =
await liquidationPairFactoryContract.allPairs(i);
const liquidationPairContract = new ethers.Contract(
liquidationPairAddress,
LiquidationPairAbi,
readProvider
);
liquidationPairContracts.push(liquidationPairContract);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment