> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snek.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# PnL card

> Profit and loss for wallets on a token

Returns a PnL summary for a **non-empty** list of payment key hashes (wallets) and a single asset. The response may be **`null`** when the service has no PnL data to return.

**Auth:** Public

POST requests must send **`Content-Type: application/json`**. The first input in the Tapir definition is that content type; the route handler only uses the asset id and JSON body.

## Query parameters

<ParamField query="assetId" type="string" required>
  Cardano asset ID (`policyId.hexAssetName`).
</ParamField>

## Request body

JSON array of **56-character hex** payment key hashes (at least one element).

```json theme={null}
["e62df682e62df682e62df682e62df682e62df682e62df682e62df682e62df682e62"]
```

## Response

`200` with a JSON object or **`null`**.

<ResponseField name="asset" type="string">
  Serialized asset ID (`policyId.assetName`).
</ResponseField>

<ResponseField name="pnlPercent" type="string">
  PnL as a percent (e.g. `15.50` for 15.50%), scaled to 2 decimal places.
</ResponseField>

<ResponseField name="investedAda" type="string">
  Total ADA invested (decimal string, 6 fractional digits).
</ResponseField>

<ResponseField name="currentAdaGain" type="string">
  Current total ADA gain (realized + unrealized), decimal string (6 fractional digits).
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url "https://analytics.snek.fun/balances/v1/user/pnl-card?assetId=fbd4d3c334063ac19566f6ba39b6ec707ea91fa81d0c09201575c10b.44415645" \
    --header "Content-Type: application/json" \
    --data '["e62df682e62df682e62df682e62df682e62df682e62df682e62df682e62df682e62"]'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "asset": "fbd4d3c334063ac19566f6ba39b6ec707ea91fa81d0c09201575c10b.44415645",
    "pnlPercent": "12.34",
    "investedAda": "100.000000",
    "currentAdaGain": "15.500000"
  }
  ```
</ResponseExample>
