Get Midnight offer groups by group id
Public APIReturns every offer group matching the onchain group id, regardless of lifecycle status. The maker is not required; optional chain_id and maker query parameters can disambiguate the lookup. Distinct chain, maker, and group-id combinations remain separate, and no match returns an empty data array.
The endpoint returns every latest offer revision in each matched group and exposes the current lifecycle as status. Each group exposes the shared offer intent as type, or null when its latest offers have inconsistent buy and reduce_only values. For active and scheduled groups, the group-level type, callback, expiry, max_units, max_assets and created_at leave out root-cancelled offers, while offers still lists every latest offer. It does not apply Router mempool admission policy: oracle, token, market-triplet, RCF threshold, and other mempool-validation policy checks do not gate retrieval. Offers on an LLTV or liquidation cursor that Midnight has not enabled are never indexed, so they are not returned.
Each nested offer includes the exact per-offer ratifier_data bytes originally submitted, plus parsed_ratifier_data, a structured view discriminated by ratifier_type. The type is identified by matching ratifier against the chain's known Midnight ratifier deployments: rate_v1 exposes rate_per_second_wad and allowed_taker, price_v1 exposes allowed_taker (the offer-level tick is the ratified price), and ecrecover and setter expose only their type. A zero allowed_taker means any taker may take the offer. Midnight vault adapter offers, whose maker, ratifier, and callback are the same address, whose receiver_if_maker_is_seller is also that address for a sell offer, whose ratifier_data decodes as abi.encode(sub_ratifier, sub_ratifier_data), and whose ratifier was created by the chain's current official Midnight adapter factory (possibly after the offer was posted), and whose loan_token is the asset of the adapter's parent vault, return adapter with parent_vault, sub_ratifier, and a nested parsed_sub_ratifier_data that reuses the rate_v1 and price_v1 shapes, identified by matching sub_ratifier against the chain's known adapter sub-ratifier deployments. Sub-ratifier errors stay nested: an unrecognized sub_ratifier returns unknown, and undecodable sub-ratifier data returns invalid with expected_ratifier_type. An adapter-shaped offer whose ratifier is not a verified adapter, or whose loan_token is not the parent vault's asset, returns unknown. Any other unrecognized ratifier address returns unknown; a recognized address whose ratifier_data cannot be decoded returns invalid with expected_ratifier_type.
Path Parameters
Offer group id.
Query Parameters
Filter by chain id.
0 < value <= 9007199254740991Value in
- 1
- 8453
- 5042
- 4663
- 4217
- 42161
Filter by offer maker address.
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/v0/midnight/offer-groups/0x0bab51fab64157bc1011ce65b9bf9b2b11f202b8a7ab76b408cf40b8adf069d3"{ "data": [ { "id": "0x0bab51fab64157bc1011ce65b9bf9b2b11f202b8a7ab76b408cf40b8adf069d3", "chain_id": 8453, "status": "active", "type": "buy", "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", "ratifier_data": "0x000000000000000000000000000000000000000000000000000000000000001b3f4a8c6d2e109b7f5c4d8a1e6b3f7092c5d4e8a7b1c6f3092d5e4a8b7c1f60392a7d5c9e4b1f8036d8c2a5e7f1049b3d6c8e2a5f7b1d4093c6e8a2f5b7d1049c8b2f6d4a1c9e7035f8b2d6a4c1e9073f5b8d2a6c4e1f9037b5d8a2c6e4f1093b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000", "parsed_ratifier_data": { "ratifier_type": "ecrecover" }, "reduce_only": false } ] } ]}{ "error": { "code": "VALIDATION_FAILED", "message": "Validation failed", "details": [ { "code": "invalid_string", "message": "Invalid offer group id", "path": [ "group-id" ] } ], "request_id": "f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b" }}{ "error": { "code": "INTERNAL_ERROR", "message": "Internal server error", "details": null, "request_id": "f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b" }}GETGet Midnight position performance
Performance-only lookup for a single position by (market-id, user-address). GET /v0/midnight/markets/{market-id}/users/{user-address}/position/performance.
GETList Midnight offer groups for a user
Cursor-paginated list of a user's offer groups with nested offers. The statuses filter accepts one or more lifecycle states with OR semantics.