Skip to content

Set manual cost basis for a lot

PATCH
/api/wallets/{address}/lots/{lot_id}/cost-basis
curl --request PATCH \
--url 'https://api.qeychain.xyz/api/wallets/example/lots/example/cost-basis?cost_per_unit=example&persist_async=true'

Set the cost basis for a lot that was received from an external wallet.

Use this when you have records of the original purchase price from an exchange
(e.g., Coinbase, Kraken) but the on-chain data doesn't show it.

After setting the cost basis, all affected gain/loss calculations will be
automatically recalculated.
address
required
Address
string
lot_id
required
Lot Id
string
cost_per_unit
required
Cost Per Unit

Cost per unit in USD as string (e.g., ‘2500.00’ for ETH bought at $2,500)

string

Cost per unit in USD as string (e.g., ‘2500.00’ for ETH bought at $2,500)

acquisition_date
Any of:
string

Original acquisition date (ISO format: 2024-01-15T10:30:00Z)

note
Any of:
string

Optional note (e.g., ‘Bought on Coinbase’)

persist_async
Persist Async

Persist recalculated output asynchronously

boolean
default: true

Persist recalculated output asynchronously

Successful Response

Media typeapplication/json
Examplegenerated
example

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"
}