Fee Model
Sweepster's fees are configuration, not hardcoded constants. Every quote flows through the Fee Policy Engine, which resolves the effective fee from layered rules.
Fee layers (highest precedence first)
| Layer | Description |
|---|---|
| Minimum floor | A minimum fee in token units applies regardless of other rules |
| Subscription waiver | Subscribed users may receive a fee reduction |
| Promo campaign | Time-boxed discount applied to a user segment |
| Builder override | The builder can set a per-route or per-token override |
| Token-tier override | Higher-risk tokens (tier2, tier3) incur an additional fee |
| Base rate | Default protocol fee rate (basis points of amountIn) |
Fee components
A resolved fee breakdown contains:
- Protocol fee — Sweepster's share (in token units)
- Builder fee — the builder's markup (in token units);
0if no builder is attributed - Total —
protocolFee + builderFee(the value skimmed from the user)
The feeAmount field in the SweepOrder represents the protocol fee; builderFee is separate. Both are signed by the user as part of the order.
Token tiers
Tokens are classified by the Token Risk Engine:
| Tier | Risk level | Default fee modifier |
|---|---|---|
tier1 | Low risk, deep liquidity | Base rate |
tier2 | Medium risk | Higher base rate |
tier3 | High risk / exotic | Highest base rate |
The tier field in the quote request is the caller-supplied tier hint. The orchestrator re-screens the token and may adjust it.
Builder markup
Builders can configure a markup in basis points up to their maxBuilderBps cap. The markup is additive on top of the protocol fee. Builders keep 100% of their markup.
See Builder Program — Overview for the full model.
Minimum fee
A minimum fee floor prevents the service from being uneconomical on micro-transfers. The floor is expressed in the canonical asset (e.g. USDC cents) and is applied after all other rules.
How fees are skimmed
Fees are skimmed in the _skimFees function in SweepSettlementBase, atomically as part of settlement. The skimmed amount is deducted from the canonical asset before delivery — the user receives amountIn - totalFee worth of tokenOut at destination (subject to swap slippage).