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

# Wallet YT positions and PnL

> Retrieve aggregated YT position balances, cost basis, and realized PnL.

export const ApiResponse = ({children, errors = {}}) => {
  const [status, setStatus] = useState("200");
  const statuses = ["200", ...Object.keys(errors)];
  return <section className="api-response" aria-label="Response">
      <div className="api-response-header not-prose">
        <h2>Response</h2>
        <div className="api-response-format">
          {statuses.length > 1 ? <select aria-label="Response status" value={status} onChange={event => setStatus(event.target.value)}>
              {statuses.map(code => <option key={code} value={code}>{code}</option>)}
            </select> : <span>200</span>}
          <span className="api-response-mime">application/json</span>
        </div>
      </div>
      <div hidden={status !== "200"}>{children}</div>
      {status !== "200" && <div aria-live="polite">
          {Object.entries(errors[status]).map(([name, value]) => <ResponseField key={name} name={name} type={value === null ? "null" : Array.isArray(value) ? "array" : typeof value}>
              {name === "error" ? "Error message describing why the request failed." : "Additional error details."}
            </ResponseField>)}
        </div>}
    </section>;
};

## Path parameters

<ParamField path="userAddress" type="string" required>
  User wallet address.
</ParamField>

## Query parameters

<ParamField query="vault" type="string">
  Filter to one vault.
</ParamField>

<RequestExample dropdown>
  ```bash cURL theme={null}
  curl https://api.exponent.finance/positions/yt/user/HmzCnQBzSFW4THri7t9f9tcVBHXT7fuw4iczfPKMwEL8
  ```

  ```python Python theme={null}
  import requests

  response = requests.get("https://api.exponent.finance/positions/yt/user/HmzCnQBzSFW4THri7t9f9tcVBHXT7fuw4iczfPKMwEL8", timeout=30)
  response.raise_for_status()
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.exponent.finance/positions/yt/user/HmzCnQBzSFW4THri7t9f9tcVBHXT7fuw4iczfPKMwEL8");
  if (!response.ok) {
    throw new Error(`Request failed: ${response.status}`);
  }
  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ApiResponse errors={{"500": {"error": "<message>"}}}>
  <ResponseField name="vaultAddress" type="string">
    Yield or strategy vault associated with this record.
  </ResponseField>

  <ResponseField name="totalSizeLamports" type="number">
    Indexed net traded YT size in raw token units.
  </ResponseField>

  <ResponseField name="balanceLamports" type="number">
    Current total tracked YT balance in raw token units.
  </ResponseField>

  <ResponseField name="avgCostBasis" type="number">
    Average acquisition cost recorded for the YT position.
  </ResponseField>

  <ResponseField name="avgImpliedApy" type="number">
    Average implied APY recorded for the YT position.
  </ResponseField>

  <ResponseField name="totalRealizedPnlLamports" type="number">
    Cumulative realized profit or loss in raw accounting units.
  </ResponseField>

  <ResponseField name="decimals" type="number">
    Token decimal places; divide raw quantities by `10 ** decimals` to obtain token units.
  </ResponseField>

  <ResponseField name="coreBalance" type="number">
    Tracked YT balance in core, in raw YT units.
  </ResponseField>

  <ResponseField name="orderbookOpen" type="number">
    YT allocated to open orders, in raw YT units.
  </ResponseField>

  <ResponseField name="orderbookFilled" type="number">
    Unclaimed YT from filled orders, in raw YT units.
  </ResponseField>

  <ResponseField name="staged" type="number">
    Accrued amount staged for collection in the tracker’s raw token units.
  </ResponseField>

  <ResponseField name="lastSeenIndex" type="number">
    Last cumulative accrual index recorded for this position.
  </ResponseField>

  <ResponseField name="emissionsTrackers" type="object[]">
    Per-emission accrual state with staged amounts and last-observed indexes.

    <Expandable title="child attributes">
      <ResponseField name="emissionsTrackers[].staged" type="string">
        Accrued amount staged for collection in the tracker’s raw token units.
      </ResponseField>

      <ResponseField name="emissionsTrackers[].lastSeenIndex" type="string">
        Last cumulative accrual index recorded for this position.
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="claimedInterestUsd" type="number">
    Cumulative USD value of interest claimed.
  </ResponseField>

  <ResponseField name="claimedEmissionsUsd" type="number">
    Cumulative USD value of reward emissions claimed.
  </ResponseField>
</ApiResponse>

<ResponseExample>
  ```json 200 theme={null}
  [
    {
      "vaultAddress": "2pQNreSiey5ZaQHdXeXCj9vRYwoETTa3PQAMAFLav6nz",
      "totalSizeLamports": -669375557447,
      "balanceLamports": 3088901639287,
      "avgCostBasis": 0,
      "avgImpliedApy": 0,
      "totalRealizedPnlLamports": -23985092394.84371,
      "decimals": 9,
      "coreBalance": 3088901639287,
      "orderbookOpen": 0,
      "orderbookFilled": 0,
      "staged": 0,
      "lastSeenIndex": 1.068864762024,
      "emissionsTrackers": [],
      "claimedInterestUsd": 3863.59540111275,
      "claimedEmissionsUsd": 0
    },
    {
      "vaultAddress": "78MLjMXyKyjwXtHXCuZHnBUH5wMh89KwBpvoFvcBzxN1",
      "totalSizeLamports": -289363797630,
      "balanceLamports": 0,
      "avgCostBasis": 0,
      "avgImpliedApy": 0,
      "totalRealizedPnlLamports": -10948495139.55203,
      "decimals": 9,
      "coreBalance": 0,
      "orderbookOpen": 0,
      "orderbookFilled": 0,
      "staged": 0,
      "lastSeenIndex": 1.084280188213,
      "emissionsTrackers": [],
      "claimedInterestUsd": 580.751253852402,
      "claimedEmissionsUsd": 0
    }
  ]
  ```

  ```json 500 theme={null}
  {
    "error": "<message>"
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.