hermes-official-plugins
Hermes Agent용 공식 플러그인, Nous Research가 제작·관리
SQL-native quant finance for DuckDB
README 전체를 불러오는 중입니다.
README 전문 보기 ↗finance brings quant finance analytics into DuckDB. It gives you SQL-native
pricing, risk, returns, portfolio math, market microstructure helpers, and
validation checks without sending data to a pricing service or hiding model
assumptions behind an SDK session.
It is built for quant developers, desk strategists, risk engineers, and finance
users who want deterministic local analytics close to the data. finance is
available from DuckDB Community Extensions and can be installed with DuckDB's
standard community extension flow:
INSTALL finance FROM community;
LOAD finance;
-- After loading finance:
SELECT
fin_bsm_price(spec) AS price,
(fin_bsm_greeks(spec)).delta AS delta,
fin_bsm_implied_vol('call', 10.450583572185565, 100, 100, 1, 0.05) AS iv
FROM (
SELECT fin_option_spec('call', 100, 100, 1, 0.05, 0.20) AS spec
);
Finance workflows often start in SQL but detour into notebooks, services, or vendor libraries for basic analytics. DuckDB Finance keeps that work inside DuckDB:
All public functions live in the fin_ namespace and use ordinary DuckDB types:
DOUBLE, DATE, TIMESTAMP, VARCHAR, STRUCT, LIST, and table results.
Prerequisite: DuckDB with the finance extension loaded. Install it from DuckDB
Community Extensions or use a source build for local development.
Install and load the extension.
INSTALL finance FROM community;
LOAD finance;
SELECT fin_version();
Price a call option and return its first-order Greeks.
SELECT
fin_bsm_price(spec) AS price,
(fin_bsm_greeks(spec)).delta AS delta,
(fin_bsm_greeks(spec)).vega AS vega
FROM (
SELECT fin_option_spec('call', 100.0, 100.0, 1.0, 0.05, 0.20) AS spec
);
Expected result: scalar price and risk columns you can join, aggregate, test, or write into a DuckDB table like any other SQL result.
| Area | Examples |
|---|---|
| Returns and risk | Simple/log returns, annualization, volatility, Sharpe, Sortino, EWMA volatility, drawdowns, outliers, quantile spread, capture ratios, VaR/CVaR-style helpers, and data-quality reports. |
| Options and volatility | Black-Scholes-Merton, Black-76, Bachelier, binomial trees, digital, Asian geometric, barrier, SABR/SVI helpers, Greeks, higher-order Greeks, and implied-volatility solvers. |
| Fixed income and cash flows | Discount factors, forward rates, PV/FV, NPV/IRR/XIRR/MIRR, annuities, bond price/YTM/duration/convexity/DV01, curve interpolation, and curve bootstrapping. |
| Portfolio analytics | Portfolio return, variance, volatility, Sharpe, table-shaped portfolio return/variance helpers, optimizer table functions, HRP fallback weights, efficient-frontier points, and rebalance trades. |
| Technical analysis and microstructure | OHLC/OHLCV helpers, indicators, VWAP/TWAP, spreads, microprice, imbalance, impact proxies, and tick/volume/dollar/imbalance bars. |
| Validation and schemas | Checks for prices, returns, OHLC rows, conventions, calendars, sessions, expected schemas, and source-normalized returns/OHLCV/options. |
See the Function Reference for the complete registered surface and Data Source Compatibility for adapting CSV, Parquet, MotherDuck, or vendor-shaped tables into canonical finance columns.
This repository is early-stage OSS and should be treated as pre-1.0. The native core is covered by deterministic DuckDB SQL tests, function-reference coverage, golden fixtures, and performance coverage checks, but users should pin a release version for production research workflows.
The extension is local and deterministic:
INSTALL finance FROM community;
LOAD finance;
SELECT fin_version();
Community extensions are built and signed by DuckDB's community extension CI.
Locked-down environments can disable community extensions with DuckDB's
allow_community_extensions option.
To serve finance to other DuckDB 2.0 clients over the Quack remote protocol,
load it in the server process. Clients that CONNECT to the server do not need
the extension installed:
duckdb -cmd "LOAD finance" my_database.duckdb -serve
See Installation: Quack Server for client usage and which queries need the extension loaded on the client.
For development, build from source:
git clone --branch v2.0.0 https://github.com/duckdb/duckdb.git /path/to/duckdb
git clone https://github.com/leonardovida/duckdb-finance.git /path/to/duckdb-finance
cd /path/to/duckdb-finance
make debug DUCKDB_ROOT=/path/to/duckdb
The Makefile also supports an adjacent ../duckdb checkout by default.
Run the finance playbooks from this repository checkout after loading the extension:
INSTALL finance FROM community;
LOAD finance;
.read examples/playbooks.sql
여기까지가 README 앞부분입니다. 나머지는 원문에서 읽을 수 있습니다. README 전문 보기 ↗