Docs

List user transactions

GET
/v0/midnight/users/{user-address}/transactions

Cursor-paginated feed of Midnight economic transactions affecting one user.

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.

Affected account. This endpoint returns only items affecting :user-address: buyer/seller for trades, on_behalf for primary exits and collateral actions, and borrower for liquidations. 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. :user-address constrains the affected account across supported chains. chain_ids is optional and can further narrow the query. market_family_ids selects transactions on created sibling markets and combines with market_ids using AND semantics. listed=true keeps only transactions on listed markets; listed=false keeps only transactions on unlisted markets.

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.

Path Parameters

user-address*string

User address whose transactions should be listed.

Query Parameters

chain_ids?array<>

Filter by chain ids. Supported chains: Ethereum (1) and Base (8453).

Itemsitems <= 100
event_types?array<>

Filter by transaction event type.

Itemsitems <= 100
loan_assets?array<string>

Filter by market loan token addresses. Combine with chain_ids.

Itemsitems <= 100
collateral_assets?array<string>

Filter by collateral token addresses. Combine with chain_ids.

Itemsitems <= 100
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.

Range1 <= value <= 1000
Default100
cursor?string

Opaque cursor from a previous page response.

Length1 <= length <= 4096
market_ids?array<string>

Filter by Midnight market ids.

Itemsitems <= 100
market_family_ids?array<string>

Filter by Midnight market family ids. Combined with market_ids using AND semantics.

Itemsitems <= 100
listed?string

Filter by market listing status. When true, returns only transactions on listed markets; when false, only transactions on unlisted markets. Omit to return both.

Value in

  • "true"
  • "false"

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v0/midnight/users/0xd4F43105098845fFE89B16E7A3DCdd0A31898118/transactions"
{  "cursor": "eyJkIjoiZGVzYyIsInQiOiIxNzgzNTQ1MDE3IiwiYyI6ODQ1MywiYiI6IjQ4Mzc3ODM1IiwieCI6MzM4LCJsIjozNTIsImEiOjIsImgiOiIweDljMGI5Y2UxNTE5ZjMzMDhiZDViNmI1NmMxMTc4MDgwODhjNDhmOTNhMGY5N2JlMDQ3ZTVlZjkxYjZkYjY4YTAiLCJlIjoibGVuZCJ9",  "data": [    {      "id": "0048378373-743cf-000167:2",      "chain_id": 8453,      "market_id": "0x9ce1a0a9e5ca28a5333cec7a14d08afbab7fe1eb3a55024b3ae88f2d3bdcc229",      "event_type": "lend",      "tx_hash": "0x59a11252d53e57e6b00f74362ee0cc73007168916fff4988fd16cf8eeb4cf95d",      "data": {        "account": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",        "caller": "0x3f60566413487406F80572A4Eb91163aC097E415",        "maker": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",        "taker": "0x0388895353b98B81234347E17D1eE6c9268F3D50",        "buyer": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",        "seller": "0x0388895353b98B81234347E17D1eE6c9268F3D50",        "buyer_assets": "309631",        "seller_assets": "309631",        "assets": "309631",        "units": "309641",        "take_units": "309641",        "buyer_pending_fee_increase": "0",        "seller_pending_fee_decrease": "0",        "total_units_delta": "309641",        "payer": "0xc0b438Bbf5a8cC4e57C0D81e1818C069e413DdDf",        "receiver": "0x0388895353b98B81234347E17D1eE6c9268F3D50",        "group": "0x74656e6f720101869f52995f061617c55e88ad1ab1211d2e85ff9715bb72c22e",        "consumed": "23999631"      },      "created_at": 1783546093    },    {      "id": "0048377999-c6f6f-000097:2",      "chain_id": 8453,      "market_id": "0xa4030043fce4483aa527a225608e6eb27be7c16a062073b297941c5f72c032d2",      "event_type": "lend",      "tx_hash": "0xfa76a9faf38f0281cdd826f8f18325eed940cfa2b05ec811194635041848fbb4",      "data": {        "account": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",        "caller": "0x3f60566413487406F80572A4Eb91163aC097E415",        "maker": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",        "taker": "0x5F2F456266831DbbE57D3845187A93e1BD5EF1ba",        "buyer": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",        "seller": "0x5F2F456266831DbbE57D3845187A93e1BD5EF1ba",        "buyer_assets": "5002955",        "seller_assets": "5002955",        "assets": "5002955",        "units": "5007884",        "take_units": "5007884",        "buyer_pending_fee_increase": "0",        "seller_pending_fee_decrease": "0",        "total_units_delta": "5007884",        "payer": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",        "receiver": "0x3f60566413487406F80572A4Eb91163aC097E415",        "group": "0x74656e6f720100c34faf17861d5cc43cc10dc4920f7bb61267d86efa6898954c",        "consumed": "23305627"      },      "created_at": 1783545345    },    {      "id": "0048377835-7aee7-000352:2",      "chain_id": 8453,      "market_id": "0xa4030043fce4483aa527a225608e6eb27be7c16a062073b297941c5f72c032d2",      "event_type": "lend",      "tx_hash": "0x9c0b9ce1519f3308bd5b6b56c117808088c48f93a0f97be047e5ef91b6db68a0",      "data": {        "account": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",        "caller": "0x3f60566413487406F80572A4Eb91163aC097E415",        "maker": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",        "taker": "0x5F2F456266831DbbE57D3845187A93e1BD5EF1ba",        "buyer": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",        "seller": "0x5F2F456266831DbbE57D3845187A93e1BD5EF1ba",        "buyer_assets": "16009469",        "seller_assets": "16009469",        "assets": "16009469",        "units": "16025242",        "take_units": "16025242",        "buyer_pending_fee_increase": "0",        "seller_pending_fee_decrease": "0",        "total_units_delta": "16025242",        "payer": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",        "receiver": "0x3f60566413487406F80572A4Eb91163aC097E415",        "group": "0x74656e6f720100c34faf17861d5cc43cc10dc4920f7bb61267d86efa6898954c",        "consumed": "18302672"      },      "created_at": 1783545017    }  ]}

{  "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"  }}