MidnightTransactions

List market transactions

Cursor-paginated feed of Midnight economic transactions for one market.

Scope. Includes borrow, lend, exit_lend_primary, exit_lend_secondary, exit_borrow_primary, exit_borrow_secondary, partial_liquidation, full_liquidation, withdraw_collateral, and supply_collateral. Admin, authorization, fee, flashloan, accounting-only, and market creation activity is excluded from v0.

Trade actions. A single trade can affect both the lender and borrower side. Market-level queries can therefore return multiple API items for the same transaction, while account queries return only the items affecting that account. For trade items, data.assets is the loan-token amount attributed to the item; buyer_assets, seller_assets, take_units, and total_units_delta describe the full trade.

Filters. :market-id constrains the market and is globally unique across chains. chain_ids is optional and can further narrow the query.

Pagination. Response follows the list envelope: { cursor, data }. Pass back cursor verbatim on the next call. A null cursor means the last page. Ordering is fixed to created_at with deterministic tie-breakers.

Cache. public, max-age=2, stale-while-revalidate=1.

GET
/v0/midnight/markets/{market-id}/transactions

Path Parameters

market-id*string

Midnight market id.

Query Parameters

chain_ids?array<>

Filter by chain ids.

event_types?array<>

Filter by transaction event type.

loan_assets?array<string>

Filter by market loan token addresses. Combine with chain_ids.

collateral_assets?array<string>

Filter by collateral token addresses. Combine with chain_ids.

created_at_gte?|

Filter for transaction timestamps greater than or equal to this unix timestamp.

created_at_lte?|

Filter for transaction timestamps less than or equal to this unix timestamp.

tx_hash?string

Filter by tx hash.

sort_direction?string

Sort direction for cursor pagination. Ordering is by created_at with deterministic tie-breakers.

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

Maximum number of transactions to return.

Default100
Range1 <= value <= 1000
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/markets/string/transactions"
{
  "cursor": "eyJkIjoiZGVzYyIsInQiOiIxNzgwNjY2NjM5IiwiYyI6ODQ1MywiYiI6IjQ2OTM4NjQ2IiwieCI6MTM4LCJsIjoxODAsImEiOjEsImgiOiIweGFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWEiLCJlIjoic3VwcGx5X2NvbGxhdGVyYWwifQ",
  "data": [
    {
      "chain_id": 8453,
      "created_at": 1780666639,
      "data": {
        "account": "0x1111111111111111111111111111111111111111",
        "assets": "4444812",
        "caller": "0x1111111111111111111111111111111111111111",
        "collateral": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "on_behalf": "0x1111111111111111111111111111111111111111"
      },
      "event_type": "supply_collateral",
      "id": "0046938646-37e56-000180:1",
      "market_id": "0xd92de5e7fbbde5a5e161787426982f7e1b01fb53a7060f95c021236d74447614",
      "tx_hash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    }
  ]
}
{
  "error": {
    "code": "INVALID_CURSOR",
    "details": null,
    "message": "cursor sort direction does not match request sort direction",
    "request_id": "f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"
  }
}