Skip to content

API for integrators

How to read your portfolio's data out of dalubank into your own reconciliation, reporting or accounting systems. No knowledge of the dalubank internals is needed: if you can make an authenticated HTTPS request, you can use this API.

The external API lives under /v1. It is read-only, and its contract is frozen: fields are added, never renamed or repurposed (Versioning & stability).

The endpoint reference is live and code-generated

This page teaches you how the API works. For the authoritative, always-current list of endpoints and their exact request and response shapes, use the interactive reference the app serves at /v1/docs. It needs no key, and you can try requests in the browser. (/docs, without the /v1, is the app's own reference and sits behind a sign-in.)

Reshaped in November 2026

/v1 was reorganised once, before anyone outside had built on it, so that the first integrators start on the final names. If you used it before, see the API changelog for what moved.

1. Get an API key

Create a key in the app under Settings → API keys: see Managing your API keys. Copy the secret (dalu_live_…) when it's shown; it's displayed only once. A key reads one portfolio, is read-only, and can never see more than your user account can. An operator can also make a key that reads unconfirmed marks, for a check before the close is signed off (see below).

2. Authenticate

Send the key as a bearer token on every request:

curl https://<your-host>/v1/portfolios \
  -H "Authorization: Bearer dalu_live_xxxxxxxxxxxxxxxxxxxx"

That is the one way to send it. There are no cookies and no login flow. Keep the key secret and server-side; it is a credential.

3. Your first call

List the portfolios your key reads:

curl -s https://<your-host>/v1/portfolios -H "Authorization: Bearer $KEY"
{
  "total": 1,
  "items": [
    { "portfolio_id": 3, "name": "Treasury", "currency": "USD", "account_count": 4 }
  ]
}

The portfolio_id is in every path below, so a URL, a response and a file always say which portfolio they are. GET /v1/portfolios/3 describes the portfolio itself: its name and currency, the schedules its official NAVs are struck on, and its newest run.

4. The idea: lines, at an anchor

Two things carry the whole API.

A line is one amount of one token in one role, in one account at one location, with its price, where the price came from, the reading it rests on and what it adds to the NAV. A wallet balance is a line. Each leg of a DeFi position (a supply, a borrow, a reward, a perp's margin) is a line. The sum of the lines' nav_usd is the NAV, which is what a reconciliation starts from.

An anchor is the instant a read answers for. nav, lines, positions and accounts take the same anchor parameters:

Request Answers for
no parameter now
?as_of=2026-11-11T12:00:00Z that instant of the hourly history
?run_id=… that run's own instant

Whatever the anchor, the rule is the same: each account and location contributes its newest successful reading at or before the instant. If a newer reading failed, the last good one is kept (it is carried), and the response says so. Every anchored response starts with portfolio_id and anchor.

What is frozen and what isn't

A read at an instant of the hourly history can change afterwards: a reading is invalidated, a valuation is restated. Each line says which reading it rests on. The figure that never changes is an official NAV mark. Report from marks; reconcile and investigate from lines.

5. What you can read

All endpoints are GET. Rather than list every parameter here (see /v1/docs), this is the shape of what's available under /v1/portfolios/{id}:

  • nav: the NAV at an anchor, and one reading per account and location behind it: when it was taken, whether it is carried, and what it contributes. nav/history is the series, one point per run, oldest first.
  • lines: the lines behind that NAV. positions is the same lines grouped by position, with what each position does (strategy) and what it is exposed to (exposure); ?include=lines embeds its lines.
  • accounts: the accounts counted at an anchor, each with a stable account_id, its address or venue label, its name and its NAV.
  • runs: what each hourly run read, and how its readings ended; one run lists every reading it attempted and, for runs from 2026-11 on, which protocol readers it tried on each account and location (coverage).
  • pricing-changes: when each token's price source changed. One row per stretch during which a token's lines were valued from one source under one rule, so a change is where two rows meet. It is what was used, read from the lines themselves, not what was configured. Ask per token_id when you know which tokens you want: the whole portfolio reads its whole history, so it is an occasional audit call, not something to poll.
  • marks: your official NAVs, one per scheduled moment, or every version with ?versions=all; one mark with its totals, the readings it was struck from and every adjustment a person made in the close (what, on which line, why, who and when); and its lines as they were frozen, which add up to its NAV and never change.
  • returns: the portfolio's own time-weighted return between marks. position-returns: one row per position over a window, one position's periods and events, and the full derivation of one period.

Plus reference lookups under /v1/meta for locations (chains, Solana, exchanges), tokens and protocols, for labelling and joins.

account_id narrows most reads to one or more accounts; lines also filters by location, role, kind, position and token, and pricing-changes by token. An unknown query parameter is refused (422): a typo in an anchor must not quietly answer for "now".

Reading a line

  • amount is unsigned. value_usd is what it is worth, unsigned, and null when the token has no price. nav_usd is what the line adds to the NAV: signed (a borrow is negative) and 0 when the line isn't counted.
  • price_source is where the price came from; rate and underlying_token_id are there for a token priced through a rate, such as a vault share.
  • A line that is held but not counted (a receipt token its position already counts, for instance) is listed with nav_usd: 0 and the reason, so nothing you hold is missing from the file and nothing is counted twice.
  • line_key is the same for the same holding at every anchor, so two reads compare line by line.

Official NAV, and the fund's own return

Two things here are different from everything else on the API, and worth reading before you build on them.

A mark is official, and a withdrawn mark says so. A NAV mark is struck at a scheduled instant, signed off and versioned. Its state is one of final, void, provisional or superseded. Treat a row as official only when is_final is true. A mark that isn't confirmed yet is not served: not its figure, not its row, not its id. When your organisation withdraws a mark, the row stays in the list with is_final: false and nav_usd: null: a withdrawal you are told about, rather than one you would have to infer from a row quietly disappearing. It stays the withdrawn version until its replacement is official.

A mark_id is one version, and it never changes. Its figures and its lines are what was frozen when it was struck; only its state moves (confirmed, replaced, voided). Evidence you keep against a mark_id stays true. Marks struck before November 2026 have thinner lines (no rate, exclusion reason, protocol or account names): those are null, never filled in afterwards.

Unconfirmed marks, for a check before the close. A key created with reads unconfirmed marks (an operator's, see Managing your API keys) reads every version, the provisional ones too, but only on a request that asks with versions=all. Every other key, and the same key without it, reads official marks only.

The fund return is a return, not a difference of levels. Total NAV is flow-sensitive: a 10% deposit reads as a +10% return if you difference NAV. The returns read gives the time-weighted return between two official marks, with both NAVs, the net flow across the period, and how many hourly sub-periods it chained. twr is a ratio (0.0034 is +0.34%) and it is null, never 0, when nothing could be measured. Ask for two marks, a mark and now, two instants, or nothing at all (which gives inception to date).

Unlike the per-position returns below, these reads are not experimental: a mark is an official figure, and a return chained between two marks inherits the marks' standing. A portfolio that does not strike official NAVs returns 404 on both reads rather than an empty list.

Returns carry their own caveats

Position return figures come from the same engine the app's screens use, so the API and the UI never disagree about the same holding over the same period. They also carry the same honesty flags, and you should surface them rather than drop them:

  • A period dalubank could not compute cleanly is marked estimated, or withheld (reported as unavailable with a reason) instead of arriving as a silent 0. Do not read a missing return as a flat one.
  • A holding whose capital is too small for a rate to mean anything is flagged (low_capital); its percentages are not meaningful and should not be charted. Its dollar figures are still valid.
  • Position returns are experimental: a past period can be restated after a correction. If you store a returns series, refresh it rather than treating an old pull as final.

See Performance & returns for what each figure means.

6. CSV export

Every list can return flat CSV with ?format=csv (or an Accept: text/csv header):

curl -s "https://<your-host>/v1/portfolios/3/lines?run_id=$RUN&format=csv" \
  -H "Authorization: Bearer $KEY" -OJ
  • The file says what it is. It is named after the portfolio and, for an anchored read, the instant (dalubank_p3_lines_2026-11-11T1200Z.csv), and every row carries the portfolio and the anchor.
  • Without limit, a CSV holds every row. It has no total to say it was cut short.
  • A cell reads as the JSON does: true / false, timestamps in UTC ending in Z, plain decimals, an empty cell for null. A list of ids is space-separated.
  • The lines file for a run is the file the app's run page downloads.

7. Pagination

Lists return { "portfolio_id", "total", "items" } and accept limit (default 1000, at most 10000) and offset. total is the full count, so page until offset >= total. Each list has one order, oldest first for anything in time:

GET /v1/portfolios/3/lines?limit=500&offset=0
GET /v1/portfolios/3/lines?limit=500&offset=500

8. Conventions

  • Money is a string, in US dollars, in a field that ends in _usd ("12874203.55"). Parse it as a decimal, not a float.
  • A ratio is a ratio: 0.0034 is 0.34%.
  • Null is not zero. A figure that can't be stated is null, and a field beside it says why.
  • Timestamps are UTC (2026-07-12T14:00:00Z). as_of is the instant a figure is valued at; block_ts is when a reading was taken.
  • Freshness. Data changes about once an hour. Poll the portfolio document's data_version: while it is the same as last time, nothing you could read has changed. It can also move when nothing you read did (it is broader than your key's reads), so a new value means "look", not "something changed". When it moves, runs and marks take ?updated_since= and list the rows changed since then (each row carries its updated_at). Pass the newest updated_at you saw minus a few minutes, since a run or a restatement can take that long to become visible.

9. Errors

Errors use a single envelope:

{ "error": { "code": "not_found", "message": "Portfolio not found." } }
Status code Meaning
401 unauthorized Missing or invalid API key
403 forbidden The key may not make this request (asking for unconfirmed marks)
404 not_found Something that doesn't exist or that the key can't see
422 unprocessable_entity A bad or unknown query parameter, or two that can't be combined
429 rate_limited Too many requests: wait Retry-After seconds

A portfolio outside your key's scope is a 404, never the data: the API won't confirm the existence of things you can't see.

10. Rate limits

Each key is capped at a fixed number of requests per rolling minute (default 120; the response carries an X-RateLimit-Limit header). Exceeding it returns 429 with a Retry-After header.

Currency

The API reports money in US dollars, always. Every *_usd field is in USD on every endpoint and in every file, whatever currency the portfolio uses in the app. The API has no currency parameter. A portfolio's own currency is its currency in /v1/portfolios.

Converting a value. On a euro or pound portfolio, nav includes fx: the exchange rate at the anchor, in dollars per one unit of the currency (1.0821 means €1 = $1.0821). nav_usd ÷ rate is the NAV in the currency. The lines file does this for you: its last columns repeat the money in the portfolio's currency, all at that one rate.

A euro or pound reading of returns. Convert a value this way, never a return: a return spans many exchange rates. So on a euro or pound portfolio the returns reads also include that currency's figures next to the dollar ones, in fields that end in _value (twr_value, window_twr_value, end_nav_value, …), with the rate they used:

{ "portfolio_id": 3, "total": 12, "items": [ /* rows with *_usd and *_value fields */ ],
  "currency": "EUR", "fx_rate": "1.0821", "fx_as_of": "2026-07-18T14:00:00Z" }
  • The dollar figure is the contract. The *_value fields are a second reading. On a USD portfolio they are null.
  • Returns are re-derived, not multiplied. Each period is converted at the exchange rate of its own time, so a euro return can differ in sign from the dollar return when the rate moved. fx_value is the part that came from the exchange rate. See Display currency.

Recipes

Reconcile a run against your own books

# the runs of a day, then the lines behind one of them
curl -s "https://<your-host>/v1/portfolios/3/runs?from=2026-11-11T00:00:00Z&to=2026-11-11T23:59:59Z" \
  -H "Authorization: Bearer $KEY"
curl -s "https://<your-host>/v1/portfolios/3/lines?run_id=$RUN&format=csv" \
  -H "Authorization: Bearer $KEY" -OJ

The file's nav_usd column sums to nav?run_id=$RUN.

The official NAVs of a year → CSV

curl -s "https://<your-host>/v1/portfolios/3/marks?from=2026-01-01T00:00:00Z&format=csv" \
  -H "Authorization: Bearer $KEY" -OJ

Check a struck mark before it is confirmed (a key that reads unconfirmed marks)

# every version at the month-end instant, then the lines of the newest one
curl -s "https://<your-host>/v1/portfolios/3/marks?as_of=2026-10-31T23:00:00Z&versions=all"   -H "Authorization: Bearer $NAV_CHECK_KEY"
curl -s "https://<your-host>/v1/portfolios/3/marks/$MARK/lines?versions=all&format=csv"   -H "Authorization: Bearer $NAV_CHECK_KEY" -OJ

The file's nav_usd column sums to the mark's nav_usd; a line a person changed names the decision (adjustment_action, adjustment_reason).

Pick up what changed since your last pull

# one small read: has anything changed?
curl -s https://<your-host>/v1/portfolios/3 -H "Authorization: Bearer $KEY" | jq -r .data_version
# it has: the runs and marks changed since then
curl -s "https://<your-host>/v1/portfolios/3/runs?updated_since=$SINCE" -H "Authorization: Bearer $KEY"
curl -s "https://<your-host>/v1/portfolios/3/marks?updated_since=$SINCE" -H "Authorization: Bearer $KEY"

A run listed again was read again or had a reading invalidated: read its lines (lines?run_id=) again. A mark listed again changed state (signed off, replaced, voided, or flagged stale); its figures and lines never change.

Month-end NAV series → CSV

curl -s "https://<your-host>/v1/portfolios/3/nav/history?interval=month&format=csv" \
  -H "Authorization: Bearer $KEY" -OJ

Versioning & stability

The /v1 surface is a frozen contract. What that guarantees:

  • Routes, parameters and field names keep their names and meaning.
  • Changes are additive. New fields, parameters and endpoints may appear; parse defensively and ignore fields you don't recognize.
  • A breaking change gets a new version, under a new path, never silently under /v1.

Because the endpoint reference at /v1/docs is generated from the running app, it's always the authoritative, current description of every request and response shape. The API changelog says what changed and when.