@@ -107,6 +107,10 @@ interface IPool:
107
107
def reserve1 () -> uint256 : view
108
108
def claimable0 (_account: address ) -> uint256 : view
109
109
def claimable1 (_account: address ) -> uint256 : view
110
+ def supplyIndex0 (_account: address ) -> uint256 : view
111
+ def supplyIndex1 (_account: address ) -> uint256 : view
112
+ def index0 () -> uint256 : view
113
+ def index1 () -> uint256 : view
110
114
def totalSupply () -> uint256 : view
111
115
def symbol () -> String[100 ]: view
112
116
def decimals () -> uint8 : view
@@ -353,6 +357,17 @@ def _byData(_data: address[3], _account: address) -> Lp:
353
357
token0: IERC20 = IERC20 (pool.token0 ())
354
358
token1: IERC20 = IERC20 (pool.token1 ())
355
359
gauge_alive: bool = self .voter.isAlive (gauge.address )
360
+ acc_balance: uint256 = pool.balanceOf (_account)
361
+
362
+ claimable0: uint256 = pool.claimable0 (_account)
363
+ claimable1: uint256 = pool.claimable1 (_account)
364
+ claimable_delta0: uint256 = pool.index0 () - pool.supplyIndex0 (_account)
365
+ claimable_delta1: uint256 = pool.index1 () - pool.supplyIndex1 (_account)
366
+
367
+ if claimable_delta0 > 0 :
368
+ claimable0 += (acc_balance * claimable_delta0) / 10 ** 18
369
+ if claimable_delta1 > 0 :
370
+ claimable1 += (acc_balance * claimable_delta1) / 10 ** 18
356
371
357
372
if gauge.address != empty (address ):
358
373
acc_staked = gauge.balanceOf (_account)
@@ -372,11 +387,11 @@ def _byData(_data: address[3], _account: address) -> Lp:
372
387
373
388
token0: token0.address ,
374
389
reserve0: pool.reserve0 (),
375
- claimable0: pool. claimable0 (_account) ,
390
+ claimable0: claimable0,
376
391
377
392
token1: token1.address ,
378
393
reserve1: pool.reserve1 (),
379
- claimable1: pool. claimable1 (_account) ,
394
+ claimable1: claimable1,
380
395
381
396
gauge: gauge.address ,
382
397
gauge_total_supply: gauge_total_supply,
@@ -389,7 +404,7 @@ def _byData(_data: address[3], _account: address) -> Lp:
389
404
emissions: emissions,
390
405
emissions_token: emissions_token,
391
406
392
- account_balance: pool. balanceOf (_account) ,
407
+ account_balance: acc_balance ,
393
408
account_earned: earned,
394
409
account_staked: acc_staked,
395
410
0 commit comments