Formula over metrics
run_formulaCombine up to eight metrics in a formula and read the result as a series, as CryptoKeyhole's Formulae workbench does: + - * / ^ and functions such as sma, ema, zscore, pct_change, change, corr, rsi, drawdown, realized_vol, rebase, cumsum and ifthen. Name each input with a letter: inputs {"a": "ckh.MVRVPriced", "b": "ckh.SpotPrice"} and expression "zscore(a, 365)". Without an API key the inputs are metrics whose plan is free, at 24h, 1w or 1M.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"expression": "<expression>",
"inputs": "<inputs>"
},
"name": "run_formula"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Exclusive UNIX seconds UTC. Leave it out to read up to the latest observation. | |
| start | No | Inclusive UNIX seconds UTC. Without it fetch_metric reads the latest year of daily observations (ten years of weekly ones, every monthly and yearly one). | |
| inputs | Yes | One to eight inputs: a letter to a metric id, for example {"a": "ckh.SpotPrice"}. | |
| interval | No | Resolution: 24h daily, 1w weekly, 1M monthly. get_metric_metadata gives the intervals a metric offers. | 24h |
| expression | Yes | The formula over the inputs' letters, for example "a / b" or "sma(a, 30)". |