Interpreting Swap / LP events
Let's look into Swap/Liquidity Provision(=yield farming) example transactions to decode what happened!
Vault contract in Linea : here
both swap and LPing emits the same topic0,
Swap(address indexed pool, address indexed user, bytes32[] tokenRef, int128[] delta).
topic0: 0xbaec78ca3218aba6fc32d82b79acdd1a47663d7b8da46e0c00947206d08f2071
zip(tokenRef, delta) indicates the tokens and their amounts.
Example 1 : Swap
You could know these from the Logs above.
You should interpret sign(+ or -) in target pool's perspective. Negetive for USDC since USDC are removed from the pool and positive for ETH since it is added to the pool. See here for the details : How to interact with VELOCORE
Example 2 : Adding liquidity
Last updated