Installation

VectorTA is a Rust library that compiles to WebAssembly. This guide shows you how to install from Git and build WASM bundles.

Repository & prerequisites

All builds originate from vectorta/ta-lib. Before fetching the source make sure the following tools are installed:

  • Rust toolchain 1.70 or newer (rustup update)
  • wasm-pack 0.12+ for WebAssembly builds (cargo install wasm-pack)
  • Node.js 18 or newer if you plan to consume the generated WASM package from a bundler
git clone https://github.com/vectorta/ta-lib.git
cd ta-lib

Rust crate (library consumers)

Until the crate is published on crates.io you can depend on it directly from Git. Using cargo add keeps the dependency declaration tidy:

cargo add vectorta \
  --git https://github.com/vectorta/ta-lib \
  --branch main

The resulting Cargo.toml stanza looks like:

[dependencies]
vectorta = { git = "https://github.com/vectorta/ta-lib", branch = "main" }

# Optional features
# vectorta = { git = "https://github.com/vectorta/ta-lib", branch = "main", features = ["wasm", "python"] }

Indicators expose typed inputs and builders. The example below computes RSI values from a price slice and prints the latest reading:

use vectorta::indicators::rsi::{rsi, RsiInput, RsiParams};

fn main() -> Result<(), vectorta::indicators::rsi::RsiError> {
    let closes = vec![100.0, 102.0, 101.3, 104.2, 103.5, 105.1, 104.8];

    let params = RsiParams { period: Some(14) };
    let input = RsiInput::from_slice(&closes, params);
    let output = rsi(&input)?;

    if let Some(last) = output.values.last() {
        println!("latest RSI {:.2}", last);
    }

    Ok(())
}

Most indicators also provide builders (for kernel selection) and batch helpers—see the corresponding indicator page for in-depth examples.

Building the WebAssembly package

Enable the wasm feature and compile with SIMD support for the best performance. The command below generates a consumable package in pkg/ that you can publish to npm or import locally.

RUSTFLAGS="-C target-feature=+simd128" \
  wasm-pack build \
  --target web \
  --release \
  --features "wasm simd128" \
  --out-dir pkg

Inside a browser bundle (Astro, Vite, Next.js, etc.) import the generated glue code and call the WASM-safe helper functions, for example rsi_js:

import init, { rsi_js } from './pkg/vectorta.js';

await init();

const closes = new Float64Array([100, 102, 101.3, 104.2, 103.5, 105.1, 104.8]);
const values = rsi_js(closes, 14);

console.log(values); // Float64Array with RSI values

When targeting Node.js, swap --target web for bundler or nodejs so the emitted JS matches your runtime.

Python bindings (status)

The crate already exposes pyo3 hooks behind the python feature flag, but official wheels are still being stabilised. Follow the GitHub repository for updates; in the meantime the Rust crate or WASM build are the supported integration paths.

Feature highlights

SIMD-first design

Auto-detects AVX2/AVX-512 with scalar fallbacks for older CPUs.

300+ indicators

All indicators use the same API for momentum, trend, volatility, and experimental tools.

Memory safe pipelines

Memory safe with explicit NaN handling for reliable batch calculations.

Cross-platform output

Reuse the same kernels from native Rust, WebAssembly, and (soon) Python wheels.

Next steps