Skip to content

Get all lots for an address

GET
/api/calculate/lots/{address}
curl --request GET \
--url 'https://api.qeychain.xyz/api/calculate/lots/example?persist_lineage=false'

Returns all tax lots for a wallet address with their current status.

Lot statuses:
- OPEN: Not consumed at all
- PARTIAL: Partially consumed
- CLOSED: Fully consumed

When `persist_lineage=true`, lineage links are persisted to the database.
address
required
Address
string
status
Any of:
string
symbol
Any of:
string
owned_wallets
Any of:
Array<string>

All wallet addresses owned by the user (for internal transfer detection). Comma-separated or repeated.

persist_lineage
Persist Lineage

Persist lineage links to database for audit trail

boolean

Persist lineage links to database for audit trail

Successful Response

Media typeapplication/json
Response Get Lots Api Calculate Lots Address Get
Array<object>
LotResponse

Tax lot with cost basis information.

Enhanced with detailed origin tracking for full money trail:

  • WHERE it came from (origin_address, origin_chain)
  • HOW it was acquired (origin_type, origin_symbol)
object
lot_id
required
Lot Id

Unique lot identifier (e.g., ‘ETH-ARB-001’)

string
symbol
required
Symbol

Token symbol

string
chain
required
Chain

Blockchain network

string
original_quantity
required
Original Quantity

Original quantity acquired

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
remaining_quantity
required
Remaining Quantity

Remaining quantity after disposals

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
cost_per_unit
required
Cost Per Unit

Cost per unit in USD

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
total_cost
required
Total Cost

Total cost basis in USD

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
remaining_cost
required
Remaining Cost

Remaining cost basis

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
acquisition_date
Any of:
string format: date-time
type
required
Type

Acquisition type (purchase, swap_in, etc.)

string
price_source
required
Price Source

Source of price data

string
decision_state
Any of:
string
status
required
Status

Lot status: OPEN, PARTIAL, or CLOSED

string
is_untracked
Is Untracked

Whether this lot has unknown cost basis

boolean
needs_manual_cost_basis
Needs Manual Cost Basis

Whether user should provide cost basis manually

boolean
manual_cost_basis_set
Manual Cost Basis Set

Whether user has provided manual cost basis

boolean
manual_cost_basis_note
Any of:
string
consumptions
Consumptions

List of consumption events

Array<object>
LotConsumptionResponse

Individual lot consumption event.

Enhanced with destination tracking for full money trail:

  • WHERE the lot went (destination_type, destination_address)
  • WHAT it became (destination_symbol, destination_lot_id)
object
lot_id
required
Lot Id
string
quantity_consumed
required
Quantity Consumed
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
cost_basis_used
required
Cost Basis Used
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
proceeds
Any of:
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
realized_gain_loss
Any of:
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
holding_period_days
Any of:
integer
is_long_term
Any of:
boolean
is_wash_sale
Is Wash Sale
boolean
wash_sale_disallowed_loss
Any of:
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
event_type
required
Event Type
string
decision_state
Any of:
string
consumed_at
required
Consumed At
string format: date-time
destination_type
Any of:
string
destination_symbol
Any of:
string
destination_address
Any of:
string
destination_chain
Any of:
string
destination_protocol
Any of:
string
destination_lot_id
Any of:
string
source_lots
Source Lots

Lots this lot came from (e.g., SCR lots that became this ETH lot)

Array<object>
LineageRefResponse

Reference to a lot in the lineage chain (money trail).

object
lineage_key
required
Lineage Key

Unique lineage key (chain:symbol:lot_id)

string
lot_id
required
Lot Id

Lot identifier

string
symbol
required
Symbol

Token symbol

string
chain
required
Chain

Blockchain network

string
quantity
required
Quantity

Quantity from/to this lot

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
cost_basis
required
Cost Basis

Cost basis contribution

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
destination_lots
Destination Lots

Lots this lot became (e.g., ETH lot that this SCR lot was swapped for)

Array<object>
LineageRefResponse

Reference to a lot in the lineage chain (money trail).

object
lineage_key
required
Lineage Key

Unique lineage key (chain:symbol:lot_id)

string
lot_id
required
Lot Id

Lot identifier

string
symbol
required
Symbol

Token symbol

string
chain
required
Chain

Blockchain network

string
quantity
required
Quantity

Quantity from/to this lot

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
cost_basis
required
Cost Basis

Cost basis contribution

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
origin_type
Any of:
string
origin_address
Any of:
string
origin_entity
Any of:
object
key
additional properties
any
origin_chain
Any of:
string
origin_protocol
Any of:
string
origin_symbol
Any of:
string
origin_tx_hash
Any of:
string
gas_fee_included
Gas Fee Included

Gas fee (USD) included in cost basis (IRS allows adding gas to acquisition cost)

string
default: 0 /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
Example
[
{
"is_untracked": false,
"needs_manual_cost_basis": false,
"manual_cost_basis_set": false,
"consumptions": [
{
"is_wash_sale": false
}
],
"gas_fee_included": "0"
}
]

Bad Request

Media typeapplication/json
ErrorResponse

Standard error response.

object
detail
required
Detail

Error message

string
error_code
Any of:
string
Examplegenerated
{
"detail": "example",
"error_code": "example"
}

Not Found

Media typeapplication/json
ErrorResponse

Standard error response.

object
detail
required
Detail

Error message

string
error_code
Any of:
string
Examplegenerated
{
"detail": "example",
"error_code": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}

Internal Server Error

Media typeapplication/json
ErrorResponse

Standard error response.

object
detail
required
Detail

Error message

string
error_code
Any of:
string
Examplegenerated
{
"detail": "example",
"error_code": "example"
}