Liquidations
Get Router Stats
Lifetime counters from a liquidation router
GET
/
lending-external-securities-v2
/
api
/
liquidations
/
router-stats
curl "https://api.trusset.org/lending-external-securities-v2/api/liquidations/router-stats?marketId=clx_secmarket_001" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/liquidations/router-stats?marketId=${marketId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const outstanding = Number(data.totalReceived) - Number(data.totalSettled);
{
"success": true,
"data": {
"routerAddress": "0x067a3feea46649adad8e31c33b3a4d8774b8d8cf",
"totalReceived": "5",
"totalSettled": "4",
"totalCollateralProcessed": "1140.0",
"totalCollateralProcessedRaw": "1140000000000000000000",
"totalProceedsRouted": "104820.5",
"totalProceedsRoutedRaw": "104820500000"
}
}
{
"success": false,
"error": {
"code": "STATS_UNAVAILABLE",
"message": "Could not fetch router stats"
}
}
{
"success": false,
"error": {
"code": "MARKET_REQUIRED",
"message": "Every v2 market carries its own liquidation router, so there is no shared router to read. Pass marketId to name the market whose router you mean."
}
}
Returns cumulative totals from a liquidation router. They cover how many liquidation records it has received and closed, how much collateral has passed through it, and what it has routed back to its market.
Every market carries its own liquidation router, so
The router counts as quiet only while
marketId names which router to read and there is no aggregate to fall back on. Omitting it returns MARKET_REQUIRED.
Query Parameters
string
required
Market whose router to read: its record ID, as
id on List Markets, not its contract address. See Market IDs. Maximum 100 characters. A longer value is treated as omitted.Response Fields
object
Show child attributes
Show child attributes
string
Router the figures came from.
string
Records received over the router’s lifetime: seizures, and the unsold remainders of expired auctions.
string
Records closed, by settlement or by the router administrator’s close. A reopen takes one back off. The difference against
totalReceived is the number of open records.string
Collateral received, formatted at the collateral decimals recorded for the market, or at 18 when none are recorded.
string
The same figure in base units.
string
Proceeds the router forwarded to the market, formatted at the borrow asset’s decimals. Atomic sales are included, also where the sale recipient paid the market directly inside the liquidation. Cash an auction venue paid the market directly is not included.
string
The same figure in base units.
A router serves one market, so these totals are market-level rather than protocol-level. To read across an instance, call this once per market from List Markets and add the figures yourself.
totalSettled equals totalReceived. Its administrator can rotate the sale recipient only from a quiet router, and this API does not expose that rotation.
Error Codes
| Code | HTTP | Cause |
|---|---|---|
MARKET_REQUIRED | 400 | marketId was omitted. Every market runs its own router, so there is no shared router to read |
STATS_UNAVAILABLE | 400 | The router could not be resolved or read, or it returned nothing readable |
MARKET_NOT_FOUND | 404 | marketId names no market on your instance |
curl "https://api.trusset.org/lending-external-securities-v2/api/liquidations/router-stats?marketId=clx_secmarket_001" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/liquidations/router-stats?marketId=${marketId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const outstanding = Number(data.totalReceived) - Number(data.totalSettled);
{
"success": true,
"data": {
"routerAddress": "0x067a3feea46649adad8e31c33b3a4d8774b8d8cf",
"totalReceived": "5",
"totalSettled": "4",
"totalCollateralProcessed": "1140.0",
"totalCollateralProcessedRaw": "1140000000000000000000",
"totalProceedsRouted": "104820.5",
"totalProceedsRoutedRaw": "104820500000"
}
}
{
"success": false,
"error": {
"code": "STATS_UNAVAILABLE",
"message": "Could not fetch router stats"
}
}
{
"success": false,
"error": {
"code": "MARKET_REQUIRED",
"message": "Every v2 market carries its own liquidation router, so there is no shared router to read. Pass marketId to name the market whose router you mean."
}
}
⌘I
curl "https://api.trusset.org/lending-external-securities-v2/api/liquidations/router-stats?marketId=clx_secmarket_001" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/liquidations/router-stats?marketId=${marketId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
const outstanding = Number(data.totalReceived) - Number(data.totalSettled);
{
"success": true,
"data": {
"routerAddress": "0x067a3feea46649adad8e31c33b3a4d8774b8d8cf",
"totalReceived": "5",
"totalSettled": "4",
"totalCollateralProcessed": "1140.0",
"totalCollateralProcessedRaw": "1140000000000000000000",
"totalProceedsRouted": "104820.5",
"totalProceedsRoutedRaw": "104820500000"
}
}
{
"success": false,
"error": {
"code": "STATS_UNAVAILABLE",
"message": "Could not fetch router stats"
}
}
{
"success": false,
"error": {
"code": "MARKET_REQUIRED",
"message": "Every v2 market carries its own liquidation router, so there is no shared router to read. Pass marketId to name the market whose router you mean."
}
}
