List Midnight offer groups for a user
Cursor-paginated list of a user's offer groups with nested offers. The status filter defaults to active for backward compatibility.
With status=active, offers have started, have not passed their offer expiry, have zero or future market maturity, and still have remaining group capacity. Asset-capped offers are considered fully consumed when consumed >= max_assets; unit-capped offers are fully consumed when consumed >= max_units. Fully consumed offers are excluded, and a group is omitted entirely when no active offers remain in it. Active group expiry is the maximum offer expiry across latest offers whose expiry is ahead and whose maturity is zero or ahead, including future-start offers.
With status=expired, every latest offer in the group must be past its offer expiry or past a non-zero market maturity. A future or currently active latest offer keeps the whole group out of expired results. Naturally consumed groups remain visible, even when a Take reaches type(uint128).max; only groups explicitly hard-cancelled through SetConsumed(type(uint128).max) are excluded. Nested offers are the latest expired or matured offers matching the non-market filters. Expired group expiry is the maximum offer expiry across the complete latest offer set.
Callbacks. A group has callback.type=blue_buy only when every latest offer considered for the lifecycle has the same callback address and data, contains canonical Blue market parameters with the matching loan token, and the earliest indexed registration from the official factory names the maker as owner at or before the offer's creation block. Registration transaction or log order within the same block is intentionally ignored. The callback is null when any condition fails. Verified callbacks include their address, decoded Blue market parameters, and derived Blue market id.
Filters. market_ids filters the group page to groups containing at least one offer in the requested lifecycle and any requested market, but does not narrow nested sibling offers. chain_ids, loan_assets, and groups filter both the group page and nested offers. callback_type=blue_buy keeps only groups with verified Blue callback metadata. listed=true requires every lifecycle-matching offer in a group to be on a listed market; listed=false requires at least one lifecycle-matching unlisted offer. loan_assets matches across all chains unless chain_ids also narrows the query. Group expiry is not narrowed by market_ids or loan_assets; active results use the active-eligible latest offer set, while expired results use the complete latest offer set. created_at_gte and created_at_lte filter by the first matching offer created in each group. market_ids, loan_assets, and groups are capped at 20 values. Each offer includes both market_id and the immutable market config used to derive it, because uncreated markets cannot be decoded from market_id alone.
Pagination. Response follows the list envelope: { cursor, data }. Pagination is over groups; nested offers are not split across pages. Sort groups with sort_by=id|created_at and sort_direction=asc|desc.
Path Parameters
User address whose offer groups should be listed.
Query Parameters
Offer-group lifecycle. Active groups contain at least one started offer with a future expiry, zero or future maturity, and remaining capacity. Expired groups have no latest offer with a future expiry and zero or future maturity, and exclude groups explicitly hard-cancelled through SetConsumed(maxUint128).
"active"Value in
- "active"
- "expired"
Filter by verified group callback type. blue_buy requires canonical Blue market params and an official factory registration owned by the maker at or before offer creation.
Value in
- "blue_buy"
Filter by chain ids. Supported chains: Ethereum (1) and Base (8453).
items <= 100Filter groups to those containing offers in the requested lifecycle and Midnight markets. Nested offers are not narrowed by this filter.
items <= 20Filter groups to those containing offers in the requested lifecycle and Midnight market families. Combined with market_ids using AND semantics. Nested offers are not narrowed by this filter.
items <= 20Filter nested offers in the requested lifecycle by loan token addresses. Combined with market_ids and groups using AND semantics.
items <= 20Filter by offer group ids. Combined with market_ids and loan_assets using AND semantics.
items <= 20Filter for group created_at greater than or equal to this unix timestamp.
Filter for group created_at less than or equal to this unix timestamp.
Filter by market listing status. When true, returns only groups where every offer in the requested lifecycle is on a listed market; when false, groups with at least one lifecycle-matching offer on an unlisted market. Omit to return both.
Value in
- "true"
- "false"
Sort field for group cursor pagination.
"id"Value in
- "id"
- "created_at"
Sort direction for group cursor pagination.
"asc"Value in
- "asc"
- "desc"
Maximum number of groups to return.
1 <= value <= 100100Opaque cursor from a previous page response.
1 <= length <= 4096Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/v0/midnight/users/0x958eB498a4172EA513c79b09E7f064070C5b1917/offer-groups"{ "cursor": "eyJzb3J0QnkiOiJpZCIsInNvcnREaXJlY3Rpb24iOiJhc2MiLCJjaGFpbklkIjo4NDUzLCJncm91cCI6IjB4MGJhYjUxZmFiNjQxNTdiYzEwMTFjZTY1YjliZjliMmIxMWYyMDJiOGE3YWI3NmI0MDhjZjQwYjhhZGYwNjlkMyJ9", "data": [ { "id": "0x0bab51fab64157bc1011ce65b9bf9b2b11f202b8a7ab76b408cf40b8adf069d3", "chain_id": 8453, "created_at": 1783584485, "expiry": 1784300399, "max_units": "0", "max_assets": "80000000000000", "consumed": "0", "callback": null, "offers": [ { "market_id": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738", "market": { "loan_token": "0x4200000000000000000000000000000000000006", "maturity": 1784300400, "rcf_threshold": "0", "enter_gate": "0x0000000000000000000000000000000000000000", "liquidator_gate": "0x0000000000000000000000000000000000000000", "collaterals": [ { "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "lltv": "860000000000000000", "liquidation_cursor": "300000000000000000", "oracle": "0xD09048c8B568Dbf5f189302beA26c9edABFC4858" } ] }, "created_at": 1783584485, "buy": true, "maker": "0x958eB498a4172EA513c79b09E7f064070C5b1917", "max_units": "0", "max_assets": "80000000000000", "continuous_fee_cap": "115792089237316195423570985008687907853269984665640564039457584007913129639935", "start": 1783584483, "expiry": 1784300399, "tick": 4408, "callback": "0x0000000000000000000000000000000000000000", "callback_data": "0x", "receiver_if_maker_is_seller": "0x0000000000000000000000000000000000000000", "ratifier": "0xd6e70365C8E8DDa9a4ca662C07bbE663b017755E", "reduce_only": false } ] } ]}{ "error": { "code": "VALIDATION_FAILED", "message": "Validation failed", "details": [ { "code": "invalid_type", "message": "Expected number, received string", "path": [ "chain_ids", 0 ] } ], "request_id": "f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b" }}{ "error": { "code": "INTERNAL_ERROR", "message": "Internal server error", "details": null, "request_id": "f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b" }}