yearn-vaults-v2-subgraph icon indicating copy to clipboard operation
yearn-vaults-v2-subgraph copied to clipboard

Some vaults have negative balanceTokens

Open jstashh opened this issue 3 years ago • 3 comments

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?

jstashh avatar Apr 19 '21 20:04 jstashh

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

bsamuels453 avatar Dec 08 '21 04:12 bsamuels453

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

jstashh avatar Dec 12 '21 16:12 jstashh

👋 It appears that balanceTokensIdle has the same issue

Majorfi avatar Apr 08 '22 12:04 Majorfi