createDelegatedAndSelf() separates the trader from the executor.
- the trader EOA owns USDC and positions
- a delegate EOA signs each action
- the delegate EOA submits the transaction and pays gas
When to use it
- backend systems trading on behalf of users
- managed execution products
- integrations where users keep custody but your server handles submission
One-time trader setup
Before this mode can trade, the trader must:Submit-capable client
Build-only client
get*Tx() returns an EOA request whose calldata is already wrapped for delegated execution.
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
delegatePrivateKey | 0x${string} | Submit-capable | Delegate EOA key. Signs and pays gas. |
traderAddress | 0x${string} | Yes | Trader the delegate acts for. Must have called setDelegate(delegateAddress). |
delegateAddress | 0x${string} | Build-only | Delegate EOA that will submit the transaction. |
rpcUrl | string | Submit-capable; optional for build-only | Arbitrum RPC URL. Build-only defaults to the public RPC. |
testnet, slippageBps, builder, subgraphUrl, builderApiUrl, alchemyApiKey). See Client Configuration.