portfolIQ
Documentation

From REST to BI in 10 minutes

Complete walkthrough — signup, SQL credentials, direct Star Schema access, BI tool connection. Get from zero to a working dashboard in 10 minutes.

From REST to BI in 10 minutes

This guide walks you through the complete portfolIQ flow: sign up → get SQL credentials → connect your BI tool to the Star Schema via PostgreSQL → build your first dashboard.

dbt package: The portfoliq-dbt public package is not yet published. Steps 3–5 below cover the direct SQL path (available today on Growth+). Once the dbt package is released, you will also be able to install it via dbt deps — see dbt package docs.

Note on BI tool connection: portfolIQ does not ship certified native connectors for Power BI or Tableau. Connection is via standard PostgreSQL (ODBC/JDBC).

Prerequisites:

  • portfolIQ Growth plan (or above) — required for SQL access
  • A working PostgreSQL-compatible warehouse (local Postgres, RDS, Cloud SQL, Supabase, etc.)
  • dbt-core ≥ 1.7 installed (optional — for the dbt path, coming soon)
  • One of: Power BI Desktop, Tableau Desktop, or Metabase (connected via PostgreSQL)

Step 1 — Sign up and get an API key (1 min)

Sign up at portfoliq.io. After email confirmation, navigate to /dashboard/keys and create a new API key. Save it — you'll need it in the next step.


Step 2 — Get SQL credentials (1 min)

curl -X POST https://api.portfoliq.io/v1/billing/sql-credentials \
  -H "X-API-Key: YOUR_API_KEY"

Response (201):

{
  "host": "db.portfoliq.io",
  "port": 5433,
  "database": "portfoliq",
  "schema": "star_public",
  "username": "sql_user_xxxxxxxx",
  "password": "...",
  "note": "Save this password — it cannot be retrieved later"
}

Save the password now. It cannot be retrieved after this response. Maximum 5 active credentials per API key.


Step 3 — dbt package (coming soon — skip for now)

Not yet published. The portfoliq-dbt package will be installable via dbt deps at v1.0 launch. For now, use direct SQL access (Steps 4–6) to query the Star Schema without dbt. Skip this step until the package is released.

The planned install will be:

packages:
  - package: portfoliq/portfoliq-dbt
    version: 0.1.0
dbt deps

Step 4 — Configure the source connection (1 min)

Add a profile to your profiles.yml:

portfoliq:
  target: dev
  outputs:
    dev:
      type: postgres
      host: db.portfoliq.io
      port: 5433
      database: portfoliq
      schema: star_public
      user: sql_user_xxxxxxxx
      password: <step 2 password>
      sslmode: require

In your dbt_project.yml, enable the Star Schema feature flag:

vars:
  portfoliq_enable_star: true

Step 5 — Run the package (2 min)

dbt run
dbt test

You should see 17 models materialized and 125 tests passing. If portfoliq_enable_star is not set to true, models compile but return empty result sets — this is expected behavior for dry-runs.


Step 6 — Connect your BI tool (3 min)

At this point, your warehouse has the materialized Star Schema. Connect your BI tool to your warehouse — not to portfolIQ directly. portfolIQ is the source; dbt materialized the data into your own database.

Option A — Power BI Desktop

  1. Open Power BI Desktop → Get DataPostgreSQL database
  2. Server: your warehouse host (e.g. localhost or your RDS endpoint), Database: your warehouse database
  3. Data Connectivity mode: Import (recommended for most use cases)
  4. Credentials: select Database authentication → enter your warehouse credentials (not portfolIQ)
  5. From the navigator, expand the schema where dbt materialized the models → select fact_market_snapshot, dim_asset, dim_date
  6. Power BI auto-detects relationships via the relationships tests declared in the dbt package

Option B — Tableau Desktop

  1. Tableau → ConnectTo a ServerPostgreSQL
  2. Server: your warehouse host, Port: your warehouse port, Database: your warehouse database
  3. Username / Password: your warehouse credentials (not portfolIQ)
  4. In the data canvas: drag fact_market_snapshot → drag dim_asset → relationship is auto-detected on asset_sk

Option C — Metabase

  1. Metabase admin → DatabasesAdd databasePostgreSQL
  2. Host: your warehouse host, Port: your warehouse port, Database: your warehouse database
  3. Username / Password: your warehouse credentials (not portfolIQ)
  4. Schemas to sync: select only the schema where dbt materialized the models
  5. Once synced: Browse data → click fact_market_snapshot → Filter / Visualize

Step 7 — Build your first dashboard

Suggested first metric: Top 10 assets by market cap (see examples/queries/01_top10_assets_by_market_cap.sql in the dbt package).

SELECT
  d.symbol,
  d.name,
  m.market_cap_derived_usd
FROM star_public.fact_market_snapshot m
JOIN star_public.dim_asset d ON m.asset_sk = d.asset_sk
WHERE m.snapshot_date = CURRENT_DATE - 1
  AND d.is_current = true
ORDER BY m.market_cap_derived_usd DESC NULLS LAST
LIMIT 10;

Paste this into your BI tool's native SQL editor, or build it via the drag-and-drop interface using the relationships already detected in Step 6.

The examples/queries/ directory in the dbt package includes 20 ready-to-run queries covering BTC dominance, P/S ratio leaders, DeFi TVL, AI sentiment trends, and more.


Troubleshooting

SymptomCauseFix
Connection timeoutstatement_timeout = 5s at PG role levelAlways filter by asset_id, date_day, or chain_id — avoid full-table scans
permission denied on star_public.dim_assetWrong schema or credential mismatchConfirm you are connecting to your warehouse (dbt target), not db.portfoliq.io
permission denied on marts.dim_assetUsing internal schema nameUse star_public.* (the public schema) — marts.* is internal
dbt run fails immediatelyFeature flag not setSet portfoliq_enable_star: true in your dbt_project.yml vars
Empty models after dbt runFeature flag set to falseSet portfoliq_enable_star: true

Next steps


Disclaimer

Not financial advice. Not a fatwa. Methodology disclosed. Data provided for informational purposes only. Sources: DeFiLlama (MIT licence), public RPC endpoints, BigQuery public data (MIT), Anthropic Claude API. No CoinGecko data redistributed as-is.