Referrer Fees
How referrer fees work
Setting up a referrer
Option 1: Client-level referrer (all fills use it automatically)
import { ethers } from 'ethers';
import { ThetanutsClient } from '@thetanuts-finance/thetanuts-client';
const provider = new ethers.JsonRpcProvider('https://mainnet.base.org');
const signer = new ethers.Wallet(process.env.PRIVATE_KEY!, provider);
const client = new ThetanutsClient({
chainId: 8453,
provider,
signer,
referrer: '0x92b8ac05b63472d1D84b32bDFBBf3e1887331567',
});
// All fillOrder calls will use this referrer automatically
await client.optionBook.fillOrder(order, 10_000000n);Option 2: Per-fill referrer (overrides client default)
Option 3: Encode methods (viem, wagmi, Account Abstraction wallets)
Querying fees
Check your fee split
Setting splits (owner-only)
Check a single token
Check all tokens at once
Claiming fees
Claim all tokens in one call
Claim a single token
Full claim workflow example
End-to-end fee workflow summary
Step
Method
Signer
See Also
Last updated

