balancer-subgraph icon indicating copy to clipboard operation
balancer-subgraph copied to clipboard

PoolShare entity with user being the pool itself

Open benesjan opened this issue 4 years ago • 2 comments

There seems to be a bug in the data as there exist a PoolShare entity where the user is the pool itself. Here is an example query and output:

{
  poolShares(where: {userAddress: "0x5e37910cfb8de1b14ec4e4bac0bec27c35dc07d5"}) {
    id
    balance
    poolId {
      id
    }
  }
}
{
  "data": {
    "poolShares": [
      {
        "balance": "0",
        "id": "0x5e37910cfb8de1b14ec4e4bac0bec27c35dc07d5-0x5e37910cfb8de1b14ec4e4bac0bec27c35dc07d5",
        "poolId": {
          "id": "0x5e37910cfb8de1b14ec4e4bac0bec27c35dc07d5"
        }
      }
    ]
  }
}

How is this possible? Are the BPTs sent to the pool itself upon user's liquidity withdrawal?

benesjan avatar Jan 03 '21 00:01 benesjan

@benesjan Yes BPTs are sent to the pool itself, that's the reason you see it on poolShares. Do you see this being an issue? Pool shares with 0 value would not appear in the UI but we could remove it from the subgraph.

bonustrack avatar Jan 05 '21 09:01 bonustrack

Hello, I think it makes the data a bit inconsistent for 3rd parties (it caused us issues as croco.finance). For that reason I think filtering that would be a good idea. Thank you

benesjan avatar Jan 26 '21 17:01 benesjan