Skip to content
DuckDB community extension

finance

SQL-native quant finance functions for DuckDB

01 / SETUP

Install and load

Run these commands in a Haybarn SQL session. The extension is available from the community repository.

Haybarn 2.0.0 · SQL
INSTALL finance FROM community;
LOAD finance FROM community;

Try it in a temporary SQL session with finance already loaded. Queries run in this tab; examples using files or services need their own setup.

Using upstream DuckDB? Follow the maintainer’s installation instructions.

02 / QUERY

Usage example

SQL
SELECT
  fin_bsm_price('call', 100.0, 100.0, 1.0, 0.05, 0.20) AS price,
  fin_simple_return(105.0, 100.0) AS simple_return;

Provided by leonardovida. Not yet verified on Haybarn 2.0.0.

Sample data & setup

About this extension

DuckDB Finance adds SQL-native quant finance analytics to DuckDB under the fin_ namespace. It includes return and risk analytics, option pricing and Greeks, fixed-income and cash-flow helpers, portfolio math, technical indicators, and table functions. The extension is deterministic and local: it does not call market-data vendors or remote pricing services.

Project overview from the community descriptor.

Documentation and resources

Project and build details
Repository
leonardovida/duckdb-finance
License
MIT
Maintainers
leonardovida
Written in
C++
Build source
1ee24a015dba
Build definition
Community descriptor