Search Shortcut cmd + k | ctrl + k
scrooge

Provides functionality for financial data-analysis, including data scanners for the Ethereum Blockchain and Yahoo Finance

Maintainer(s): pdet

Installing and Loading

INSTALL scrooge FROM community;
LOAD scrooge;

Example

-- Set the RPC Provider
SET eth_node_url = 'https://mempool.merkle.io/rpc/eth/pk_mbs_0b647b195065b3294a5254838a33d062';
-- Query Transfer events of USDT from blocks 20034078 - 20034100 while parallelizing on one block per thread
FROM read_eth(
    'USDT',
    'Transfer',
    20034078,
    20034100, 
    blocks_per_thread = 1
);

About scrooge

Scrooge McDuck is a third-party financial extension for DuckDB. This extension's main goal is to support a set of aggregation functions and data scanners for financial data. It currently supports access to the logs of Ethereum nodes and stock information from Yahoo Finance. More information on the supported scanners and functions can be found on Scrooge's wiki page. You can also find a ROI example of Ether on the following blogpost

Added Functions

function_name function_type description comment examples
ad_line aggregate NULL NULL  
annualized_volatility aggregate NULL NULL  
atr aggregate NULL NULL  
avg_win_loss_ratio aggregate NULL NULL  
bollinger_lower aggregate NULL NULL  
bollinger_middle aggregate NULL NULL  
bollinger_signal scalar NULL NULL  
bollinger_upper aggregate NULL NULL  
bollinger_width aggregate NULL NULL  
bs_call scalar NULL NULL  
bs_delta_call scalar NULL NULL  
bs_delta_put scalar NULL NULL  
bs_gamma scalar NULL NULL  
bs_implied_vol scalar NULL NULL  
bs_put scalar NULL NULL  
bs_theta_call scalar NULL NULL  
bs_theta_put scalar NULL NULL  
bs_vega scalar NULL NULL  
calmar_ratio aggregate NULL NULL  
cmf aggregate NULL NULL  
coingecko table NULL NULL  
composite_score scalar NULL NULL  
cumulative_return aggregate NULL NULL  
dema aggregate NULL NULL  
drawdown_duration aggregate NULL NULL  
ema aggregate NULL NULL  
expectancy aggregate NULL NULL  
first_s aggregate NULL NULL  
fred_series table NULL NULL  
information_ratio aggregate NULL NULL  
is_doji scalar NULL NULL  
is_engulfing scalar NULL NULL  
is_evening_star scalar NULL NULL  
is_hammer scalar NULL NULL  
is_morning_star scalar NULL NULL  
is_shooting_star scalar NULL NULL  
kelly_fraction scalar NULL NULL  
last_s aggregate NULL NULL  
log_return scalar NULL NULL  
ma_crossover_signal scalar NULL NULL  
macd_line aggregate NULL NULL  
max_drawdown aggregate NULL NULL  
mfi aggregate NULL NULL  
momentum_score aggregate NULL NULL  
obv aggregate NULL NULL  
pivot_point scalar NULL NULL  
pivot_r1 scalar NULL NULL  
pivot_r2 scalar NULL NULL  
pivot_r3 scalar NULL NULL  
pivot_s1 scalar NULL NULL  
pivot_s2 scalar NULL NULL  
pivot_s3 scalar NULL NULL  
portfolio_beta aggregate NULL NULL  
portfolio_correlation aggregate NULL NULL  
profit_factor aggregate NULL NULL  
read_eth table NULL NULL  
relative_strength aggregate NULL NULL  
rsi aggregate NULL NULL  
rsi_signal scalar NULL NULL  
sharpe_ratio aggregate NULL NULL  
simple_return scalar NULL NULL  
sma aggregate NULL NULL  
sortino_ratio aggregate NULL NULL  
stochastic_k aggregate NULL NULL  
tema aggregate NULL NULL  
timebucket scalar NULL NULL  
value_at_risk aggregate NULL NULL  
volatility aggregate NULL NULL  
vwap aggregate NULL NULL  
win_rate aggregate NULL NULL  
wma aggregate NULL NULL  
yahoo_finance table NULL NULL  

Overloaded Functions

| function_name | function_type | description | comment | examples | |—————|—————|————-|———|———-|

Added Types

| type_name | type_size | logical_type | type_category | internal | |———–|———-:|————–|—————|———-|

Added Settings

name description input_type scope aliases
eth_node_url URL of Ethereum node to be queried VARCHAR GLOBAL []