🏃Advanced Components

Even more powerful queries

The following components are optional when building your query:

Aggregation (optional)

As the name suggests, it used to reduce the dimensions of your data by providing an aggregation method. Aggregation is useful when you want to analyse a group of data together.

Aggregation is by default applied to all data points sharing the same timestamp, but you can additionally define delimiters you want to aggregate by.

Available aggregation methods:

  1. S (Sum)

  2. AVG (Average)

  3. MED (Median)

  4. MAX

  5. MIN

Average liquidity of USDC in all pools on UniswapV3 app.
[UNIV3]APP [USDC]A L AVG G 180D

Average liquidity of USDC in all pools on UniswapV3 app by chain.
[UNIV3]APP [USDC]A L AVG[C] G 180D
Operators (optional)

Operators are a way for you to implement your own metrics in an easy way. There are two types of operators:

  1. Single value operator

  2. Multiple value operator

Single value operator

  1. & (indexing -> value between 0 and 100 )

  2. % (percentage change -> value between 0 and 1)

To apply these operators, just add them after the function.

Percentage change of price for all stablecoin assets 
(assets in stable sector).
[STB]SEC P% G 180D

Multi value operator

  1. + (Addition)

  2. - (Subtraction)

  3. / (Division)

Priority rules for operators are not yet implemented, so they are executed from left to right.

Ratio of ether and other eth assets prices.
[ETH]A P / [wETH, sETH, stETH, wstETH, frxETH]A P G 180D

Transaction count of Ethereum and Polygon chains.
[ETH]C TXC + [POLYGON]C TXC G 180D
Time Buckets (optional)

The User can specify a Time Bucket that will group and aggregate data based on the timestamp of the data point similar to how data is windowed for timeseries analysis.

For example, you can bucket your data by 5 days and apply SUM to analyse data in buckets of 5 days.

Time buckets consists of:

  1. B (symbol for time buckets)

  2. Number of days for the window

  3. Aggregation method

Bucket transaction count of ethereum chain in 7 days and look at the average.
[ETH]C TXC G 180D B[7, AVG]
  1. S (Sum)

  2. AVG (Average)

  3. MED (Median)

  4. MAX

  5. MIN

  6. F (First)

  7. L (Last)

Additional Tools

Last updated

Was this helpful?