Endpoints on this page require the Tax Data add-on ($49 a month, not part of any bundle). Without it they return HTTP 402 with
"addon": "taxData". Available on Starter, Builder, Growth and Scale, and on request on Enterprise. It is not part of the 7-day trial.https://nexus.gerowallet.io · Auth: X-Api-Key: nxs_…
What it covers
- Cardano mainnet keys and stake addresses (
stake1…) only. A key for any other network answers400with the codeTAX_NETWORK_UNSUPPORTED. - Only API keys may call these endpoints. A browser session answers
403. - Events are reported per wallet, with a stable id for every event.
- Labels describe what happened on chain. They are facts, not a tax treatment: deciding how an event is taxed is up to you and your adviser.
- A value that cannot be computed is
nulland its leg isNO_PRICE, never zero. - A wallet is a stake address: the events of every address that carries its stake key. Addresses with no stake part (enterprise addresses) belong to no wallet.
Endpoints
Parameters
The single-wallet read takes these as query parameters; the multi-wallet read takes the same names in its JSON body, plusstakeAddresses.
With no
country, taxYear, from or to, the window is the whole history up to now.
Where a window ends
A window covers only what is settled: it ends about 15 minutes before the newest block we have indexed, or where you asked it to end if that is earlier. This holds however the end was given: noto, a to in the last minutes or in the future, or a taxYear that is still running. window.toExclusive in the response (also sent as the X-Window-End header, which is the only place a CSV page carries it) is the end that was used.
- Every event before
window.toExclusiveis in the answer. To read on later, sendfrom=<window.toExclusive>of the last read: nothing is missed and nothing comes twice. - The end is fixed when the first page is read, and the cursor carries it. All pages of one read have the same
window, and a read of many pages does not chase a moving end. - Staking rewards are dated at the start of the epoch in which they became spendable, and are indexed some time after it. Until they are, a window ends at that epoch’s start.
- When our indexing falls behind, the window ends earlier, by as much. No event is skipped.
- A window that starts inside those last minutes is a normal answer with no events:
window.toExclusiveis its ownfrom.
Paging
Events come in chain order, a page at a time. A page holds up tolimit transactions and every event they produce, plus the staking rewards that fall in the same stretch of time. A page never splits a transaction.
A page’s staking rewards span at most 1,000 epochs divided by the number of wallets in the request: 50 epochs for 20 wallets, 1,000 for one (more than the whole history of staking so far). A page that would reach further ends at the start of an epoch and has a nextCursor, even when it holds fewer than limit transactions or none.
- Read
nextCursorfrom the JSON body (also sent as theX-Next-Cursorresponse header, which is the only place a CSV page carries it) and pass it back ascursor. Repeat until it is absent:nullin JSON, no header in CSV. - The last page can hold no transactions at all, only the remaining rewards. Keep following cursors until
nextCursoris absent, not until a page is short or empty. - The cursor is opaque. It holds a position and the end of the window, so the end stays where the first page put it (where a window ends). Everything else comes from the request: send the same
country,taxYear,from,to,currency,timezoneandlimitwith every page. - Pages are independent: nothing is held between requests, so a wallet with a long history costs more pages, not a longer one.
The response
Events
One transaction can produce several events, all sharing itstxHash, in a fixed order: fee, deposit or refund, withdrawal, order, transfer, then the main event. Every event has:
Types
Orders placed for the wallet
Some services place an exchange order on a wallet’s behalf, from an address of their own: a deposit address you send ADA to, or a contract that splits one amount into several orders. The order belongs to your wallet (its datum, or the exchange’s order data, says so), but when it sits at an address with no stake key of yours, the transaction that created it does not touch your wallet, so it is not among your events. What you sent the service is aSEND like any other.
The order’s contents are reported in the transaction that spends the order, its fill or its cancellation, when that is among your events: a RECEIVE with the role order (one per wallet and transaction, the contents of every such order it spends summed, ADA and tokens), then the events that transaction has anyway, such as the TRADE that uses them up. The RECEIVE is dated and valued at that transaction, not at the order’s creation.
Legs
Every field of a leg is always present; a value that is not known isnull, never omitted and never zero.
priceQuality is one of:
Ids and revisions
An event id is built only from facts that never change, with no position in the page, so it does not move when a later price or trade row arrives:
Revision contract. An id always refers to the same transaction, wallet and role. Its
type and its values may be revised later: a corrected price, a newly priced token, a better classifier, an order datum that became readable. Nothing is stored on our side, so a revised event simply comes back changed. A revision can also change which events a transaction produces: a trade row that arrives late can turn a transaction’s transfer events into one main event, so an id can disappear as well as change. To pick up revisions, re-pull the range and replace everything you stored for that range with what comes back, rather than matching events by id. classifierVersion rises whenever the classification rules change.
Coverage
coverage.counts on a page counts these codes. NO_PRICE and STALE_PRICE count legs, by their priceQuality (NO_PRICE and STALE_POOL_PRICE), and never appear in an event’s flags. Every other code is an event flag and counts the events flagged with it.
coverage.excludes is the same list on every page, of what is never classified:
Known limitation. Before 2025-01-01, a one-sided liquidity “zap” order filled through an exchange order script (ADA for a liquidity token, or a liquidity token back to ADA) can appear as an
ORDER_FILL TRADE rather than as a liquidity movement.
CSV
format=csv returns text/csv; charset=UTF-8: a header row, then one row per leg (an event with no legs has no row), lines ending in CRLF (RFC 4180). The columns, in order:
id, wallet, txHash, blockTime, type, role, direction, unit, ticker, decimals, quantityRaw, quantity, valueAda, valueFiat, currency, priceQuality, priceTime, tradeKind, venues, earnedEpoch, spendableEpoch, rewardType, poolId, fromWallet, toWallet
- The values are the JSON page’s own strings, so CSV and JSON agree for the same page. Every number keeps full precision, except
valueFiat, which has exactly two decimals, rounded half to even. A missing value is an empty field. venuesjoins the trade’s exchanges with;. The trade, reward and transfer columns are empty on events that have no such detail.- Fields that begin with
=,+,-,@, a tab or a carriage return (unless they are plain numbers) get a leading', so a spreadsheet never reads a token ticker as a formula; fields with a comma, quote or line break are quoted, with inner quotes doubled. - The next page’s cursor is in the
X-Next-Cursorheader, and the end of the window inX-Window-End.
Balances
GET /api/tax/cardano/{stakeAddress}/balances?at=… returns what a wallet held at a moment, so you can check a window on your side:
Reconciliation. For a window
[from, toExclusive), per unit, the balance at the end equals the balance at the start plus the signed legs of every event in the window (in positive, out negative), counting ADA together with the reward account and leaving out REWARD_WITHDRAWAL events (they only move ADA from the reward account into the UTxO set):
window of the response, not the one you asked for. Read the start balance at one second before the window’s first second and the end balance at one second before toExclusive (both rounded up to whole seconds first, as slots begin on whole seconds), for example at=<unix seconds of window.from> - 1. A difference is worth reporting: it means an event is missing or wrong, with the two known exceptions below.
Open orders at addresses with no stake key. /balances counts only outputs at addresses that carry the stake key. The events treat an exchange order the wallet placed as still the wallet’s until it fills (placing it is no SEND; the fill is the TRADE), even when the order sits at an address with no stake key of the wallet’s (none, or the exchange’s own). Such an order is missing from utxo while it is open (an order placed for the wallet by someone else is missing from the events too, until it is filled or cancelled, so it makes no difference here, unless another wallet of the same request placed it). So when one is open at the start or the end of the window (across from or toExclusive), the two sides differ by that order’s contents. Allow for the order’s contents, or check a window whose edges fall outside the time the order was open.
Orders spent without your wallet. A transaction that spends such an order but has no input, output, withdrawal or stake certificate of your wallet is not among your events: a fill that pays out to another address, or a partial fill that leaves what it bought in the order. What it took out of the order stays unreported, and the two sides differ by that.
Country presets
country sets the default currency, the start of the tax year and the time zone. from, to, currency and timezone override each part. With taxYear the window is the year that starts on that date and ends on the same date a year later, in the zone.
The preset is only a default window; it is not a statement of any country’s rules.
Limits and retries
429: not now
A429 carries a Retry-After header (5 to 10 seconds, varied so that clients refused together do not return together) and an errorCode:
Wait
Retry-After seconds and send the same request again, with the same cursor: nothing is lost, and the page is the same when it comes. When you read a history of many pages:
- On the first two codes keep asking. In a busy hour a page can be refused many times in a row; limit the time you spend on a wallet, not the number of refusals.
- On
TAX_READ_TIMEOUTtry a few times, a minute apart. What the first try read makes the next one faster, so most pass. If the same request still answers it, a smallerlimitcan help on an events page that is not deep in a long history; otherwise write to us with the request’s time. - Read one wallet’s pages one after another, and only a few wallets at once. More requests in flight than the limit above are refused, not served sooner. Your organization’s pages also read the chain in only part of the service’s capacity at once, so that other customers’ pages go on while yours read: more pages at once than that wait their turn or answer
TAX_READ_BUSY. - Keep the last
nextCursoryou received. A read that stopped continues from there; it does not have to start again.
202: prices not ready
When prices cannot be read from the market-data service right now, the answer is202 with Retry-After (30 seconds by default) and this body, and nothing is valued with a guessed price:
Retry-After seconds. The body is not an error object.
503: chain data not ready
503 with the errorCode TAX_CHAIN_NOT_READY and Retry-After (60 seconds) means the service cannot tell how far its copy of the chain reaches, so it cannot say where your window ends. Nothing is wrong with the request: keep the cursor, if you have one, and ask again later, less often than for a 429.
Errors
Errors use the standard error body with a stableerrorCode. Checks run in this order, before the request takes one of your organization’s in-flight slots: the key’s network, the stake addresses, the wallet count, limit, format, cursor, then the window.