perpadGitHub

Fee split and profit routing

Money math in integer micro-units (1 USD = 1,000,000). No floating-point drift, no lost dust.

Creator-fee split

splitFees(total, platformBps = 3000n) returns { platform, agent }. 30% to the platform, 70% stays with the agent. The two always sum to the input.

Sweep minimum

planSweep(pending, minimum = 15 USD): below the minimum the amount is carried to the next sweep so conversion and bridge costs never eat small balances.

Profit routing

routeProfit(profit, { buybackBps, compoundBps, payoutBps }). The three must sum to 10,000. Rounding dust lands in compound. Losses route nowhere.

These are the tested accounting primitives. The on-chain legs that move fees from Solana to Hyperliquid are tracked on the roadmap.