Lighter Portfolio API

The portfolio API from Lighter — 1 operation(s) for portfolio.

Operations 1

GET /api/v1/portfolio/boPnl portfolio_boPnl #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/lighter:lighter-portfolio-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

lighter-portfolio-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lighter Portfolio API
  version: "1.0"
servers:
- url: https://mainnet.zklighter.elliot.ai/
tags:
- name: Portfolio
paths:
  /api/v1/portfolio/boPnl:
    get:
      summary: portfolio_boPnl
      operationId: portfolio_boPnl
      tags:
      - Portfolio
      description: Get binary-options realized PnL for an authenticated account, grouped by event and ordered newest event first. cursor is an exclusive event id; event_id returns a single event. Every outcome the account has traded is reported, including markets still open or unsettled, so an entry never disappears as the account trades. Per outcome, total_pnl is all realized PnL so far including settlement, and settlement_pnl is null until the market settles with a position to settle, then the string 0.000000 for an actual zero-PnL settlement. An event's total_pnl is the sum of its listed outcomes. Missing display metadata uses zero/empty values.
      parameters:
      - name: authorization
        in: header
        description: ' make required after integ is done'
        required: false
        schema:
          type: string
      - name: auth
        in: query
        description: Account auth token, supplied as an alternative to the `authorization` header.
        required: false
        schema:
          type: string
      - name: account_index
        in: query
        required: true
        schema:
          type: integer
          format: int64
      - name: event_id
        in: query
        required: false
        schema:
          type: integer
          format: int64
      - name: cursor
        in: query
        required: false
        schema:
          type: integer
          format: int64
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          format: int64
          default: '100'
          minimum: 1
          maximum: 100
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RespGetBoPnL'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
components:
  schemas:
    BoOutcomePnL:
      type: object
      properties:
        market_id:
          type: integer
          format: int64
        symbol:
          type: string
        outcome:
          type: integer
          format: int32
          enum:
          - 0
          - 1
          - 2
          x-enum-varnames:
          - None
          - 'No'
          - 'Yes'
        end_timestamp:
          type: integer
          format: int64
        settlement_pnl:
          type:
          - string
          - 'null'
        last_trade_id:
          type: integer
          format: int64
        total_pnl:
          type: string
      title: BoOutcomePnL
      required:
      - market_id
      - symbol
      - outcome
      - end_timestamp
      - settlement_pnl
      - last_trade_id
      - total_pnl
    BoEventPnL:
      type: object
      properties:
        event_id:
          type: integer
          format: int64
        event_title:
          type: string
        event_description:
          type: string
        total_pnl:
          type: string
        outcomes:
          type: array
          items:
            $ref: '#/components/schemas/BoOutcomePnL'
      title: BoEventPnL
      required:
      - event_id
      - event_title
      - event_description
      - total_pnl
      - outcomes
    RespGetBoPnL:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: '200'
        message:
          type: string
        events:
          type: array
          items:
            $ref: '#/components/schemas/BoEventPnL'
        next_cursor:
          type: integer
          format: int64
          example: '1'
      title: RespGetBoPnL
      required:
      - code
      - events
    ResultCode:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: '200'
        message:
          type: string
      title: ResultCode
      required:
      - code
x-provenance:
  method: harvested
  publisher: Lighter
  source: https://apidocs.lighter.xyz/openapi/page.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)