---
title: "Time-weighted historical collateral deposits per holder"
method: POST
path: "/markets/collateral/holders/historical"
tags: ["stats"]
---

# Time-weighted historical collateral deposits per holder

`POST /markets/collateral/holders/historical`

Returns, for each holder, the integral of their collateral balance over the requested time window — expressed as deposit-seconds (decimal-adjusted collateral units multiplied by seconds held). Useful for time-weighted depositor rewards, retroactive incentive splits, etc.

Event sources folded in:
  * AddCollateral (+amount, decimal-adjusted)
  * RemoveCollateral (−amount)
  * Liquidate (−sum of collateralTransfers[] matching the target mint where toLiquidator = true; the row's top-level amount is principal repaid and is ignored for collateral accounting)

Events with eventTime < rangeStart are collapsed into a single bucket at rangeStart so they establish the starting balance for the window. Events at exactly rangeEnd contribute zero seconds.

The mint filter is applied against loan_events_v1.asset_identifier for Add/Remove events and against per-transfer assetMint inside Liquidate metadata. For single-mint collateral these are equal; for CLP/LP collateral, asset_identifier is the pool id — callers should pass the pool id, not an underlying token mint.

## Request body

- HistoricalCollateralHolderFilter
  - `mint` string, required
  - `pdas` boolean
  - `rangeEnd` integer, required
  - `rangeStart` integer, required

## Response `200`

Historical collateral holder summary

- HistoricalCollateralHolderStats[]
  - `collateralMint` string, required
  - `rangeEnd` integer, required
  - `rangeStart` integer, required
  - `userDepositSeconds` object, required

## Other responses

- `400`
- `500`

---

[API](https://skmtc.dev/loopscale/apis/loopscale-api.md) · [All operations](https://skmtc.dev/loopscale/apis/loopscale-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/loopscale/loopscale-api/revisions/531f64dbe09c/schema)
