Overview
The SDK provides methods to track user financial activity:getUserPnl- Get profit/loss summary with optional time-seriesgetUserHistory- Get unified transaction history (fills, settlements, deposits, withdrawals)
To avoid ambiguity, we denote the smallest possible multiple of USDC (0.000001 USDC) as one
uusdc,
which stands for µUSDC (micro-USDC), and denote the smallest possible multiple of a contract (0.01 contract)
as one ccontract (centicontract).User-facing USDC balances are specified as fixed-point strings (e.g. "1.2625" for USDC). Contract quantities
in the API and SDK are specified as integer ccontracts strings (e.g. "1050" for 10.50 contracts at precision 2).Getting PNL
getUserPnl
Get a comprehensive PNL summary for a user.
Parameters
string
required
User’s Ethereum address
object
Optional filtering parameters
Response
Examples
Basic PNL summary:Getting Transaction History
getUserHistory
Get a chronological list of all financial transactions.
Parameters
string
required
User’s Ethereum address
object
Optional filtering and pagination
Response
Returns an array of transaction records, each with atype discriminator:
Examples
Get all recent activity:Error Handling
Important Notes
- All monetary values are in µUSDC (1 USD = 1,000,000 µUSDC)
- When filtering by
marketId, deposits and withdrawals are excluded from PNL calculations - Transaction history is sorted newest-first by default
- Unrealized PNL is estimated based on position cost basis
- Time series data points represent cumulative PNL at each interval