Skip to content

Instantly share code, notes, and snippets.

@svanas
Last active Jul 14, 2022
Embed
What would you like to do?
Listen to swaps between two tokens on Balancer
const client: IWeb3 = TWeb3.Create(
web3.Ethereum,
web3.eth.infura.endpoint(web3.Ethereum, INFURA_PROJECT_ID)
);
const task = web3.eth.balancer.v2.listen(
client,
procedure(
blockNo : BigInteger;
poolId : TBytes32;
tokenIn : TAddress;
tokenOut : TAddress;
amountIn : BigInteger;
amountOut: BigInteger)
begin
// a swap between two tokens happened
end);
task.Start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment