Query language
Functions & execution
OnchainQL functions have a defined execution form. Everything else passes through untouched — which is not the same as being supported.
Defined execution forms
| OnchainQL | Executes as | Notes |
|---|---|---|
| date_trunc(unit, value) | dateTrunc(unit, value) | Result normalized to UTC DateTime64(3) |
| count_if(condition) | countIf(condition) | Counts true values |
| from_base58(value) | base58Decode(value) | Binary value uses an opaque binary representation |
| to_base58(value) | base58Encode(value) | Encodes binary string data |
| json_extract(value, path) | JSON_QUERY(value, path) | Partial JSON compatibility |
| json_extract_scalar(value, path) | JSON_VALUE(value, path) | Returns a scalar representation |
| approx_percentile(value, p) | quantileTDigest(p)(value) | Only the simple two-argument form |
| CAST(value AS VARBINARY) | CAST(value AS String) | Representation approximation, not a native binary type |
| ARRAY[...] | [...] | Array literal syntax |
| INTERVAL 'n' UNIT | INTERVAL n UNIT | n must be an unsigned integer literal |
| TIMESTAMP 'value' | UTC DateTime64(6) | OnchainQueries normalizes timestamps to UTC |
Approximate percentiles
Only the simple two-argument form is translated.
SELECT approx_percentile(sol_amount, 0.95)FROM pump_fun.trade_event;Weighted percentiles, arrays of percentile values and complex nested arguments are not translated. Approximate results should not be expected to match another engine exactly.
Base58 and varbinary
SELECT to_base58(from_base58(mint)) AS normalized_mintFROM pump_fun.trade_eventLIMIT 10;OnchainQueries models varbinary values as opaque binary strings. Basic Base58 encoding and decoding are supported; a broader varbinary helper library is not implemented.
JSON
Use json_extract or json_extract_scalar for the translated compatibility path.
Not implemented, on purpose
These higher-order and map functions are refused because the same-named functions underneath do not provide a safe compatibility contract. Failing loudly is the point — silently returning different numbers would be worse.
element_at,filter,reduce,transform,zip_withmap,map_filter,map_transform_keys,map_transform_valuesjson_parse,json_array_length
Other array operations follow the execution layer’s behaviour and may require their underlying names rather than their OnchainQL equivalents.