Last active
September 11, 2023 22:14
-
-
Save chuckbergeron/4f99b30698cefc605df5abeb1230c931 to your computer and use it in GitHub Desktop.
PoolTogether v5 Hyperstructure - Arbitrage Bot, Balance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Your Relayer (the EOA or "externally owned account") will be swapping POOL | |
// tokens, so it will need to have a POOL balance. | |
const relayerAddress = '0x49ca801A80e31B1ef929eAB13Ab3FBbAe7A55e8F'; | |
// Check if tokenIn balance for relayer (bot) account is sufficient | |
const tokenInContract = new ethers.Contract(tokenInAddress, ERC20Abi, writeProvider); | |
const tokenInBalance = await tokenInContract.balanceOf(relayerAddress); | |
const sufficientBalance = tokenInBalance.gt(exactAmountIn); | |
if (!sufficientBalance) { | |
console.warn('Insufficient POOL balance.') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment