Payouts
Builder fees can be paid out through two mechanisms.
On-chain atomic split
When attribution uses the signed on-chain builder/builderFee fields, the fee is skimmed directly to payoutAddress in the same settlement transaction. No claim step is needed.
Settlement tx:
pull tokenIn
swap → canonical asset
skim protocolFee → Sweepster treasury
skim builderFee → builder's payoutAddress ← atomic, same tx
deliver remainder to user's destinationThis is the most trustless mode: the payment is embedded in the user's signed order and executed by the contract without any off-chain intermediary.
Off-chain accrual ledger
When using API-key attribution, the builder-backend maintains an accrual ledger. Every time a sweep attributed to your builder account settles, the orchestrator's watcher calls:
POST https://builders.sweepster.xyz/accruals (admin-authenticated)
{
"builderId": "bld_abc123",
"sweepId": "0xTxHash_logIndex",
"token": "0xUSDC",
"amount": "3000000"
}The sweepId is used as an idempotency key — the same sweep can be recorded multiple times safely.
Querying your accrual balance
const res = await fetch(
"https://builders.sweepster.xyz/builders/bld_abc123/accruals",
{
headers: { Authorization: "Bearer ADMIN_TOKEN" },
}
);
const { builderId, balances } = await res.json();
// balances: [{ token: "0xUSDC", amount: "3000000" }, ...]Note: The
/builders/:id/accrualsendpoint is admin-gated. In a production integration, your backend queries it on your behalf.
Payout execution
The actual movement of accrued funds to your payoutAddress is handled by the Sweepster backend on a scheduled basis. Payout execution is a planned feature; contact the team for the current payout schedule.
Choosing a payout mode
| Consider | On-chain split | Accrual ledger |
|---|---|---|
| Trustlessness | Highest — signed into the order | Depends on Sweepster backend |
| Flexibility | Payment goes to payoutAddress as specified at registration | Can batch, aggregate across sweeps |
| Analytics | No built-in ledger | Full sweep-by-sweep ledger |
| Cross-chain sweeps | Works for same-chain delivery | Works for all delivery modes |
Most builders use accrual ledger for API integrations and on-chain split for white-label / smart-contract integrations.