The Weirs standard
#overview
Weirs is a token standard for Solana built around one idea: a hook should be able to change what a transfer does, not only whether it happens. Weirs tokens live in their own token program, separate from SPL Token and Token-2022. That program calls a token's hook around every transfer, mint and burn, and applies whatever the hook answers.
Around the token program sit a DEX that gives pools the same kind of hooks, a launchpad that runs as one of those pool hooks, a rules kit with ready-made rules, and a bridge that wraps SOL into the standard so pools can quote in it.
#hooks
A hook is an ordinary Solana program that the token program (or the DEX) calls. When called it gets:
- both holdings involved, with owners and balances
- the mint's supply
- who signed, and whether they acted as a delegate
- the 64 bytes of hook data stored in each holding
Its answer can contain:
| cuts | up to three slices of the amount, each to an account the hook names |
| burn | on a swap, part of the amount removed from supply |
| fee | on a swap, the fee for that swap |
| data | new hook data to write into either holding |
| reject | fail the whole operation, as any hook can |
The hook never holds the user's signature and never moves tokens itself. It only answers, and the calling program applies the answer. Each call is signed by the calling program, so a hook can tell a genuine call from a forged one.
#the token program
A mint chooses its hook program and a set of flags when it is created. The flags decide which moments the hook is called at and what it may answer:
BEFORE_TRANSFER 1 AFTER_TRANSFER 2 BEFORE_MINT 4 AFTER_MINT 8 BEFORE_BURN 16 AFTER_BURN 32 TRANSFER_RETURNS_DELTA 64 (may take cuts) WRITES_HOOK_DATA 128 (may write the 64 B per holding)
The hook authority can be revoked after setup, which freezes the hook choice for good. Holders should check for that before trusting a token's rules.
#dex and pool hooks
Pools on the Weirs DEX can carry a pool hook. The DEX calls it around swaps and liquidity changes and signs those calls too. On a swap the hook sees the whole trade and can take cuts, burn part of it, or set the fee for that swap. An ordinary pool charges a flat 1% protocol fee on the quote side.
#launchpad
Every launch on weirs.fun has the same shape:
- 1,000,000,000 tokens with 6 decimals
- 75% sold on a constant-product bonding curve, the rest held back to seed the DEX pool at graduation
- opens at a $5,000 market cap
- a 0.01 SOL launch fee
- a 0.3% LP fee, taken by the protocol
- a sniper fee for the first 30 seconds, starting at 80% and falling in a straight line to 0.3%
- a creator fee of up to 2%
The launchpad is itself a pool hook. On a buy it takes the creator fee and holder rewards from the SOL coming in, and any burn from the tokens going out. On a sell it burns from the tokens coming in and takes the fees from the SOL going out. The protocol keeps 25% of what a launch's rules collect, and nothing from a launch whose rules collect nothing. Burns are never shared.
#rule limits
The launch program refuses any launch outside these limits:
| creator fee | up to 2% |
| holder rewards | up to 2% per side |
| burn | up to 1% per side |
| creator + holders + burn | up to 3% per side |
| max wallet | off, or 1% to 5% of supply, until graduation |
| creator wallet lock | up to 90 days |
| early-buyer window | up to 5 mins after launch |
| early-buyer unlock | after the window closes, within 7 days |
Holder rewards are paid in SOL, pro rata, to wallets holding the token. They switch on once those wallets hold at least 0.1% of supply between them; until then the holder fee isn't charged. Holder rewards, max wallet and the locks come from the rules kit. A launch running a hook of its own can still use the creator fee and burns, but not the kit.
#half-life
Half-Life is a hook that charges an exit fee based on how long the tokens were held. Sell or send straight away and 20% goes. The fee halves every six hours, sliding smoothly inside each six-hour step, and reaches zero at 48 hours. Buys never pay it. What it takes is burned.
The age lives in each holding's hook data and travels with the tokens, so moving them to a fresh wallet doesn't reset it. Adding new tokens to a wallet averages the age by weight.
#sdk
Two TypeScript packages: the client, and the shared fee maths the site itself uses.
npm install @weirs/sdk @weirs/shared
The client builds instructions for every program, derives every PDA, decodes accounts and events, and resolves a hook's extra accounts for a given transfer. The shared package has the curve and fee maths in integer arithmetic, rounding the same way the programs do.
import { token, fetchTokenHook } from '@weirs/sdk';
// resolve the hook's accounts for this transfer, then send it
const hook = await fetchTokenHook(connection, { mint, source, destination, authority });
const ix = token.transfer(authority, source, destination, mint, 1_000_000n, hook);To launch with a hook of your own: write it against the hook interface crate, make it immutable, prepare its account registry for the launch's mint, wrap it in a launch config (studio writes that code for you), and paste the config address on the launch page.
#programs
#license
The Weirs programs and SDK are a modified fork of the Bordrless programs and SDK, used under the Apache License 2.0. Weirs is not affiliated with Bordrless. This site's own code is released under the same license.