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-dbtpublic 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 viadbt 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-dbtpackage will be installable viadbt depsat 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
- Open Power BI Desktop → Get Data → PostgreSQL database
- Server: your warehouse host (e.g.
localhostor your RDS endpoint), Database: your warehouse database - Data Connectivity mode:
Import(recommended for most use cases) - Credentials: select Database authentication → enter your warehouse credentials (not portfolIQ)
- From the navigator, expand the schema where dbt materialized the models → select
fact_market_snapshot,dim_asset,dim_date - Power BI auto-detects relationships via the
relationshipstests declared in the dbt package
Option B — Tableau Desktop
- Tableau → Connect → To a Server → PostgreSQL
- Server: your warehouse host, Port: your warehouse port, Database: your warehouse database
- Username / Password: your warehouse credentials (not portfolIQ)
- In the data canvas: drag
fact_market_snapshot→ dragdim_asset→ relationship is auto-detected onasset_sk
Option C — Metabase
- Metabase admin → Databases → Add database → PostgreSQL
- Host: your warehouse host, Port: your warehouse port, Database: your warehouse database
- Username / Password: your warehouse credentials (not portfolIQ)
- Schemas to sync: select only the schema where dbt materialized the models
- 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
| Symptom | Cause | Fix |
|---|---|---|
| Connection timeout | statement_timeout = 5s at PG role level | Always filter by asset_id, date_day, or chain_id — avoid full-table scans |
permission denied on star_public.dim_asset | Wrong schema or credential mismatch | Confirm you are connecting to your warehouse (dbt target), not db.portfoliq.io |
permission denied on marts.dim_asset | Using internal schema name | Use star_public.* (the public schema) — marts.* is internal |
dbt run fails immediately | Feature flag not set | Set portfoliq_enable_star: true in your dbt_project.yml vars |
Empty models after dbt run | Feature flag set to false | Set portfoliq_enable_star: true |
Next steps
- 20+ example queries —
dbt-package/examples/queries/in the package - Full BI client guides — SQL Direct Access (psql, DBeaver, Power BI, Tableau, Metabase, Lightdash)
- Available models reference — portfoliq-dbt package overview
- API reference — /docs/api-reference
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.