Skip to content

Quick start ​

Run your first query, turn its time series into a rate and draw it, in about five minutes.

You need nothing but the workbench open in front of you. Every query on this page is one you can paste straight in. The rows shown are the ones it returned.

1. Run the starter ​

Press Sign in at the top right first, because running a query needs an account. The editor opens with this query already in it, under a one-line comment. Press ⌘⏎ (or Ctrl+Enter) in the editor, or click Run.

cql
let stETH = ethereum:0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;

from stETH at latest-21600..latest every 7200 as s
| project { block: $block, time: $timestamp, ethPerShare: format(s.getPooledEthByShares(1e18), 18) }

Open in workbench →

The editor holding the starter query, which reads stETH's share rate once a day for three days, with the run bar under it.

A moment later the line at the right of the run bar reads complete, and the Results tab under it fills:

blocktimeethPerShare
260280002026-09-21T19:34:47Z1.24455806764908769
260352002026-09-22T19:45:47Z1.244633419602089156
260424002026-09-23T19:56:23Z1.244710915700866902
260426752026-09-23T20:51:59Z1.244710915700866902
ethPerShare by timeA step line of ethPerShare over time, from all 4 rows the query returned.1.244601.244651.24470ethPerShare00:002026-09-2212:0000:002026-09-2312:00time (UTC)2026-09-21T19:34:47Z ethPerShare 1.244558067649087692026-09-22T19:45:47Z ethPerShare 1.2446334196020891562026-09-23T19:56:23Z ethPerShare 1.2447109157008669022026-09-23T20:51:59Z ethPerShare 1.244710915700866902
ethPerShare by timeA step line of ethPerShare over time, from all 4 rows the query returned.1.244601.244651.24470ethPerShare2026-09-222026-09-23time (UTC)2026-09-21T19:34:47Z ethPerShare 1.244558067649087692026-09-22T19:45:47Z ethPerShare 1.2446334196020891562026-09-23T19:56:23Z ethPerShare 1.2447109157008669022026-09-23T20:51:59Z ethPerShare 1.244710915700866902

The heto workbench after a run: the rail on the left, the starter query in the editor, the run bar reading complete, and four rows of stETH's share rate in the Results tab.

The contract is Lido's stETH, and s.getPooledEthByShares(1e18) is the ETH one share of it is worth — the share rate. at latest-21600..latest every 7200 reads that value at one block in every 7 200 — about once a day — across the last three days. It also always reads at the end of the range, so there are four rows. The value steps up once a day, when Lido's oracle reports, which is why the last two rows, on the same day, agree. The run also appears under Recent in the rail, where you can open it again later.

2. Read the diagnostics as you type ​

Delete the semicolon at the end of the first line. A squiggle appears under the next word, and the Diagnostics tab lists it:

CQL1016 · error · Unexpected `from`; expected `; at the end of a let statement`

Type the semicolon again, and the squiggle disappears. CQL checks the whole query as you type: spelling, names, types, and whether the block you asked for exists. So CQL finds most mistakes before you press Run. Errors and diagnostics explains how to read one.

3. Turn the series into a rate ​

Keep the source. Replace the project with a pipeline that folds the four samples into one row:

cql
let stETH = ethereum:0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;

from stETH at latest-21600..latest every 7200 as s
| extend ethPerShare = format(s.getPooledEthByShares(1e18), 18)
| summarize first = first(ethPerShare), last = last(ethPerShare), since = first($timestamp), until = last($timestamp)
| extend days = todecimal(totalseconds(until - since)) / 86400
| project { since, until, first, last, dailyPct: (last / first - 1) / days * 100, aprPct: (last / first - 1) / days * 365 * 100 }

Open in workbench →

extend adds ethPerShare to every row, as project did, but keeps the rest of the row with it. summarize then reduces all the rows to one: first(ethPerShare) and last(ethPerShare) are the values on the earliest and the latest row. first($timestamp) and last($timestamp) are when those rows were. days is the span between them. until - since is a duration, totalseconds makes it a number, and todecimal lets you divide that by 86 400 without truncating.

The two percentages are the same growth on two clocks. last / first - 1 is how much one share grew over the span. Divided by days and times 100, it is the average change per day, dailyPct. Times 365 as well, it is the annualised rate, aprPct. Run it and you get one row:

sinceuntilfirstlastdailyPctaprPct
2026-09-21T19:34:47Z2026-09-23T20:56:35Z1.244558067649087691.2447109157008669020.00597106097939007085151934534141509406432.1794372574773758608045610496165093334695

until is the timestamp of the newest block when the run started. So it moves a little from run to run, and the percentages move with it. The share rate grows about six thousandths of a percent a day, a little over two percent a year.

4. Draw it in Visualize ​

  1. Restore the starter. Press ⌘Z (or Ctrl+Z) until it returns, or paste it from section 1.
  2. Run it again.
  3. Open the Visualize tab. It draws nothing until you say how.
  4. Choose Line, then time for x and ethPerShare for y.

The Visualize tab drawing ethPerShare over time as a step line, which climbs once a day and holds still between the last two rows.

The line is a step, because the query sampled its values: between two samples the share rate held what it was at the first. Choose Straight to join the points directly instead. While Visualize is in front, it draws a new run with the same choices. So you can change the query and press Run again without leaving the chart.

Where next ​