Skip to content
Dune Analytics

@Brecht / Loopring Transfers

SQL query

1--DROP FUNCTION dune_user_generated.decodeFloat;
2--DROP FUNCTION dune_user_generated.process;
3
4
5
6DROP FUNCTION dune_user_generated.fn_decode_float_24;
7CREATE OR REPLACE FUNCTION dune_user_generated.fn_decode_float_24(data bytea) RETURNS double precision AS $$
8DECLARE
9    exponent integer;
10    mantissa integer;
11    value integer;
12BEGIN
13    value = get_byte(data, 0) * 65536 + get_byte(data, 1) * 256 + get_byte(data, 2);
14    exponent = value / 524288;
15    mantissa = value - (exponent * 524288);
16    return mantissa * POW(10, exponent);
17END; $$
18LANGUAGE PLPGSQL;
19
20DROP FUNCTION dune_user_generated.fn_decode_float_16;
21CREATE OR REPLACE FUNCTION dune_user_generated.fn_decode_float_16(data bytea) RETURNS double precision AS $$
22DECLARE
23    exponent integer;
24    mantissa integer;
25    value integer;...

SQL query results

Loading