Lighter Referral API

The referral API from Lighter — 6 operation(s) for referral.

GitHub OpenAPI

Operations 6

POST /api/v1/referral/create referral_create #
GET /api/v1/referral/get referral_get #
POST /api/v1/referral/kickback/update referral_kickback_update #
POST /api/v1/referral/update referral_update #
POST /api/v1/referral/use referral_use #
GET /api/v1/referral/stats referral_stats #

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-referral-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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-referral-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Lighter Referral API
  version: "1.0"
servers:
- url: https://mainnet.zklighter.elliot.ai/
tags:
- name: Referral
paths:
  /api/v1/referral/create:
    post:
      summary: referral_create
      operationId: referral_create
      tags:
      - Referral
      description: Create referral code
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ReqCreateReferralCode'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferralCode'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
  /api/v1/referral/get:
    get:
      summary: referral_get
      operationId: referral_get
      tags:
      - Referral
      description: Get referral code
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          type: string
      - name: account_index
        in: query
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferralCode'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
  /api/v1/referral/kickback/update:
    post:
      summary: referral_kickback_update
      operationId: referral_kickback_update
      tags:
      - Referral
      description: Update kickback percentage for referral rewards (allowed once per day)
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ReqUpdateKickback'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RespUpdateKickback'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
  /api/v1/referral/update:
    post:
      summary: referral_update
      operationId: referral_update
      tags:
      - Referral
      description: Update referral code (allowed once per account)
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ReqUpdateReferralCode'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RespUpdateReferralCode'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
  /api/v1/referral/use:
    post:
      summary: referral_use
      operationId: referral_use
      tags:
      - Referral
      description: Use a referral code. You can change this at a later time.
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ReqUseReferralCode'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
  /api/v1/referral/stats:
    get:
      summary: referral_stats
      operationId: referral_stats
      tags:
      - Referral
      description: Get trade stats summed across a referrer's referred users
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          type: string
      - name: auth
        in: query
        required: false
        schema:
          type: string
      - name: l1_address
        in: query
        required: true
        schema:
          type: string
      - name: is_eligible
        in: query
        required: false
        schema:
          type: boolean
          format: boolean
          default: 'false'
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferralStats'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultCode'
components:
  schemas:
    ResultCode:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: '200'
        message:
          type: string
      title: ResultCode
      required:
      - code
    ReqCreateReferralCode:
      type: object
      properties:
        account_index:
          type: integer
          format: int64
      title: ReqCreateReferralCode
      required:
      - account_index
    ReferralStats:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: '200'
        message:
          type: string
        stats:
          type: array
          items:
            $ref: '#/components/schemas/ReferralStat'
      title: ReferralStats
      required:
      - code
      - stats
    RespUpdateReferralCode:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: '200'
        message:
          type: string
        success:
          type: boolean
          format: boolean
          example: 'true'
      title: RespUpdateReferralCode
      required:
      - code
      - success
    ReqUpdateReferralCode:
      type: object
      properties:
        account_index:
          type: integer
          format: int64
        new_referral_code:
          type: string
      title: ReqUpdateReferralCode
      required:
      - account_index
      - new_referral_code
    ReqUpdateKickback:
      type: object
      properties:
        account_index:
          type: integer
          format: int64
        kickback_percentage:
          type: number
          format: double
          maximum: 100
      title: ReqUpdateKickback
      required:
      - account_index
      - kickback_percentage
    ReferralCode:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: '200'
        message:
          type: string
        referral_code:
          type: string
          example: 5V24K3MJ
      title: ReferralCode
      required:
      - code
      - referral_code
    ReqUseReferralCode:
      type: object
      properties:
        l1_address:
          type: string
        referral_code:
          type: string
        discord:
          type: string
        telegram:
          type: string
        x:
          type: string
        signature:
          type: string
        source:
          type: string
      title: ReqUseReferralCode
      required:
      - l1_address
      - referral_code
    ReferralStat:
      type: object
      properties:
        start_timestamp:
          type: integer
          format: int64
        end_timestamp:
          type: integer
          format: int64
        trade_stats:
          $ref: '#/components/schemas/TradeStats'
      title: ReferralStat
      required:
      - start_timestamp
      - end_timestamp
      - trade_stats
    RespUpdateKickback:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: '200'
        message:
          type: string
        success:
          type: boolean
          format: boolean
          example: 'true'
      title: RespUpdateKickback
      required:
      - code
      - success
    TradeStats:
      type: object
      properties:
        count:
          type: integer
          format: int64
        volume:
          type: string
        web_count:
          type: integer
          format: int64
        web_volume:
          type: string
        mobile_app_count:
          type: integer
          format: int64
        mobile_app_volume:
          type: string
        mobile_browser_count:
          type: integer
          format: int64
        mobile_browser_volume:
          type: string
        maker_fees_paid:
          type: string
        non_free_taker_volume:
          type: string
        non_free_maker_volume:
          type: string
        free_taker_volume:
          type: string
        taker_fees_paid:
          type: string
        free_maker_volume:
          type: string
      title: TradeStats
      required:
      - count
      - volume
      - web_count
      - web_volume
      - mobile_app_count
      - mobile_app_volume
      - mobile_browser_count
      - mobile_browser_volume
      - free_maker_volume
      - free_taker_volume
      - non_free_maker_volume
      - non_free_taker_volume
      - maker_fees_paid
      - taker_fees_paid
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)