MidnightOffer Groups

List active Midnight offer groups for a user

Cursor-paginated list of a user's active offer groups with nested active offers.

Active offers have started, have not passed their offer expiry or 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. Each group returns the max expiry across all unexpired and unmatured offers in the whole group, including future-start offers, one deterministic representative offer limit (max_units, max_assets), the latest group-level consumed value, and all active offers in that group matching the request filters. 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.

Filters. chain_ids, market_ids, loan_assets, and groups filter both the group page and nested offers. loan_assets matches loan token addresses across all chains unless chain_ids is also provided. The group-level expiry is computed for the whole offer group and is not narrowed by market_ids or loan_assets. created_at_gte and created_at_lte filter by the first active matching offer created in each group. market_ids, loan_assets, and groups are capped at 20 values.

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.

GET
/v0/midnight/users/{user-address}/offer-groups

Path Parameters

user-address*string

User address whose active offer groups should be listed.

Query Parameters

chain_ids?array<>

Filter by chain ids.

market_ids?array<string>

Filter nested active offers by Midnight market ids. Combined with groups using AND semantics.

loan_assets?array<string>

Filter nested active offers by loan token addresses. Combined with market_ids and groups using AND semantics.

groups?array<string>

Filter by offer group ids. Combined with market_ids and loan_assets using AND semantics.

created_at_gte?|

Filter for group created_at greater than or equal to this unix timestamp.

created_at_lte?|

Filter for group created_at less than or equal to this unix timestamp.

sort_by?string

Sort field for group cursor pagination.

Default"id"
Value in"id" | "created_at"
sort_direction?string

Sort direction for group cursor pagination.

Default"asc"
Value in"asc" | "desc"
limit?integer

Maximum number of groups to return.

Default100
Range1 <= value <= 100
cursor?string

Opaque cursor from a previous page response.

Length1 <= length

Response Body

application/json

application/json

curl -X GET "https://api.morpho.org/v0/midnight/users/string/offer-groups"
{
  "cursor": "eyJjaGFpbklkIjo4NDUzLCJncm91cCI6IjB4YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYSJ9",
  "data": [
    {
      "chain_id": 8453,
      "consumed": "42",
      "created_at": 1760000000,
      "expiry": 1761000000,
      "id": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "max_assets": "0",
      "max_units": "1000000",
      "offers": [
        {
          "buy": true,
          "callback": "0x0000000000000000000000000000000000000000",
          "callback_data": "0x",
          "continuous_fee_cap": "1000000000000000000",
          "created_at": 1760000000,
          "expiry": 1761000000,
          "maker": "0x1111111111111111111111111111111111111111",
          "market": {
            "collaterals": [
              {
                "liquidation_cursor": "1000000000000000000",
                "lltv": "860000000000000000",
                "oracle": "0xD09048c8B568Dbf5f189302beA26c9edABFC4858",
                "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
              }
            ],
            "enter_gate": "0x0000000000000000000000000000000000000000",
            "liquidator_gate": "0x0000000000000000000000000000000000000000",
            "loan_token": "0x4200000000000000000000000000000000000006",
            "maturity": 1781276400,
            "rcf_threshold": "0"
          },
          "market_id": "0xd92de5e7fbbde5a5e161787426982f7e1b01fb53a7060f95c021236d74447614",
          "max_assets": "0",
          "max_units": "1000000",
          "ratifier": "0x2222222222222222222222222222222222222222",
          "receiver_if_maker_is_seller": "0x0000000000000000000000000000000000000000",
          "reduce_only": false,
          "start": 1760000000,
          "tick": 520
        }
      ]
    }
  ]
}
{
  "error": {
    "code": "INVALID_CURSOR",
    "details": null,
    "message": "Invalid user group cursor",
    "request_id": "f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"
  }
}