Skip to content
Socket

Catalog / module / Socket plug-ins

Socket trading fee

v1

Take a small fee on every buy and sell in your socket pool and send it to your team, a splitter or a vault.

Runs on every swapTakes a fee
  • Takes a fee: Takes a share of the ETH side of each trade, never more than the grant you give it.

What it does

Socket trading fee (fee-router v1)

A socket hooklet. It takes a small fee on every buy and sell in one socket pool and sends the income to your team wallet or into a Socket fee splitter.

How it works

1. You set a buy fee and a sell fee, each at most 1%, and a recipient. They never change after deploy. 2. You add the hooklet to your socket pool with a grant. The fee actually taken on a trade is the lowest of your fee, the grant, and the pool cap fixed when the pool was created. 3. On every trade the socket books the fee as a claim for this hooklet. No ETH moves during the trade. 4. Anyone can call `collect` on the socket. The ETH arrives here, Socket's SwapFee is charged once on it, and the rest goes to your recipient.

Roles

- **Owner:** can pause (no fee taken, trading continues) and resume. Cannot change the fee or the recipient, and cannot take the income. - **Anyone:** can route income that has arrived (`onCredit`) and retry a refused payout (`flush`). - **The socket:** the only address that can send this hooklet ETH or tell it about swaps.

Risks in plain English

- Traders pay this on top of the pons fee. The swap page shows them the pons-direct price next to yours, so a high fee just sends them elsewhere. - If your wallet refuses ETH, the income waits here until a retry works. Nobody else can withdraw it. - If the hooklet misbehaves, the socket skips it after three failures in an hour and the guardian can switch it off. The pool keeps trading.

Fee lanes

| Lane | When | Default | |---|---|---| | SwapFee | on the fee income when it is collected | 0.50% of the income |

Nothing is charged on the trade itself by Socket. If the recipient is a Socket splitter, it does not charge again.

What if

- **I want a different fee?** Deploy a new fee router and propose it for your pool. Raising a fee waits the pool delay; lowering or removing applies at once. - **I lose my wallet?** The fee keeps flowing to the recipient you set. Only pausing needs the owner. - **Socket's guardian switches it off?** Trading continues with no fee from this hooklet. Only the Socket owner (48-hour timelock) can switch it back on.

Risks in plain English

  • This runs on every trade in your socket pool. Traders pay it on top of the pons fee, and the swap page always shows them the cheaper pons-direct price next to yours.
  • The fee actually taken is the lowest of: this setting, the grant you give this hooklet in the pool, and the pool cap fixed when the pool was created.
  • Fee levels are fixed at deploy. To change them, deploy a new one and swap it into the pool: raising a fee waits the pool delay (at least 48 hours), lowering or removing applies at once.

What if…

What if my wallet cannot receive ETH?
The income stays in this hooklet as owed, and anyone can call flush to retry. Nobody else can take it.
What if the hooklet breaks?
The socket skips it after three failures in an hour, and the Socket guardian can switch it off. The pool keeps trading either way.
What if I pause it?
The pool keeps trading and takes nothing for this hooklet. Income already booked can still be collected and routed.

Fees

Protocol fee per lane
LaneFee
Socket hooklet incomeon the fee income when it is collected (0.50% of the income, not of the trade)0.5%

Fees are fixed into each contract at deploy and can never change for it. Claims, withdrawals and refunds are never charged. Hard cap 1%, written into the code.

Evidence

Form check
Built from the source files
Implementation
—
Code hash
—

Settings you choose at deploy

  • Fee on buysCharged on the ETH a buyer spends. At most 1%.Locked forever
  • Fee on sellsCharged on the ETH a seller receives. At most 1%.Locked forever
  • Send the fees toYour team wallet, or a Socket fee splitter.Locked forever
  • The recipient is a Socket fee splitterDeposits into it instead of a plain transfer, so it is not charged again.Locked forever