Skip to main content

Advanced Research desk

Formula builder, backtesting, data blends, scheduling, webhooks, and the signal marketplace.

Formula Builder

The Formula Builder lets you create calculated fields using a spreadsheet-style expression language. Formulas operate on top of existing data warehouse columns and produce derived metrics that can be used in queries, dashboards, and alerts. Think of formulas as saved calculations that stay up to date as the underlying data changes.

Formula Syntax

Formulas use a familiar syntax with arithmetic operators, built-in functions, and column references. Column references use the format [table.column].

Arithmetic+, -, *, /, % (modulo), ^ (power). Standard operator precedence with parentheses for grouping.
AggregationSUM(), AVG(), MIN(), MAX(), COUNT(), STDDEV(), MEDIAN(). Apply over a column or filtered subset.
Window FunctionsLAG(), LEAD(), RANK(), ROLLING_AVG(), ROLLING_SUM(). Operate over ordered partitions.
ConditionalIF(condition, then, else). Nest for multi-branch logic.
MathABS(), ROUND(), CEIL(), FLOOR(), LOG(), LN(), SQRT(), EXP().
DateNOW(), DATE_DIFF(), DATE_ADD(), DATE_TRUNC(). For time-based calculations.

Example Formulas

Annualized funding rate:

[funding_rate_history.funding_rate] * 3 * 365

OI-weighted funding rate across exchanges:

SUM([derivatives.funding_rate] * [derivatives.open_interest_usd])
  / SUM([derivatives.open_interest_usd])

7-day rolling average of daily volume:

ROLLING_AVG([market_data.volume_24h], 7)

Custom composite score combining funding and OI z-scores:

(0.6 * [asset_screener_latest.funding_rate_zscore]
  + 0.4 * [asset_screener_latest.oi_zscore])

Formula versioning

Formulas are versioned independently. When you update a formula definition, all queries and dashboards that reference it begin using the new calculation on their next refresh. Previous formula versions are retained so you can revert if needed.

Data Blends

Data blends let you join multiple data sources in a single query without writing complex SQL joins. The blend builder provides a visual interface where you select two or more tables, define the join keys (typically asset symbol and timestamp), and select which columns to include from each table. The result is a merged dataset that you can query, chart, and export.

Common blend use cases include joining derivatives data with on-chain flows to find funding/flow divergences, combining trade history with market data to calculate entry timing quality, and merging sentiment scores with price performance for correlation analysis.

Backtesting Engine

The backtesting engine lets you define a trading strategy and simulate its performance against historical market data. It supports both simple rule-based strategies (e.g., "buy when funding z-score drops below -2, sell when it returns to 0") and complex multi-factor strategies that combine price, derivatives, and on-chain conditions.

Defining a Strategy

Strategies are defined in Strategy cells using a structured format that specifies entry conditions, exit conditions, position sizing, and risk parameters.

Entry ConditionsOne or more conditions that must all be true to open a position. Supports price, funding, OI, volume, z-score, and divergence triggers.
Exit ConditionsConditions for closing the position: take profit target, stop loss level, time-based exit, or indicator-based exit.
Position SizingFixed size, percentage of portfolio, or volatility-adjusted sizing (e.g., risk 1% of capital per trade with ATR-based stop).
DirectionLong-only, short-only, or both. For long/short strategies, define separate entry conditions for each direction.
Asset UniverseBacktest on a single asset, a list of assets, or the entire tracked universe.
Lookback PeriodHistorical data range: 30 days, 90 days, 180 days, or 1 year. Longer periods cost more credits.

Backtest Outputs

After a backtest completes, the engine produces a comprehensive results panel with the following components.

Equity Curve

A line chart showing portfolio value over time, with drawdown periods highlighted in red.

Trade Log

Every simulated trade with entry/exit timestamps, prices, direction, P&L, and the conditions that triggered entry and exit.

Performance Summary

Total return, CAGR, max drawdown, Sharpe ratio, Sortino ratio, win rate, average win/loss size, and profit factor.

Drawdown Analysis

Max drawdown depth and duration, recovery time, and a histogram of drawdown magnitudes.

Monthly Returns

A heatmap showing returns by month, revealing seasonality patterns and consistency.

Benchmark Comparison

Overlay the strategy equity curve against a buy-and-hold benchmark to quantify the strategy's alpha.

Backtest limitations

Backtests use historical data and cannot account for slippage, market impact, or liquidity constraints that would affect live execution. Results should be treated as indicative, not predictive. A strategy that backtests at 80% win rate will almost certainly perform worse in live conditions.

Query Scheduling

Any SQL query or notebook can be scheduled to run on a cron-style timer. Scheduled queries execute server-side, cache results, and optionally trigger notifications or webhook calls when they complete. This powers automated data pipelines, recurring reports, and monitoring workflows that run without manual intervention.

Schedule Configuration

1

Open the query or notebook you want to schedule

Navigate to the SQL cell or notebook in the research desk. Click the cell menu and select Schedule.

2

Define the schedule

Choose a preset interval (every hour, every 4 hours, daily, weekly) or enter a custom cron expression for fine-grained control. Set the timezone for the schedule.

3

Configure actions on completion

Optionally enable result caching (pre-compute for faster dashboard loads), email notification (send results as a formatted email), or webhook delivery (POST results as JSON to an external URL).

4

Activate the schedule

Click Activate. The schedule appears in your Scheduled Queries list in the research desk sidebar. You can pause, edit, or delete schedules at any time.

Webhook Automation

Scheduled queries can POST their results to external webhooks, enabling integration with Slack, Discord, Telegram bots, Zapier, or custom applications. The webhook payload includes the query results as JSON, the execution timestamp, and metadata about the query configuration.

Common automation patterns include posting a daily funding rate summary to a trading team's Slack channel, triggering a Zapier workflow when a query detects a specific condition (e.g., OI spike above 20%), and feeding Thrive data into a custom trading dashboard or spreadsheet.

API Access

Pro+ users can access the Thrive data warehouse programmatically via a REST API. API keys are managed from the Research desk settings panel. Each API call consumes the same credits as the equivalent Research desk action.

POST /api/v1/queryExecute a SQL query against the data warehouse. Returns JSON results. Rate limited to 60 requests per minute.
GET /api/v1/assetsReturns current screener data for all tracked assets. No parameters required.
GET /api/v1/signalsReturns current data-feed prints with scores and the data behind them.
GET /api/v1/divergencesReturns all active divergences with type, severity, and duration.
GET /api/v1/fundingReturns current funding rates across all exchanges for a given asset.
POST /api/v1/formulas/evaluateEvaluates a formula expression and returns the computed result.

API documentation

Full API documentation with request/response schemas, authentication details, and code examples in Python, JavaScript, and curl is available in the research desk under Settings → API → Documentation.

Signal Marketplace

The Signal Marketplace is a community-driven feature where Thrive users can publish and subscribe to custom signals, formulas, and notebooks. If you have built a formula or alert configuration that consistently produces valuable insights, you can share it with the community. Other users can subscribe to your signal and receive the same alerts and data updates.

How the Marketplace Works

Publish

Share a formula, alert configuration, or notebook with the community. Published items include a description, historical performance data, and the creator's track record.

Subscribe

Browse community-published formulas and subscribe with one click. They show up next to the data feed.

Performance Tracking

Every published signal's performance is tracked transparently. Subscribers can see accuracy, hit rate, and forward return statistics before committing.

Rating System

Users rate published signals based on quality and usefulness. Top-rated signals are featured on the marketplace home page.

Marketplace is community-powered

Marketplace signals are created by other Thrive users, not by Thrive's AI models. Evaluate published signals with the same rigor you would apply to any third-party trading tool. Past performance data is genuine but does not guarantee future results.

Next Steps