---
title: "List cost-basis lot ledger entries"
method: GET
path: "/v1/portfolios/{portfolioSlug}/cost-basis-lots"
tags: ["Portfolios"]
deprecated: true
---

# List cost-basis lot ledger entries

`GET /v1/portfolios/{portfolioSlug}/cost-basis-lots`

## Request

- Base URL: `https://api.tokenbooks.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tokenbooks.io/v1/portfolios/{portfolioSlug}/cost-basis-lots`
- Auth: API key in header `x-api-key`

> **Deprecated.**

Returns a paginated cost-basis lot ledger for a portfolio. Supports AIP-160 filter strings and optional legacy assetRef. Response rows include diff as the signed lot quantity.

## Path parameters

- `portfolioSlug` string, required

## Query parameters

- `page` integer: Page number
- `pageSize` integer: Items per page (max 100)
- `chainId` string
- `walletAddress` string: Wallet address
- `entryKind` string[]: Comma-separated lot entry kinds (ADD, DSP, CUT, MVE, RES, REL)
- `fromDate` union: Start timestamp (ISO 8601)
  - string, date-time
  - string
- `toDate` union: End timestamp (ISO 8601)
  - string, date-time
  - string
- `filter` string: AIP-160 style filter. Supported fields: id lot identifier (=, !=, in, not in), entry_id ledger-row identifier (=, !=, in, not in), asset_id (=, !=, in, not in), asset_spam (= true or false), entry_kind (=, !=, in, not in), wallet (=, !=, in, not in using chainId:address), portfolio_transaction_id (=, !=, in, not in), timestamp (=, !=, >, >=, <, <= with ISO datetimes). The asset display name is not filterable.
- `assetRef` string: Deprecated compatibility selector for asset symbol or asset id. Prefer filter=asset_id.
- `sort` string: Single sort field: timestamp, diff, value, price. Prefix with - for descending.

## Response `200`

- PaginatedCostBasisLotsResponseDto
  - `data` object[], required
    - `id` string, required: Lot identifier (e.g. btc_1)
    - `entryId` string, required: Unique lot ledger entry ID
    - `timestamp` string, required: Entry event time (ISO 8601)
    - `acquisitionTimestamp` string, required: FIFO/LIFO acquisition (lineage) date for holding-period and tax classification (ISO 8601). Equals timestamp for ADD; for a moved lot it is the original acquisition date.
    - `entryKind` 'ADD' | 'DSP' | 'CUT' | 'MVE' | 'RES' | 'REL', required: Lot entry kind (ADD, DSP, CUT, MVE, RES, REL)
    - `lotMethod` string, required: Lot accounting method (FIFO, LIFO, HIFO, ACB)
    - `diff` string, required: Signed quantity change (decimal string)
    - `price` string, nullable, required: Unit price in portfolio currency (decimal string)
    - `value` string, required: Entry value in portfolio currency (decimal string)
    - `positionId` string, nullable, required: Internal DeFi position ID, if applicable
    - `assetId` string, required: Asset ID
    - `assetSymbol` string, nullable, required: Asset symbol
    - `assetName` string, nullable, required: Asset name
    - `assetIsSpam` boolean, required: Effective spam flag after portfolio token preferences override token defaults. Assets without tokens are not spam.
    - `walletName` string, nullable, required: Wallet name when this lot is associated with a wallet.
    - `walletChainId` string, nullable, required: Wallet chain ID
    - `walletAddress` string, nullable, required: Wallet address (canonical (chainId, address) identifier)
    - `portfolioTransactionId` string, required: Originating portfolio transaction ID
    - `operationType` 'DEPOSIT_FIAT' | 'INCOME' | 'REFUND' | 'REBATE' | 'WITHDRAWAL_FIAT' | 'EXPENSE' | 'BUY' | 'SELL' | 'EXCHANGE' | 'SWAP' | 'MOVE' | 'INTERCOMPANY_SEND' | 'INTERCOMPANY_RECEIVE' | 'STAKE' | 'UNSTAKE' | 'PROTOCOL_DEPOSIT' | 'PROTOCOL_WITHDRAW' | 'VAULT_DEPOSIT' | 'VAULT_WITHDRAW' | 'LP_IN' | 'LP_OUT' | 'LOAN_BORROW' | 'LOAN_REPAY' | 'LOAN_LIQUIDATION' | 'LEND_GIVE' | 'LEND_WITHDRAW' | 'ADJUSTMENT' | 'UNCATEGORIZED' | 'SPAM' | 'null', nullable, required: Operation type of the originating transaction
    - `txHash` string, nullable, required: On-chain transaction hash from the transfer linked to this lot journal line, when present.
    - `walletTransactionTransfers` object[], required: Wallet transfers linked to the originating transaction.
      - `chainId` string, required: Transfer chain ID
      - `txHash` string, required: Transfer transaction hash
  - `pagination` object, required
    - `page` integer, required: Current page number
    - `pageSize` integer, required: Items per page
    - `totalCount` integer, required: Total number of items
    - `totalPages` integer, required: Total number of pages

---

[API](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api.md) · [All operations](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tokenbooks/apis/tokenbooks-public-api/revisions/180622e6255e?raw)
