Partner Attribution
This guide explains how partners can integrate with Lighter programmatically to earn additional fees for trades executed through their applications, or just for tracking purposes. The program is permissionless, allowing any account index to be used to collect fees, including subaccounts.
Definitions
Partner: You, the integrator building on top of Lighter.
Client: Your user, or customer, whose transactions you send on their behalf. Standard, Plus and Premium/Advanced accounts are accepted; non-zero fees require Plus or Premium/Advanced.
Requirements
Trades containing partner attribution attributes with non-zero integrator fees will require the client submitting them to be on a Plus or Premium/Advanced account type. To check the account type of a client, you can use the accountLimits endpoint. To change account type, use changeAccountTier. Zero-fee attribution (tracking only) works on any account type, including Standard.
Integrator Approval
Before you can append partner attributes to client transactions, they must submit an ApproveIntegrator transaction. Approving an account index associated with a different L1 address requires an L1 signature. However, if the account index is associated with the same L1 address, or fees are zero, only an L2 signature is needed. This transaction authorizes you to charge additional taker/maker fees on trades originating from orders created through your platform, as defined via the systemConfig endpoint.
Binary options use the client's spot approval limits (max_spot_taker_fee, max_spot_maker_fee) and the system-wide spot caps. Their integrator fees are scaled by the trade price; see Binary options: Partner attribution.
At any point in time, there can only be a maximum of 4 approved Partners per Client.
Example
You can find the full Python example here. The TypeScript example uses the WASM signer from the TypeScript quickstart; see When an L1 signature is required. To revoke an integrator before the allowance expires, you can send another ApproveIntegrator request setting all fees to zero, requiring just an L2 signature.
Fields Explanation
IntegratorAccountIndex: Partner's account index. All partner fees collected from client trades will be credited to this account. For perpetual markets, the fees are paid and credited in USDC (perps). For spot markets, the fees are paid and credited in the received asset (e.g. buying spot ETH means the Client pays fees in ETH directly).
Max Fees: These values define the maximum fees you are allowed to charge your client.
Fees are calculated as:
fee = trade_quote_value × fee_value / 1e6 for perpetual trades (fee_value = 100 means 1 bp). Spot fees are charged in the received asset; see the definition above.
Example:
This means you can charge up to 5 bps of the trade quote for each perpetual taker order.
System-wide Maximums
Lighter enforces global maximum fee limits. If you submit an approval transaction exceeding these limits, the transaction will fail. On Robinhood Chain, perpetual-market fees are capped at 1% and spot-market fees at 2%. Current limits can be checked via the systemConfig endpoint.
ApprovalExpiry
The timestamp when the integrator approval expires in a form of Unix timestamp in milliseconds. After this time, the partner must obtain approval again from the client.
The maximum value you can send is equivalent to 2^48-1.
Creating Orders for Your Client
Once the integrator approval is successfully submitted, you can begin sending transactions for the client and collecting partner fees.
When creating orders, include the following fields:
These fees must not exceed the maximum values defined during the approval step. The same fields exist on modify and grouped orders.
Example: Creating an Order
You can find the full Python example here.
Design tips
Show your fee clearly in the order ticket.
Request an approval expiry that matches your product (e.g. 1 year) and re-prompt before it lapses.
Use a dedicated sub-account as your integrator account to keep revenue separate.
Track attributed volume and fees with partnerStats.
Last updated
Was this helpful?