Catalog / module / Socket plug-ins
Holder discount fee
v1A small trading fee on your socket pool that your NFT holders pay less of, or none at all.
- Takes a fee: Takes a share of the ETH side of each trade, never more than the grant you give it.
What it does
Holder discount fee (holder-discount v1)
A socket hooklet. It takes a small fee on every buy and sell in one socket pool, like the fee router, but traders who hold your NFT pay less of it, or none at all.
How it works
1. You set a buy fee and a sell fee (each at most 1%), up to 4 discount tiers, and a recipient. None of it changes after deploy. 2. A tier says "with at least N NFTs, waive X% of the fee". Tiers must ask for more NFTs and waive more as they go up. The trader gets the best tier they reach. 3. On each trade the socket asks for the fee. The hooklet works out the trader's discount and answers `fee x (1 - discount)`. The pool's grant and cap still apply on top. 4. Anyone can call `collect` on the socket. The ETH arrives here, Socket's SwapFee is charged once, and the rest goes to your recipient (a wallet, or a Socket fee splitter via `deposit`).
Two ways to count
**Wallet mode (no vault).** The trader's NFT balance is read live on every trade. It is simple, but someone can borrow or flash-buy an NFT for a single trade and get the discount.
**Vault mode (recommended).** Only NFTs the trader has had staked in a Socket staking vault for at least `minStakeAge` count. Reading every stake on every trade does not fit the socket's gas budget for a fee decision, so vault mode uses a **holder pass**:
- `checkIn(wallet)` reads the vault and stores, for each tier, the moment the wallet has enough stakes old enough for it. Stakes that are still too young count automatically once they are old enough. - Anyone can check in any wallet. It only ever writes what the vault says now, so the same call also takes a pass away from someone who unstaked. - A pass lasts 7 days. After that the trader pays the full fee until they check in again. - A check-in reads at most 100 stakes per wallet, so a vault-mode tier can ask for at most 100 NFTs.
Who counts as the trader
Only trades through a router Socket trusts (the Universal Router) tell the socket who the trader is. Everyone else pays the full fee, and so does every quote. A holder's real trade through the swap page then costs a little less than quoted, never more.
Roles
- **Owner:** can pause (no fee taken, trading continues) and resume. Cannot change fees, tiers or the recipient, and cannot take the income. - **Anyone:** can check in a wallet, route income that has arrived (`onCredit`) and retry a refused payout (`flush`). - **The socket:** the only address that can send this hooklet ETH.
Risks in plain English
- Wallet mode can be gamed with a borrowed NFT for one trade. Vault mode with a stake age cannot. - In vault mode, someone who unstakes keeps their discount until their pass runs out (at most 7 days) or anyone checks them in again. A discount is worth at most the fee, which is at most 1% of a trade. - If the NFT contract fails or is slow in wallet mode, the trader simply pays the full fee. The trade always goes ahead. - The vault must be a Socket staking vault; the deploy refuses anything else.
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.
Gas
The fee decision runs inside the socket's 30k gas cap. Measured cold (as on a real trade): about 24k with wallet mode on a burn-mint-nft collection, about 19k with a vault pass.
What if
- **I stake more NFTs?** Check in again. Young stakes start counting by themselves once they are old enough. - **I sell my staked NFT?** You have to unstake it first. Your pass keeps working until it runs out or someone checks you in again; then the discount follows what you still have staked. - **I lose my wallet?** The fees keep flowing to the recipient you set. Only pausing needs the owner. - **The hooklet breaks?** The socket skips it after three failures in an hour and the guardian can switch it off. The pool keeps trading.
Risks in plain English
- Traders pay this on top of the pons fee; holders pay less. The swap page always shows the pons-direct price too.
- Only trades through a Socket-trusted router know who the trader is. Everyone else, and every quote, sees the full fee; a holder's real trade then costs less than quoted.
- Without a vault the discount follows the wallet balance on every trade, so someone can borrow or flash-buy an NFT for one trade. Use a vault and a stake age if that matters.
- With a vault, holders check in once and the pass lasts 7 days. Someone who unstakes keeps the pass until it runs out or anyone checks them in again. The most a discount can be worth is the fee itself, at most 1% of a trade.
- Fee levels and tiers are fixed at deploy. To change them, deploy a new one and swap it into the pool.
What if…
- What if I stake more NFTs?
- Check in again. Stakes that are too young are counted from the moment they are old enough, without another check-in.
- What if the NFT contract misbehaves?
- In wallet mode a failing or slow balance read counts as no discount: the trader pays the full fee and the trade goes ahead.
- 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.
Fees
| Lane | Fee |
|---|---|
| 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 buysBefore any discount. At most 1%.Locked forever
- Fee on sellsBefore any discount. At most 1%.Locked forever
- Your NFT collectionCounted by wallet balance when no vault is set. With a vault it is optional, and must be the vault's collection.Locked forever
- Staking vault (recommended)A Socket staking vault for the collection. Only NFTs staked long enough count, so nobody can borrow one for a trade.Locked forever
- Discount tiersUp to 4. Each tier needs more NFTs and waives more of the fee than the one before.Locked forever
- An NFT counts after being staked forVault only. 0 counts a stake at once.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