List markets
Cursor-paginated list of Midnight markets.
Use this to discover markets. For a given user's positions on those markets, follow up with GET /v0/midnight/users/{user-address}/positions.
Filters. Address filters (loan_assets, collateral_assets, oracle_addresses, enter_gates, liquidator_gates) must be combined with chain_ids — an address alone is not chain-unique. Lowercase addresses are checksummed server-side. Pass active_only=true to exclude markets past maturity.
Pagination. Response follows the list envelope: { cursor, data }. Pass back cursor verbatim on the next call. A null cursor means the last page.
Cache. public, max-age=5, stale-while-revalidate=2.
Query Parameters
Filter by chain ids. Supported chains: Ethereum (1) and Base (8453). Required when any address filter is provided.
items <= 100Filter by Midnight market ids. These ids are globally unique.
items <= 100Filter by Midnight market family ids. A family contains markets whose immutable parameters differ only by maturity.
items <= 100Filter by loan token addresses. Combine with chain_ids; lowercase input is checksummed.
items <= 100Filter by collateral token addresses. Combine with chain_ids; lowercase input is checksummed.
items <= 100Filter by collateral oracle addresses. Combine with chain_ids; lowercase input is checksummed.
items <= 100Filter by enter gate addresses. Combine with chain_ids; lowercase input is checksummed.
items <= 100Filter by liquidator gate addresses. Combine with chain_ids; lowercase input is checksummed.
items <= 100Filter by exact maturity timestamps, in unix seconds.
items <= 100When true, enforces maturity strictly after the current timestamp.
Value in
- "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 total units greater than or equal to this value.
^\d{1,78}$Filter for total units less than or equal to this value.
^\d{1,78}$Filter by listing status. When true, returns only markets surfaced by the app trust layer; when false, only unlisted markets. Omit to return both.
Value in
- "true"
- "false"
Sort field for cursor pagination.
"total_units"Value in
- "total_units"
- "maturity"
Sort direction for cursor pagination.
"desc"Value in
- "asc"
- "desc"
Maximum number of items to return.
1 <= value <= 1000100Opaque cursor from a previous page response.
1 <= length <= 4096Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/v0/midnight/markets"{ "cursor": "eyJzIjoidG90YWxfdW5pdHMiLCJkIjoiZGVzYyIsInYiOiIxNDgxNDM5OTkyMDIwMDEzIiwidk51bGwiOmZhbHNlLCJpIjpbODQ1MywiMHhjYzk0MThlYTU5NGM2ZTY1ODY1MGFlZGQyMDVjZTQ1NDRiMjY2YjY5NDkzZjU2ZmQyYWRjNjVjMTRiZDA2NzM4Il0sImYiOiJSQk52bzFXelo0b1JScTBXOS1oa25wIn0", "data": [ { "chain_id": 8453, "market_id": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738", "market_family_id": "0x9a6ece688006fb810141501154acfd1aa29ae7ac3753452f4931a092f2653f1f", "loan_token": "0x4200000000000000000000000000000000000006", "maturity": 1784300400, "rcf_threshold": "0", "enter_gate": "0x0000000000000000000000000000000000000000", "liquidator_gate": "0x0000000000000000000000000000000000000000", "collaterals": [ { "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "lltv": "860000000000000000", "liquidation_cursor": "300000000000000000", "oracle": "0xD09048c8B568Dbf5f189302beA26c9edABFC4858" } ], "total_units": "1481439992020013", "tick_granularity": 4, "settlement_fee_schedule": [ { "time_to_maturity_days": 0, "fee_cbp": "0" }, { "time_to_maturity_days": 1, "fee_cbp": "0" }, { "time_to_maturity_days": 7, "fee_cbp": "0" }, { "time_to_maturity_days": 30, "fee_cbp": "0" }, { "time_to_maturity_days": 90, "fee_cbp": "0" }, { "time_to_maturity_days": 180, "fee_cbp": "0" }, { "time_to_maturity_days": 360, "fee_cbp": "0" } ], "current_settlement_fee_wad": "0", "current_settlement_fee_cbp": "0", "continuous_fee_rate": "0", "listed": 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" }}