Skip to content

Get Snaxpot Epoch Tickets

Retrieve issued Snaxpot lottery tickets and ticket-related statistics for the authenticated subaccount across an inclusive epoch range. The response includes one epoch item per epoch in the requested range, even when no tickets were issued for that epoch.

Endpoint

POST https://papi.synthetix.io/v1/trade

Request

Request Format

{
  "params": {
    "action": "getSnaxpotEpochTickets",
    "subAccountId": "1867542890123456789",
    "startEpochId": 42,
    "endEpochId": 44
  },
  "expiresAfter": 1704153600000,
  "signature": {
    "v": 28,
    "r": "0x19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef",
    "s": "0xabcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600"
  }
}

Omit endEpochId to query a single epoch (startEpochId only):

{
  "params": {
    "action": "getSnaxpotEpochTickets",
    "subAccountId": "1867542890123456789",
    "startEpochId": 42
  },
  "signature": {
    "v": 28,
    "r": "0x19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef",
    "s": "0xabcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600"
  }
}

Request Parameters

ParameterTypeRequiredDescription
paramsobjectYesRequest parameters wrapper
params.actionstringYesMust be "getSnaxpotEpochTickets"
params.subAccountIdstringYesSubAccount ID to query
params.startEpochIdintegerYesFirst epoch in the inclusive query range
params.endEpochIdintegerNoLast epoch in the inclusive query range; defaults to startEpochId when omitted
ParameterTypeRequiredDescription
nonceuint64Yes*Positive integer nonce (must be incrementing and unique per request)
signatureobjectYesEIP-712 signature object
expiresAfteruint64NoUnix milliseconds expiration timestamp (5x rate limit on stale cancels)

:::info Common Parameters These are top-level request parameters. The subAccountId parameter is specified within the params object (see each endpoint's parameter table). :::

:::info SubAccountAction Endpoints Endpoints using SubAccountAction signing (getPositions, getOpenOrders, getOrderHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates, getWithdrawableAmounts, getFeeRate, getSnaxpotEpochTickets) do not require the nonce parameter. Only signature and optional expiresAfter are needed. :::

Response

Success Response

{
  "status": "ok",
  "response": {
    "startEpochId": 42,
    "endEpochId": 44,
    "epochs": [
      {
        "epochId": 42,
        "earnedTicketCount": 3,
        "issuedTicketCount": 2,
        "cumulativeFeesUsd": "1250.50",
        "cumulativePurchasedUsd": "500.00",
        "stakingMultiplier": "1.25",
        "tickets": [
          {
            "ticketSerial": "1000042",
            "ball1": 4,
            "ball2": 12,
            "ball3": 27,
            "ball4": 33,
            "ball5": 41,
            "snaxBall": 7,
            "selectionSource": "auto",
            "createdAt": 1740307200000
          }
        ]
      },
      {
        "epochId": 43,
        "earnedTicketCount": 1,
        "issuedTicketCount": 1,
        "cumulativeFeesUsd": "980.00",
        "cumulativePurchasedUsd": "250.00",
        "stakingMultiplier": "1.00",
        "tickets": []
      },
      {
        "epochId": 44,
        "earnedTicketCount": 0,
        "issuedTicketCount": 0,
        "cumulativeFeesUsd": "0",
        "cumulativePurchasedUsd": "0",
        "stakingMultiplier": "1.00",
        "tickets": []
      }
    ]
  },
  "request_id": "5ccf215d37e3ae6d",
  "timestamp": "2026-05-26T12:00:00Z"
}

Response Fields

FieldTypeDescription
startEpochIdintegerFirst epoch in the resolved query range
endEpochIdintegerLast epoch in the resolved query range
epochsarrayOne item per epoch from startEpochId through endEpochId, inclusive
epochs[].epochIdintegerEpoch identifier
epochs[].earnedTicketCountintegerTickets earned for this epoch
epochs[].issuedTicketCountintegerTickets issued for this epoch
epochs[].cumulativeFeesUsdstringCumulative trading fees in USD for this epoch
epochs[].cumulativePurchasedUsdstringCumulative Snaxpot purchase credits in USD for this epoch
epochs[].stakingMultiplierstringStaking multiplier applied for this epoch
epochs[].ticketsarrayIssued tickets for this epoch
epochs[].tickets[].ticketSerialstringTicket serial number
epochs[].tickets[].ball1integerFirst main ball
epochs[].tickets[].ball2integerSecond main ball
epochs[].tickets[].ball3integerThird main ball
epochs[].tickets[].ball4integerFourth main ball
epochs[].tickets[].ball5integerFifth main ball
epochs[].tickets[].snaxBallintegerSnax ball number
epochs[].tickets[].selectionSourcestringHow the ticket numbers were selected
epochs[].tickets[].createdAtintegerTicket creation timestamp in Unix milliseconds

Error Response

{
  "status": "error",
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "startEpochId is required"
  },
  "request_id": "5ccf215d37e3ae6d"
}

When the result set exceeds 5,000 tickets:

{
  "status": "error",
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Requested epoch range returns too many tickets; narrow startEpochId/endEpochId."
  },
  "request_id": "5ccf215d37e3ae6f"
}

Implementation Notes

  • Uses SubAccountAction EIP-712 signing with action: "getSnaxpotEpochTickets"
  • Can be signed by the account owner or an authorized delegated signer; see Snaxpot for authentication requirements across Snaxpot actions
  • startEpochId is required and must be greater than zero
  • When provided, endEpochId must be greater than or equal to startEpochId and must not exceed the current epoch
  • The inclusive epoch range must not exceed 13 epochs
  • The total ticket count across the range must not exceed 5,000
  • Returns HTTP 404 when startEpochId does not correspond to an existing epoch
  • Useful for past draw sharing, analytics, and displaying historical lottery participation without per-epoch requests

Signing

All trading methods are signed using EIP-712. Each successful trading request will contain:

  • A piece of structured data that includes the sender address
  • A signature of the hash of that structured data, signed by the sender

For detailed information on EIP-712 signing, see EIP-712 Signing.

Nonce Management

The nonce system prevents replay attacks and ensures order uniqueness:

  • Use any positive integer as nonce
  • Each nonce must be greater than the previous one (incrementing)
  • Date.now() is a convenient option, not a requirement
  • If nonce conflicts occur, increment by 1 and retry

:::note SubAccountAction Exception SubAccountAction endpoints (getPositions, getOpenOrders, getOrderHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates, getWithdrawableAmounts, getFeeRate, getSnaxpotEpochTickets) do not require a nonce. Only the signature and optional expiresAfter parameters are needed. :::

Error CodeDescriptionRetryable
UNAUTHORIZEDEIP-712 signature validation failedNo
VALIDATION_ERRORRequest validation failedNo
MISSING_REQUIRED_FIELDRequired field is missingNo
INVALID_FORMATField format is invalidNo
INVALID_VALUEInvalid parameter valueNo
RATE_LIMIT_EXCEEDEDToo many requests in time windowYes
INSUFFICIENT_MARGINNot enough margin for tradeNo
ORDER_NOT_FOUNDOrder does not existNo
OPERATION_TIMEOUTOperation timed outYes