### Connect to Solana indexer with clickhouse-connect Source: https://onchaindivers.com/solana/getting-started Python example using the `clickhouse-connect` library to connect to the Solana indexer. Install the client with `pip install clickhouse-connect`. Reads connection details from environment variables. ```python import os import clickhouse_connect client = clickhouse_connect.get_client( host=os.environ["CLICKHOUSE_HOST"], port=int(os.environ.get("CLICKHOUSE_PORT", "8123")), username=os.environ["CLICKHOUSE_USERNAME"], password=os.environ["CLICKHOUSE_PASSWORD"], ) rows = client.query("SELECT now() AS server_time").named_results() print(rows) client.close() ``` -------------------------------- ### Inspect and run creator migration rates example Source: https://onchaindivers.com/solana/examples Displays the first 220 lines of the creator migration rates query and then executes all bounded examples with the strict-live verifier. The query anchors a 30-day window to the latest timestamp in pumpfun_token_creation and joins mints to pfamm_migrations. ```bash # Source query sed -n '1,220p' examples/solana/creator_migration_rates.sql # Execute all bounded examples python3 scripts/verify_examples.py --strict-live ``` -------------------------------- ### Connect to ClickHouse with Python Source: https://onchaindivers.com/llms-full.txt Use the clickhouse-connect library to establish a connection and execute queries. Install the client via pip install clickhouse-connect. ```python import os import clickhouse_connect client = clickhouse_connect.get_client( host=os.environ["CLICKHOUSE_HOST"], port=int(os.environ.get("CLICKHOUSE_PORT", "8123")), username=os.environ["CLICKHOUSE_USERNAME"], password=os.environ["CLICKHOUSE_PASSWORD"], ) rows = client.query("SELECT now() AS server_time").named_results() print(rows) client.close() ``` -------------------------------- ### Example Query: SELECT from pumpswap_all_swaps Source: https://onchaindivers.com/llms-full.txt Example ClickHouse SQL query to retrieve the first 10 rows from the default.pumpswap_all_swaps table. Use this to explore the table's data structure and contents. ```sql SELECT * FROM default.pumpswap_all_swaps LIMIT 10 ``` -------------------------------- ### Environment variable: HYPERLIQUID_ORDER_BOOKS Source: https://onchaindivers.com/hyperliquid/examples Configures the HTTP archive listing for the order book example. The example supports a local directory or a configurable HTTP archive listing. ```bash HYPERLIQUID_ORDER_BOOKS=https://captures.example.com/hyperliquid/ ``` -------------------------------- ### Query raydium_launchpad_swaps in ClickHouse Source: https://onchaindivers.com/llms-full.txt Example SQL query to retrieve the first 10 records from the raydium_launchpad_swaps table in the solana database. ```sql SELECT * FROM default.raydium_launchpad_swaps LIMIT 10 ```