Hookify
CA coming soon $HKFY
Read the docs
whitepaper v1.0 · powered by patcha

Liquidity that
runs your rules.

Hookify is programmable liquidity infrastructure for Solana CLMMs. Compose hooks — dynamic fees, launch gates, anti-MEV, time-locks — into Orca Whirlpools and Raydium CLMM pools. No AMM fork required.

built on
{{ e }}
{{ n.v }}
{{ n.l }}
{{ v.n }}
{{ v.t }}

{{ v.d }}

standard library

Six hooks, one schema.

view all hooks →
workflow

Configure → simulate → deploy → monitor.

{{ s.n }}
{{ s.t }}

{{ s.d }}

standard library

Hooks reference.

Each hook registers against CPI lifecycle points and exposes a small parameter set. The same definition installs on both Orca Whirlpools and Raydium CLMM.

{{ h.id }} · {{ h.name }}
{{ h.cat }}

{{ h.desc }}

lifecycle points
{{ pt }}
parameters
{{ pm.k }}{{ pm.v }}
architecture

How a hook executes.

From the dashboard to the pool, every layer is verifiable. Hookify is the engine and library; Patcha is the underlying hook primitive; Orca and Raydium are the venues.

{{ a.step }}
{{ a.title }}
{{ a.desc }}
cpi lifecycle points
swap path
beforeSwap AMM swap afterSwap
liquidity path
beforeAddLiquidity · beforeRemoveLiquidity

Integrations

orca whirlpools

Hooks trigger on whirlpool swap and liquidity CPIs. Dynamic fees and gating apply per position without touching the core program.

raydium clmm

The same hook definitions install against Raydium CLMM pools — one module, two venues, identical parameter schema.

Anchor on-chain executor

program id · cluster mainnet
EPcW7e8RxBNPpQK2XKoKG9maWH6QvmU3ejxifoU5rNRa
view on solana explorer →
$HKFY token

Govern the protocol.

$HKFY aligns the people who build, run and rely on hooks.

Community & ecosystem35%
Liquidity & staking25%
Team & advisors20%
Treasury15%
Public sale5%
supply
1,000,000,000
network
Solana SPL
utility
{{ u }}

Roadmap

{{ ph.phase }}
{{ ph.status }}
{{ ph.title }}
{{ it }}
security

Secure by construction.

Hookify is infrastructure and tooling. Every hook is simulated, validated and enforced on-chain by a single open-source Anchor program — and users always retain custody and control of deployment decisions.

Security model

{{ s }}

Audits & bounty

{{ a.tag }}
{{ a.firm }}

{{ a.scope }}

{{ a.status }}
disclosure

Report vulnerabilities to security@hookify.xyz. Hookify provides infrastructure and tooling only; users remain responsible for deployment decisions and associated risks. Smart-contract interactions carry inherent risk — review the docs and audit reports before use.

documentation · v1.0

Build with Hookify.

Hookify is programmable liquidity infrastructure for Solana CLMMs, built on the Patcha hook framework. A hook is a small, composable module that the on-chain executor calls at specific points in a pool's lifecycle — letting you change fees, gate access, dampen MEV or time-lock liquidity without forking the AMM.

These docs cover the full path: install the CLI, scaffold a hook, simulate it against real Orca and Raydium liquidity, then deploy it to a live pool.

Quickstart

From zero to a deployed hook in five commands. Requires Node 18+ and a Solana wallet.

terminalbash
# 1 · install the CLI
npm i -g hookify-cli

# 2 · authenticate your wallet
hookify login

# 3 · scaffold from a template
hookify init my-hook --template dyn-fee

# 4 · backtest against live liquidity
hookify simulate my-hook/hook.toml --venue orca

# 5 · deploy to a pool
hookify deploy my-hook --pool HKFY/SOL
tip

Every command also runs from the dashboard — simulate and deploy share the same hook.toml schema in both places.

Core concepts

Four ideas underpin everything in Hookify.

Hook

A module that runs custom logic at a lifecycle point. Reads pool context, returns an override (a fee, an allow/deny, an order).

Lifecycle point

A CPI entry where the executor is invoked: beforeSwap, afterSwap, beforeAddLiquidity, beforeRemoveLiquidity.

Executor

A single Anchor program that enforces installed hooks via PDA-derived accounts. One program, every pool.

Venue

The CLMM a hook installs against — Orca Whirlpools or Raydium CLMM. The same definition targets both.

Hook lifecycle

A hook registers against one or more points. The executor calls your handler with the pool context; the return value can modify the action before it settles.

pointwhen it firescan modify
beforeSwapBefore the AMM computes the swapfee · revert
afterSwapAfter the swap, before settlementemit · revert
beforeAddLiquidityBefore a position is opened/increasedgate · revert
beforeRemoveLiquidityBefore a position is closed/decreasedgate · revert

Anatomy of a hook

A hook is a hook.toml manifest plus a handler. The manifest declares identity, target venue and parameters; the handler implements the lifecycle logic.

hook.tomltoml
[hook]
id     = "dyn-fee"
name   = "Dynamic Fee"
venue  = "orca"        # orca | raydium
pool   = "HKFY/SOL"

[params]
base_fee_bps = 30
max_fee_bps  = 100
vol_window_m = 15

[lifecycle]
points = ["beforeSwap", "afterSwap"]
lib.rsrust · anchor
#[hookify::hook]
pub mod dyn_fee {
    use super::*;

    pub fn before_swap(ctx: Context<BeforeSwap>, p: SwapCtx) -> Result<FeeOverride> {
        let vol = ctx.accounts.pool.realized_vol(p.window);
        let fee = clamp(base_fee + scale(vol), base_fee, max_fee);
        Ok(FeeOverride::bps(fee))
    }
}

Parameter schema

Each standard hook exposes a small, typed parameter set. Values are validated against these ranges before deployment.

hookparameterrange
{{ pr.hook }}{{ pr.param }}{{ pr.range }}

See the full hooks reference for descriptions and lifecycle points per module.

CLI reference

Install with npm i -g hookify-cli. All commands accept --json and --cluster.

commanddescription
{{ c.cmd }}{{ c.desc }}

Error codes

The executor returns typed Anchor errors. Handle these in your client.

codenamemeaning
{{ e.code }}{{ e.name }}{{ e.desc }}

Simulation & backtest

hookify simulate replays your hook against sampled historical liquidity from the target venue and reports fee APR, performance vs. an unhooked baseline, and volatility capture — before any on-chain transaction.

terminalbash
$ hookify simulate my-hook/hook.toml --venue orca --days 30

  fee apr        38.2%
  vs baseline    +11.4%
  vol capture    72%
  28 windows · sampled HKFY/SOL liquidity
note

Backtests are estimates from sampled data, not guarantees. Always review results and start with conservative parameters on mainnet.

Integrations

One hook definition installs against either CLMM. The executor wires into each venue's CPI entry points.

orca whirlpools

Triggers on whirlpool swap and liquidity CPIs. Applies per position without touching the core program.

raydium clmm

Same hook definitions install against Raydium CLMM pools — identical parameter schema.

On-chain executor

A single Anchor program enforces every installed hook. Each install derives a PDA from the pool and hook id, so config and authority are deterministic and verifiable.

pda derivationrust
// hook config PDA
seeds = [b"hook", pool.key().as_ref(), hook_id.as_ref()]

// program id · mainnet
EPcW7e8RxBNPpQK2XKoKG9maWH6QvmU3ejxifoU5rNRa

Required accounts: pool, hook_config (PDA), authority, and the venue's swap/liquidity accounts passed through by CPI.

Events & monitoring

Every hook invocation emits a structured Anchor event. Index them off-chain to monitor hook performance and pool health.

eventrust
emit!(HookFired {
    hook:  "dyn-fee",
    pool:  pool.key(),
    point: "beforeSwap",
    value: fee_bps,
    ts:    Clock::get()?.unix_timestamp,
});

Security

Hooks are simulated, validated and enforced on-chain by an open-source executor. See the dedicated Security & audits page for the full model, audit status and bug bounty.

  • Simulation & config validation before deployment
  • PDA-derived account constraints & per-pool authority
  • Transparent on-chain event logs
  • Report issues to security@hookify.xyz

FAQ

{{ f.q }}

{{ f.a }}

Glossary

{{ g.term }}{{ g.def }}