| CREATE TABLE IF NOT EXISTS trades |
| ( |
| timestamp DateTime('UTC'), |
| signature String, |
|
|
| slot UInt64, |
| transaction_index UInt32, |
| instruction_index UInt16, |
| success Boolean, |
| error Nullable(String), |
|
|
| |
| priority_fee Float64, |
| bribe_fee Float64, |
| coin_creator_fee Float64, |
| mev_protection UInt8, |
|
|
| |
| maker String, |
|
|
| |
| base_balance Float64, |
|
|
| |
| quote_balance Float64, |
|
|
|
|
| |
| trade_type UInt8, |
| protocol UInt8, |
| platform UInt8, |
|
|
| |
| pool_address String, |
| base_address String, |
| quote_address String, |
|
|
| |
| slippage Float32, |
| price_impact Float32, |
|
|
| base_amount UInt64, |
| quote_amount UInt64, |
|
|
| price Float64, |
| price_usd Float64, |
|
|
| total Float64, |
| total_usd Float64 |
|
|
| ) |
| ENGINE = MergeTree() |
| ORDER BY (base_address, timestamp, maker, signature); |
|
|
| |
| CREATE TABLE IF NOT EXISTS mints |
| ( |
| |
| |
| signature String, |
| |
| timestamp DateTime('UTC'), |
| slot UInt64, |
| success Boolean, |
| error Nullable(String), |
| priority_fee Float64, |
|
|
| |
| |
| |
| protocol UInt8, |
|
|
| |
| mint_address String, |
| creator_address String, |
| pool_address String, |
|
|
| |
| initial_base_liquidity UInt64, |
| initial_quote_liquidity UInt64, |
|
|
| |
| token_name Nullable(String), |
| token_symbol Nullable(String), |
| token_uri Nullable(String), |
| token_decimals UInt8, |
| total_supply UInt64, |
|
|
| is_mutable Boolean, |
| update_authority Nullable(String), |
| mint_authority Nullable(String), |
| freeze_authority Nullable(String), |
|
|
| ) |
| ENGINE = MergeTree() |
| ORDER BY (timestamp, creator_address, mint_address); |
|
|
| CREATE TABLE IF NOT EXISTS migrations |
| ( |
| |
| timestamp DateTime('UTC'), |
| |
| signature String, |
| slot UInt64, |
| success Boolean, |
| error Nullable(String), |
| priority_fee Float64, |
|
|
| |
| protocol UInt8, |
|
|
| |
| mint_address String, |
| virtual_pool_address String, |
| pool_address String, |
| |
| |
| migrated_base_liquidity Nullable(UInt64), |
| migrated_quote_liquidity Nullable(UInt64) |
| ) |
| ENGINE = MergeTree() |
| ORDER BY (mint_address, virtual_pool_address, pool_address, timestamp); |
|
|
| CREATE TABLE IF NOT EXISTS fee_collections |
| ( |
| |
| timestamp DateTime('UTC'), |
| |
| signature String, |
| slot UInt64, |
| success Boolean, |
| error Nullable(String), |
| priority_fee Float64, |
|
|
| |
| protocol UInt8, |
|
|
| |
| vault_address String, |
| recipient_address String, |
|
|
| |
| token_0_mint_address String, |
| token_0_amount Float64, |
| token_1_mint_address Nullable(String), |
| token_1_amount Nullable(Float64) |
| ) |
| ENGINE = MergeTree() |
| ORDER BY (vault_address, recipient_address, timestamp); |
|
|
| CREATE TABLE IF NOT EXISTS liquidity |
| ( |
| |
| signature String, |
| timestamp DateTime('UTC'), |
| slot UInt64, |
| success Boolean, |
| error Nullable(String), |
| priority_fee Float64, |
|
|
| |
| protocol UInt8, |
|
|
| |
| change_type UInt8, |
| lp_provider String, |
| pool_address String, |
|
|
| |
| base_amount UInt64, |
| quote_amount UInt64 |
| ) |
| ENGINE = MergeTree() |
| ORDER BY (timestamp, pool_address, lp_provider); |
|
|
| CREATE TABLE IF NOT EXISTS pool_creations ( |
| |
| signature String, |
| timestamp Datetime('UTC'), |
| slot UInt64, |
| success Boolean, |
| error Nullable(String), |
| priority_fee Float64, |
|
|
| |
| protocol UInt8, |
|
|
| |
| creator_address String, |
| pool_address String, |
| base_address String, |
| quote_address String, |
| lp_token_address String, |
|
|
| |
| initial_base_liquidity Nullable(UInt64), |
| initial_quote_liquidity Nullable(UInt64), |
| base_decimals Nullable(UInt8), |
| quote_decimals Nullable(UInt8) |
| ) |
| ENGINE = MergeTree() |
| ORDER BY (base_address, creator_address); |
|
|
| CREATE TABLE IF NOT EXISTS transfers |
| ( |
| |
| timestamp DateTime('UTC'), |
| signature String, |
| slot UInt64, |
| success Boolean, |
| error Nullable(String), |
| priority_fee Float64, |
|
|
| |
| source String, |
| destination String, |
|
|
| |
| mint_address String, |
| amount UInt64, |
| amount_decimal Float64, |
|
|
| |
| source_balance Float64, |
| destination_balance Float64 |
| ) |
| ENGINE = MergeTree() |
| ORDER BY (source, destination, mint_address, timestamp); |
|
|
| CREATE TABLE IF NOT EXISTS supply_locks |
| ( |
| |
| timestamp DateTime('UTC'), |
|
|
| signature String, |
| slot UInt64, |
| success Boolean, |
| error Nullable(String), |
| priority_fee Float64, |
|
|
| |
| protocol UInt8, |
|
|
| |
| contract_address String, |
| sender String, |
| recipient String, |
| mint_address String, |
| total_locked_amount Float64, |
| final_unlock_timestamp UInt64 |
| ) |
| ENGINE = MergeTree() |
| ORDER BY (timestamp, mint_address, sender, recipient); |
|
|
| CREATE TABLE IF NOT EXISTS supply_lock_actions |
| ( |
| |
| |
| signature String, |
| timestamp DateTime('UTC'), |
| slot UInt64, |
| success Boolean, |
| error Nullable(String), |
| priority_fee Float64, |
|
|
| |
| protocol UInt8, |
|
|
| |
| action_type UInt8, |
| contract_address String, |
| user String, |
| mint_address String, |
| amount Float64 |
| ) |
| ENGINE = MergeTree() |
| ORDER BY (timestamp, mint_address, user); |
|
|
| CREATE TABLE IF NOT EXISTS burns |
| ( |
| |
| timestamp DateTime('UTC'), |
| signature String, |
| slot UInt64, |
| success Boolean, |
| error Nullable(String), |
| priority_fee Float64, |
|
|
| |
| mint_address String, |
| source String, |
| amount UInt64, |
| amount_decimal Float64, |
|
|
| source_balance Float64 |
| ) |
| ENGINE = MergeTree() |
| ORDER BY (mint_address, source, timestamp); |
|
|
| |
|
|
| CREATE TABLE IF NOT EXISTS wallet_profiles |
| ( |
| updated_at DateTime('UTC'), |
| first_seen_ts DateTime('UTC'), |
| last_seen_ts DateTime('UTC'), |
|
|
| wallet_address String, |
| tags Array(String), |
| deployed_tokens Array(String), |
|
|
| funded_from String, |
| funded_timestamp UInt32, |
| funded_signature String, |
| funded_amount Float64 |
| ) |
| ENGINE = ReplacingMergeTree(updated_at) |
| PRIMARY KEY (wallet_address) |
| ORDER BY (wallet_address); |
|
|
| CREATE TABLE IF NOT EXISTS wallet_profile_metrics |
| ( |
| updated_at DateTime('UTC'), |
| wallet_address String, |
| balance Float64, |
|
|
| transfers_in_count UInt32, |
| transfers_out_count UInt32, |
| spl_transfers_in_count UInt32, |
| spl_transfers_out_count UInt32, |
|
|
| total_buys_count UInt32, |
| total_sells_count UInt32, |
| total_winrate Float32, |
|
|
| stats_1d_realized_profit_sol Float64, |
| stats_1d_realized_profit_usd Float64, |
| stats_1d_realized_profit_pnl Float32, |
| stats_1d_buy_count UInt32, |
| stats_1d_sell_count UInt32, |
| stats_1d_transfer_in_count UInt32, |
| stats_1d_transfer_out_count UInt32, |
| stats_1d_avg_holding_period Float32, |
| stats_1d_total_bought_cost_sol Float64, |
| stats_1d_total_bought_cost_usd Float64, |
| stats_1d_total_sold_income_sol Float64, |
| stats_1d_total_sold_income_usd Float64, |
| stats_1d_total_fee Float64, |
| stats_1d_winrate Float32, |
| stats_1d_tokens_traded UInt32, |
|
|
| stats_7d_realized_profit_sol Float64, |
| stats_7d_realized_profit_usd Float64, |
| stats_7d_realized_profit_pnl Float32, |
| stats_7d_buy_count UInt32, |
| stats_7d_sell_count UInt32, |
| stats_7d_transfer_in_count UInt32, |
| stats_7d_transfer_out_count UInt32, |
| stats_7d_avg_holding_period Float32, |
| stats_7d_total_bought_cost_sol Float64, |
| stats_7d_total_bought_cost_usd Float64, |
| stats_7d_total_sold_income_sol Float64, |
| stats_7d_total_sold_income_usd Float64, |
| stats_7d_total_fee Float64, |
| stats_7d_winrate Float32, |
| stats_7d_tokens_traded UInt32, |
|
|
| stats_30d_realized_profit_sol Float64, |
| stats_30d_realized_profit_usd Float64, |
| stats_30d_realized_profit_pnl Float32, |
| stats_30d_buy_count UInt32, |
| stats_30d_sell_count UInt32, |
| stats_30d_transfer_in_count UInt32, |
| stats_30d_transfer_out_count UInt32, |
| stats_30d_avg_holding_period Float32, |
| stats_30d_total_bought_cost_sol Float64, |
| stats_30d_total_bought_cost_usd Float64, |
| stats_30d_total_sold_income_sol Float64, |
| stats_30d_total_sold_income_usd Float64, |
| stats_30d_total_fee Float64, |
| stats_30d_winrate Float32, |
| stats_30d_tokens_traded UInt32 |
| ) |
| ENGINE = MergeTree |
| ORDER BY (wallet_address, updated_at); |
|
|
| CREATE TABLE IF NOT EXISTS wallet_holdings |
| ( |
| updated_at DateTime('UTC'), |
| start_holding_at DateTime('UTC'), |
|
|
| wallet_address String, |
| mint_address String, |
| current_balance Float64, |
|
|
| realized_profit_pnl Float32, |
| realized_profit_sol Float64, |
| realized_profit_usd Float64, |
|
|
| history_transfer_in UInt32, |
| history_transfer_out UInt32, |
|
|
| history_bought_amount Float64, |
| history_bought_cost_sol Float64, |
| history_sold_amount Float64, |
| history_sold_income_sol Float64 |
| ) |
| ENGINE = MergeTree |
| ORDER BY (wallet_address, mint_address, updated_at); |
|
|
| CREATE TABLE IF NOT EXISTS tokens ( |
| updated_at DateTime('UTC'), |
| created_at DateTime('UTC'), |
|
|
| |
| token_address String, |
| name String, |
| symbol String, |
| token_uri String, |
|
|
| |
| decimals UInt8, |
| creator_address String, |
| pool_addresses Array(String), |
|
|
| |
| launchpad UInt8, |
| protocol UInt8, |
| total_supply UInt64, |
|
|
| |
| is_mutable Boolean, |
| update_authority Nullable(String), |
| mint_authority Nullable(String), |
| freeze_authority Nullable(String) |
| ) |
| ENGINE = ReplacingMergeTree(updated_at) |
| PRIMARY KEY (token_address) |
| ORDER BY (token_address, updated_at); |
|
|
| |
| CREATE TABLE IF NOT EXISTS tokens_latest |
| ( |
| updated_at DateTime('UTC'), |
| created_at DateTime('UTC'), |
|
|
| token_address String, |
| name String, |
| symbol String, |
| token_uri String, |
|
|
| decimals UInt8, |
| creator_address String, |
| pool_addresses Array(String), |
|
|
| launchpad UInt8, |
| protocol UInt8, |
| total_supply UInt64, |
|
|
| is_mutable Boolean, |
| update_authority Nullable(String), |
| mint_authority Nullable(String), |
| freeze_authority Nullable(String) |
| ) |
| ENGINE = ReplacingMergeTree(updated_at) |
| ORDER BY (token_address); |
|
|
| CREATE TABLE IF NOT EXISTS token_metrics ( |
| updated_at DateTime('UTC'), |
| token_address String, |
| total_volume_usd Float64, |
| total_buys UInt32, |
| total_sells UInt32, |
| unique_holders UInt32, |
| ath_price_usd Float64 |
| ) |
| ENGINE = MergeTree |
| ORDER BY (token_address, updated_at); |
|
|
|
|
|
|
| |
| |
|
|
| |
| CREATE TABLE IF NOT EXISTS wallet_profile_metrics_latest |
| ( |
| updated_at DateTime('UTC'), |
| wallet_address String, |
| balance Float64, |
|
|
| transfers_in_count UInt32, |
| transfers_out_count UInt32, |
| spl_transfers_in_count UInt32, |
| spl_transfers_out_count UInt32, |
|
|
| total_buys_count UInt32, |
| total_sells_count UInt32, |
| total_winrate Float32, |
|
|
| stats_1d_realized_profit_sol Float64, |
| stats_1d_realized_profit_usd Float64, |
| stats_1d_realized_profit_pnl Float32, |
| stats_1d_buy_count UInt32, |
| stats_1d_sell_count UInt32, |
| stats_1d_transfer_in_count UInt32, |
| stats_1d_transfer_out_count UInt32, |
| stats_1d_avg_holding_period Float32, |
| stats_1d_total_bought_cost_sol Float64, |
| stats_1d_total_bought_cost_usd Float64, |
| stats_1d_total_sold_income_sol Float64, |
| stats_1d_total_sold_income_usd Float64, |
| stats_1d_total_fee Float64, |
| stats_1d_winrate Float32, |
| stats_1d_tokens_traded UInt32, |
|
|
| stats_7d_realized_profit_sol Float64, |
| stats_7d_realized_profit_usd Float64, |
| stats_7d_realized_profit_pnl Float32, |
| stats_7d_buy_count UInt32, |
| stats_7d_sell_count UInt32, |
| stats_7d_transfer_in_count UInt32, |
| stats_7d_transfer_out_count UInt32, |
| stats_7d_avg_holding_period Float32, |
| stats_7d_total_bought_cost_sol Float64, |
| stats_7d_total_bought_cost_usd Float64, |
| stats_7d_total_sold_income_sol Float64, |
| stats_7d_total_sold_income_usd Float64, |
| stats_7d_total_fee Float64, |
| stats_7d_winrate Float32, |
| stats_7d_tokens_traded UInt32, |
|
|
| stats_30d_realized_profit_sol Float64, |
| stats_30d_realized_profit_usd Float64, |
| stats_30d_realized_profit_pnl Float32, |
| stats_30d_buy_count UInt32, |
| stats_30d_sell_count UInt32, |
| stats_30d_transfer_in_count UInt32, |
| stats_30d_transfer_out_count UInt32, |
| stats_30d_avg_holding_period Float32, |
| stats_30d_total_bought_cost_sol Float64, |
| stats_30d_total_bought_cost_usd Float64, |
| stats_30d_total_sold_income_sol Float64, |
| stats_30d_total_sold_income_usd Float64, |
| stats_30d_total_fee Float64, |
| stats_30d_winrate Float32, |
| stats_30d_tokens_traded UInt32 |
| ) |
| ENGINE = ReplacingMergeTree(updated_at) |
| ORDER BY (wallet_address); |
|
|
| |
| CREATE TABLE IF NOT EXISTS wallet_holdings_latest |
| ( |
| updated_at DateTime('UTC'), |
| start_holding_at DateTime('UTC'), |
|
|
| wallet_address String, |
| mint_address String, |
| current_balance Float64, |
|
|
| realized_profit_pnl Float32, |
| realized_profit_sol Float64, |
| realized_profit_usd Float64, |
|
|
| history_transfer_in UInt32, |
| history_transfer_out UInt32, |
|
|
| history_bought_amount Float64, |
| history_bought_cost_sol Float64, |
| history_sold_amount Float64, |
| history_sold_income_sol Float64 |
| ) |
| ENGINE = ReplacingMergeTree(updated_at) |
| ORDER BY (wallet_address, mint_address); |
|
|
| |
| CREATE TABLE IF NOT EXISTS token_metrics_latest |
| ( |
| updated_at DateTime('UTC'), |
| token_address String, |
| total_volume_usd Float64, |
| total_buys UInt32, |
| total_sells UInt32, |
| unique_holders UInt32, |
| ath_price_usd Float64 |
| ) |
| ENGINE = ReplacingMergeTree(updated_at) |
| ORDER BY (token_address); |
|
|
|
|
| CREATE TABLE IF NOT EXISTS known_wallets |
| ( |
| `wallet_address` String, |
| `name` String, |
| `tag` String, |
| ) |
| ENGINE = ReplacingMergeTree() |
| ORDER BY (wallet_address); |
|
|