You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to filter out UTxOs that contain less than 5 ADA, but since Koios returns the value as a string, the horizontal filtering is not working as I would expect. I am not sure if I am doing something wrong, or if this is not actually possible.
It is missing the UTxOs with more than 10 ADA. It appears to be doing a text comparison rather than a numerical one. So I tried casting the text to a bigint type like:
This is something limited on PostgREST end for now, as adding filter/order on a cast exposes a large surface attack for DDoS, especially when table is pretty huge (like in this case would be tx_out, second largest table on dbsync).
The original requirement to have this casted as text came due to ability for parsing numbers that could go into quadrillion, which would end up mucking most parsers into expressing exponential formats. This resulted in all fees/ADA values/asset quantities being turned where possible into text format.
Will need to have a think about it before adding a change - as I see this as a valid requirement too (which is why we originally had it as lovelace/numeric), but required switching due to above-mentioned issue. Some potential alternatives could be use of alternate endpoints or duplication of value field, both not very graceful IMO.
I'm trying to filter out UTxOs that contain less than 5 ADA, but since Koios returns the value as a string, the horizontal filtering is not working as I would expect. I am not sure if I am doing something wrong, or if this is not actually possible.
This is the base query I am using.
It returns:
I've tried this:
but it returns:
It is missing the UTxOs with more than 10 ADA. It appears to be doing a text comparison rather than a numerical one. So I tried casting the text to a bigint type like:
but it returns the same result as before, just as integers instead of text.
Am I doing something wrong or is it not actually possible to do horizontal filtering on the ada value of a UTxO?
Possible Bug
The last curl query returns the entire list at least 10% of the time. This leads me to believe there is a bug in Koios.
The text was updated successfully, but these errors were encountered: