List market positions
Cursor-paginated list of current Midnight positions for a market.
:market-id is the stable Midnight market id and is globally unique across supported chains.
The response uses the same public position item shape as GET /v0/midnight/users/{user-address}/positions: { cursor, data }, with type, state fields, collateral balances, and performance analytics.
Filters. Range filters exist on credit, debt, cost_basis, and effective_rate_wad. active_only=true excludes matured markets. The path market id is always enforced.
Pagination. Pass back cursor verbatim on the next call.
Cache. public, max-age=2, stale-while-revalidate=1.
Path Parameters
Midnight market id.
Query Parameters
Filter by chain ids. Required when loan_assets is provided.
Filter by position type.
Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed.
Filter by exact maturity timestamps, in unix seconds.
When true, keep only positions whose market has not matured yet.
"true" | "false"Filter for maturities greater than or equal to this unix timestamp.
Filter for maturities less than or equal to this unix timestamp.
Filter for credit greater than or equal to this value.
^-?\d+$Filter for credit less than or equal to this value.
^-?\d+$Filter for pending fee greater than or equal to this value.
^-?\d+$Filter for pending fee less than or equal to this value.
^-?\d+$Filter for debt greater than or equal to this value.
^-?\d+$Filter for debt less than or equal to this value.
^-?\d+$Filter for cost basis greater than or equal to this value.
^-?\d+$Filter for cost basis less than or equal to this value.
^-?\d+$Filter for effective rate WAD greater than or equal to this value.
^-?\d+$Filter for effective rate WAD less than or equal to this value.
^-?\d+$Sort field for cursor pagination.
"maturity""credit" | "debt" | "maturity" | "cost_basis" | "effective_rate_wad"Sort direction for cursor pagination.
"desc""asc" | "desc"Maximum number of items to return.
1001 <= value <= 100Opaque cursor from a previous page response.
1 <= lengthResponse Body
application/json
application/json
curl -X GET "https://api.morpho.org/v0/midnight/markets/string/positions"{
"cursor": null,
"data": [
{
"chain_id": 8453,
"collaterals": [],
"cost_basis": "950000000000000000000000000000000",
"credit": "1000000000000000",
"debt": "0",
"effective_rate_wad": "52000000000000000",
"last_loss_factor": "0",
"loan_token": "0x4200000000000000000000000000000000000006",
"loss_factor": "0",
"market_id": "0xd92de5e7fbbde5a5e161787426982f7e1b01fb53a7060f95c021236d74447614",
"maturity": 1781276400,
"pending_fee": "0",
"type": "lend",
"user_address": "0x1111111111111111111111111111111111111111"
}
]
}{
"error": {
"code": "INVALID_CURSOR",
"details": null,
"message": "cursor sort/direction does not match request sort/direction",
"request_id": "f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"
}
}