Skip to main content
This tutorial walks you through:
  1. Installing @quantform/core
  2. Creating a basic reusable component
  3. Wiring it into a strategy
  4. Executing it with the Quantform CLI

Prerequisites

  • Node.js and Yarn installed
  • A new or existing TypeScript project
/*
 * Combines funding rates from multiple venues into a single stream 
 * and computes the funding fee premium between them.
 */
export function watchFundingPremium(symbol = 'SOL') {
  const { watchHyperliquidFundingFee } = useHyperliquid();
  const { watchBackpackFundingFee } = useBackpack();

  return combineLatest([
    watchHyperliquidFundingFee(symbol),
    watchBackpackFundingFee(`${symbol}_USD_PERP`),
  ]).pipe(
    map(([hl, bp]) => hl.rate - bp.rate)
  );
}

Step 1: Install packages

yarn add @quantform/core rxjs
Create a src directory if you do not already have one.

Step 2: Create a basic component

Create src/components/tick-logger.ts:
import { interval, map, tap } from 'rxjs';
import { useLogger } from '@quantform/core';

/**
 * Basic reusable component:
 * emits one tick event per second and logs it.
 */
export function useTickLogger(label: string) {
  const { info } = useLogger('tick-logger');

  return interval(1000).pipe(
    map(i => ({ timestamp: Date.now(), label, tick: i })),
    tap(event => info(`[${event.label}] tick=${event.tick}`))
  );
}

Step 3: Use the component in a strategy

Create src/pipeline.ts:
import { behavior, strategy } from '@quantform/core';
import { useTickLogger } from './components/tick-logger';

export default strategy(() => {
  behavior(() => useTickLogger('basic-component'));

  return [];
});
This keeps your strategy small while moving reusable logic into a component.

Step 4: Execute the strategy

Run in paper mode:
qf paper pipeline
You should see a log line every second from useTickLogger.

Step 5: Iterate quickly

Use watch mode while developing:
qf paper pipeline -w
The process restarts when files in src change.

Next steps

Execution modes

Learn when to use paper, replay, and live runs.

Replay workflow

Validate strategy behavior with historical windows.

Runtime model

Understand modules, hooks context, and dependency wiring.

Quickstart

Compare this tutorial with the shorter quickstart path.