@@ -10,6 +10,7 @@ import {
1010 updateTokenBalances ,
1111 bytesToAddress ,
1212 getPoolShare ,
13+ createUserEntity ,
1314} from './helpers/misc' ;
1415import { updatePoolWeights } from './helpers/weighted' ;
1516import { SWAP_IN , SWAP_OUT , VAULT_ADDRESS , ZERO , ZERO_ADDRESS , ZERO_BD } from './helpers/constants' ;
@@ -83,7 +84,7 @@ function handlePoolJoined(event: PoolBalanceChanged): void {
8384 join . type = 'Join' ;
8485 join . amounts = joinAmounts ;
8586 join . pool = event . params . poolId . toHexString ( ) ;
86- join . user = event . params . liquidityProvider ;
87+ join . user = event . params . liquidityProvider . toHexString ( ) ;
8788 join . timestamp = blockTimestamp ;
8889 join . tx = transactionHash ;
8990 join . block = event . block . number ;
@@ -183,7 +184,7 @@ function handlePoolExited(event: PoolBalanceChanged): void {
183184 exit . type = 'Exit' ;
184185 exit . amounts = exitAmounts ;
185186 exit . pool = event . params . poolId . toHexString ( ) ;
186- exit . user = event . params . liquidityProvider ;
187+ exit . user = event . params . liquidityProvider . toHexString ( ) ;
187188 exit . timestamp = blockTimestamp ;
188189 exit . tx = transactionHash ;
189190 exit . block = event . block . number ;
@@ -220,6 +221,7 @@ function handlePoolExited(event: PoolBalanceChanged): void {
220221 ************** SWAPS ***************
221222 ************************************/
222223export function handleSwapEvent ( event : SwapEvent ) : void {
224+ createUserEntity ( event . transaction . from ) ;
223225 let poolId = event . params . poolId ;
224226
225227 let pool = Pool . load ( poolId . toHexString ( ) ) ;
@@ -336,7 +338,7 @@ export function handleSwapEvent(event: SwapEvent): void {
336338 swap . tokenAmountOut = tokenAmountOut ;
337339
338340 swap . caller = event . transaction . from ;
339- swap . userAddress = event . transaction . from ;
341+ swap . userAddress = event . transaction . from . toHex ( ) ;
340342 swap . poolId = poolId . toHex ( ) ;
341343
342344 swap . timestamp = blockTimestamp ;
0 commit comments