Skip to content

Commit

Permalink
Default v2 positions to be empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
ethzoomer authored Jan 12, 2024
1 parent f46069d commit b219d77
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions contracts/LpSugar.vy
Original file line number Diff line number Diff line change
Expand Up @@ -530,20 +530,21 @@ def _byData(_data: address[3], _token0: address, _token1: address, _account: add

positions: DynArray[Position, MAX_POSITIONS] = empty(DynArray[Position, MAX_POSITIONS])

positions.append(
Position({
id: 0,
manager: self.router,
liquidity: acc_balance,
staked: acc_staked,
unstaked_earned0: claimable0,
unstaked_earned1: claimable1,
emissions_earned: earned,
tick_lower: 0,
tick_upper: 0,
alm: False
})
)
if acc_balance > 0 or acc_staked > 0 or earned > 0 or claimable0 > 0:
positions.append(
Position({
id: 0,
manager: self.router,
liquidity: acc_balance,
staked: acc_staked,
unstaked_earned0: claimable0,
unstaked_earned1: claimable1,
emissions_earned: earned,
tick_lower: 0,
tick_upper: 0,
alm: False
})
)

return Lp({
lp: _data[1],
Expand Down

0 comments on commit b219d77

Please sign in to comment.