Fee Token Resolution
When a transaction is submitted, the protocol determines which stablecoin to charge using a deterministic resolution chain:| Priority | Source | Example |
|---|---|---|
| 1 | Explicit feeToken field on the transaction | AA tx sets feeToken: 0x20C0...USDC |
| 2 | Inline setUserToken call to Fee Manager | User updates preference in the same tx |
| 3 | Stored user preference (on-chain) | Previously set via Fee Manager |
| 4 | Inferred from OGDP-20 call target | transfer() on a token contract |
| 5 | Inferred from orderbook swap input token | swapExactAmountIn(tokenIn: USDC, ...) |
| 6 | Default: pathUSD | Fallback to the protocol’s base stablecoin |
Two-Phase Settlement
Fee collection uses a pre-charge / refund model to protect both users and validators:- Pre-charge: The maximum possible fee (
gas_limit * gas_price, converted to token terms via1e12scaling) is deducted from the fee payer’s OGDP-20 balance. - Execution: The transaction runs normally.
- Settlement: The actual gas consumed is calculated. The difference between the pre-charge and the actual cost is refunded to the fee payer.
Constraints
- Only OGDP-20 tokens with a set currency metadata (USD, EUR, etc.) are valid for fee payment.
- The token must not be paused.
- The fee payer must be transfer-authorized under the token’s policy.