Docs

Get Midnight position performance

GET
/v0/midnight/markets/{market-id}/users/{user-address}/position/performance

Performance-only lookup for a single position by (market-id, user-address).

Returns performance analytics inside a data envelope. The position detail endpoint omits these fields to keep state and performance concerns separate. When the position is closed or has never existed for a known market, this endpoint returns type: null and null analytics.

Path Parameters

market-id*string

Midnight market id.

user-address*string

User address for the requested position. Lowercase input is checksummed.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v0/midnight/markets/0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738/users/0xd4F43105098845fFE89B16E7A3DCdd0A31898118/position/performance"
{  "data": {    "chain_id": 8453,    "market_id": "0xcc9418ea594c6e658650aedd205ce4544b266b69493f56fd2adc65c14bd06738",    "user_address": "0xd4F43105098845fFE89B16E7A3DCdd0A31898118",    "type": "borrow",    "accounting_method": "average_cost",    "cost_basis": "1046483736229728000000000000000000",    "effective_rate_wad": "327402597840809",    "last_indexed_block": "48408699"  }}
{  "error": {    "code": "VALIDATION_FAILED",    "message": "Validation failed",    "details": [      {        "code": "invalid_string",        "message": "Invalid address",        "path": [          "user-address"        ]      }    ],    "request_id": "f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"  }}
{  "error": {    "code": "MARKET_NOT_FOUND",    "message": "Market 0x0000000000000000000000000000000000000000000000000000000000000000 not found",    "details": null,    "request_id": "f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"  }}
{  "error": {    "code": "INTERNAL_ERROR",    "message": "Internal server error",    "details": null,    "request_id": "f0e1d2c3-b4a5-4968-8728-1c0d1e2f3a4b"  }}