Don't gate the flow. Shape it.
// token standard + launchpad on solana
A weir is a low wall across a river. It doesn't stop the water. It decides how much goes over.
Weirs tokens run hooks on every transfer, mint, burn and swap. A hook answers with an amount: take a cut, burn some, keep a note, set the fee. The token program applies the answer itself, so nobody needs your signature to enforce the rules. Weirs isn't Token-2022 or SPL. It's a separate program built around hooks from day one.
A gate can only open or shut.
A Token-2022 transfer hook runs after the balances have moved and gets one bit of output. A weir runs before, and its output is the transfer.
| can it… | token-2022 transfer hook | weirs hook |
|---|---|---|
| change the amount | ✗ no | ✓ yes |
| take cuts to named accounts | ✗ no | ✓ up to 3 |
| burn part of a swap | ✗ no | ✓ yes |
| set a swap’s fee | ✗ no | ✓ yes |
| per-holder memory | ✗ extra account each | ✓ 64 B in the holding |
| runs on mint and burn | ✗ no | ✓ yes |
| sees signer and delegate | ✗ read-only, after the fact | ✓ yes, before |
Five stops between sender and receiver.
The same path runs for wallet transfers, mints and burns. On the Weirs DEX, pool hooks get the same treatment on every swap and liquidity change.
> call before_hook
Before a single unit moves, the hook gets the full picture: both holdings and their balances, supply, who signed, and whether a delegate is acting. The token program signs the call, so the hook knows it is real.
sender [≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈] 1000 flowing [≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈] 1000
Pick a preset. Watch the money move.
Every launch on weirs.fun runs through a pool hook. Choose a preset and simulate a trade below. The maths is the same code the programs run, down to the rounding.
all-in cost 2.04% · ◆ lines are the hook's answer. A Token-2022 transfer hook can't produce any of them.
Presets are the easy part.
If a hook can answer it, you can ship it. A few ideas people keep asking for:
- + a jackpot pot filled by 0.5% of every trade
- + a sell cooldown per wallet, kept in hook data
- + a cut to a charity wallet on every sell
- + an allowlist phase that ends at a set time
- + loyalty tiers that unlock as balances grow
// a mint with your own hook, then lock it for good import { token } from '@weirs/sdk'; import { TOKEN_HOOK_FLAGS as F } from '@weirs/shared'; const create = token.createMint(me, mint, { name: 'River', symbol: 'RVR', decimals: 6, hookProgram: myHook, hookFlags: F.BEFORE_TRANSFER | F.TRANSFER_RETURNS_DELTA, hookAuthority: me, }); const lock = token.setAuthority(me, mint, 'hook', null);
The programs.
Five programs, one standard. The addresses appear here once this deployment is live.
$ weirs launch --rules yours