yearn / yearn-vaults-v2-subgraph

26 stars 41 forks source link

Some vaults have negative balanceTokens #55

Open jstashh opened 3 years ago

jstashh commented 3 years ago

Request all vaults and corresponding data:

{
  vaults {
    id
    balanceTokens
    token {
      symbol
    }
    latestUpdate {
      tokensDeposited
      tokensWithdrawn
    }
  }
}

Result: (one of the vaults, but the response contains an array of all the vaults)

{
        "balanceTokens": "-67230908",
        "id": "0x1ae8ccd120a05080d9a01c3b4f627f865685d091",
        "latestUpdate": {
          "tokensDeposited": "55042040",
          "tokensWithdrawn": "122272948"
        },
        "token": {
          "symbol": "WBTC"
        }
      }

Expected: balanceTokens should reflect the number of tokens in the vault. Should it match totalAssets from the smart contract?

bsamuels453 commented 2 years ago

im 99% sure this was fixed by https://github.com/yearn/yearn-vaults-v2-subgraph/pull/119/files

currently unable to repro on main.

when the subgraph version is incremented, need to retest to validate the fix

jstashh commented 2 years ago

@bsamuels453 Awesome! Great work. Feel free to close when you've confirmed that it's been fixed

Majorfi commented 2 years ago

👋 It appears that balanceTokensIdle has the same issue