Bug: Indexer "GET /v2/assets/{asset-id}/balances" currencyGreaterThan 0 returning incorrect results

Environment: Indexer 2.2.1 / Testnet (Purestake) / Java SDK 1.5.1
API: GET /v2/assets/{asset-id}/balances

Steps to Reproduce:

  1. Prepare an account with a 0 balance for an ASA token.
  2. Query for balances of that ASA token with setting “currencyGreaterThan: 0”.

Result: Account with 0 balance is returned incorrectly.

I don’t have a local indexer handy to test whether the problem is isolated to Purestake. If I set the value to 1, it is correctly filtered out. Is this supposed to be gt or gte?

Opened a bug nine months ago (asset balances - currency-greater-than - unexpected results when param = 0 · Issue #144 · algorand/indexer · GitHub) for the same issue.

The PureStake Indexer API is mostly stock, with a few additional indexes and minor tweaks, the issue is likely universal.

1 Like