Skip to content

Track a wallet address

POST
/api/wallets/track
curl --request POST \
--url https://api.qeychain.xyz/api/wallets/track \
--header 'Content-Type: application/json' \
--data '{ "address": "example", "chains": [ "example" ], "label": "example", "owned_wallets": [ "example" ] }'

Fetches all transactions for a wallet address from Zerion, runs cost basis calculations using FIFO method, and returns a summary with positions and tax information.

This is the main entry point for analyzing a wallet's tax situation.
Media typeapplication/json
TrackWalletRequest

Request to track a new wallet address.

object
address
required
Address

Wallet address (0x…)

string
chains
Any of:
Array<string>
label
Any of:
string
owned_wallets
Any of:
Array<string>
Examplegenerated
{
"address": "example",
"chains": [
"example"
],
"label": "example",
"owned_wallets": [
"example"
]
}

Successful Response

Media typeapplication/json
TrackWalletResponse

Response after tracking a wallet.

object
address
required
Address

Tracked wallet address

string
transactions_fetched
required
Transactions Fetched

Number of transactions fetched

integer
transactions_complete
required
Transactions Complete

Whether all transactions were fetched

boolean
positions
Positions

Current positions with cost basis

Array<object>
PositionResponse

Current position with cost basis data.

object
symbol
required
Symbol

Token symbol

string
name
Any of:
string
chain
required
Chain

Blockchain network

string
quantity
required
Quantity

Current quantity held

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
current_price
Any of:
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
current_value
Any of:
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
total_cost_basis
required
Total Cost Basis

Total cost basis

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

Average cost per unit

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
unrealized_gain_loss
Any of:
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
unrealized_gain_loss_percent
Any of:
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
open_lots_count
Open Lots Count

Number of open lots

integer
0
partial_lots_count
Partial Lots Count

Number of partially consumed lots

integer
0
is_zerion_only
Is Zerion Only

True if this position was detected on-chain (Zerion) but has no matching FIFO engine entry. Cost basis is unknown.

boolean
position_type
Any of:
string
protocol
Any of:
string
tax_summary
required
TaxSummaryResponse

Tax calculation summary

object
address
required
Address

Wallet address

string
total_realized_gl
required
Total Realized Gl

Total realized gain/loss

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
short_term_gains
required
Short Term Gains

Total short-term capital gains

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
short_term_losses
required
Short Term Losses

Total short-term capital losses

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
net_short_term
required
Net Short Term

Net short-term gain/loss

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
long_term_gains
required
Long Term Gains

Total long-term capital gains

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
long_term_losses
required
Long Term Losses

Total long-term capital losses

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
net_long_term
required
Net Long Term

Net long-term gain/loss

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
wash_sale_disallowed
Wash Sale Disallowed

Total losses disallowed due to wash sales

string
default: 0 /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
wash_sale_count
Wash Sale Count

Number of wash sale events

integer
0
disposal_count
required
Disposal Count

Total number of taxable disposals

integer
total_proceeds
required
Total Proceeds

Total proceeds from disposals

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

Total cost basis used in disposals

string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
income
Any of:
IncomeBreakdownResponse

Breakdown of income by type (airdrops, staking rewards, etc.).

object
airdrop
Airdrop

Total airdrop income at FMV

string
default: 0 /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
staking_reward
Staking Reward

Total staking reward income at FMV

string
default: 0 /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
mining_reward
Mining Reward

Total mining reward income at FMV

string
default: 0 /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
interest
Interest

Total interest income at FMV

string
default: 0 /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
other
Other

Other income at FMV

string
default: 0 /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
total
Total

Total income received (sum of all types)

string
default: 0 /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
processing_time_ms
Any of:
integer
Example
{
"positions": [
{
"open_lots_count": 0,
"partial_lots_count": 0,
"is_zerion_only": false
}
],
"tax_summary": {
"wash_sale_disallowed": "0",
"wash_sale_count": 0,
"income": {
"airdrop": "0",
"staking_reward": "0",
"mining_reward": "0",
"interest": "0",
"other": "0",
"total": "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"
}