Unicorn

The Magic Behind
Every Swap

Unicorn Protocol is the most customizable, lowest-cost AMM ever conjured. Built on Horn Hook architecture — Uniswap v4's infinite extensibility, reimagined with mythical power.

Hooks that
pierce reality.

Every pool is a programmable primitive. Attach a Horn Hook contract to intercept and transform any lifecycle event — the protocol calls your code, not the other way around.

  • beforeSwap / afterSwap

    Execute logic immediately before and after each swap. Build custom routing logic, MEV protection, or real-time fee adjustments.

  • beforeAddLiquidity / afterAddLiquidity

    Gate or transform liquidity additions. Implement KYC pools, bonding curves, or auto-compound strategies on deposit.

  • beforeRemoveLiquidity / afterRemoveLiquidity

    Trigger reward harvesting, unstaking, or fee collection atomically with LP withdrawals.

  • beforeDonate / afterDonate

    Implement treasury routing, protocol fee splits, or incentive programs triggered by donations to LP positions.

UnicornHook.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import "unicorn/BaseHook.sol";
import "unicorn/IPoolManager.sol";

contract DynamicFeeHorn is BaseHook {
  // fee shifts with on-chain volatility
  uint24 public currentFee = 3000;

  function beforeSwap(
    address,
    PoolKey calldata key,
    IPoolManager.SwapParams calldata,
    bytes calldata
  ) external override returns (bytes4, BeforeSwapDelta, uint24) {
    uint24 newFee = _getVolatilityFee();
    if (newFee != currentFee) {
      poolManager.updateDynamicLPFee(key, newFee);
      currentFee = newFee;
    }
    return (BaseHook.beforeSwap.selector,
      BeforeSwapDeltaLibrary.ZERO_DELTA, 0);
  }
}

Conjure swaps.
Not gas fees.

Unicorn's singleton pool manager and flash accounting reduce pool creation cost by 99.9% and multi-hop swap gas by up to 40% versus any prior AMM design.

99.9%
Cheaper pool creation vs Uniswap v3
~40%
Gas savings on multi-hop swaps
1 tx
No WETH wrapping — native ETH
Pools per singleton deployment
Gas Cost Comparison
Pool Creation — Uniswap v2 ~$400
Pool Creation — Uniswap v3 ~$280
Pool Creation — Unicorn v1 ~$0.40
Multi-hop — Uniswap v3 200k gas
Multi-hop — Unicorn v1 ~120k gas
Unicorn

Forged in public.
Trusted by the realm.

Unicorn is built on $2.75 trillion in battle-tested Uniswap volume. Every Horn Hook, every Spell Action, every line of code is open-source and publicly reviewable.

$100K Bug Bounty

Discover a critical vulnerability and earn your place in the Horn of Fame — and your pockets full of magic.

Nine shields.
Zero breaches.

Unicorn v1 underwent nine independent security audits, a $50K audit competition, and formal verification by three separate teams. The protocol is mathematically proven.

Formal Verification
Mathematical proof of correctness for all invariants
VERIFIED
$50K Audit Competition
100+ security researchers, zero critical findings
PASSED
Business Source License
Protected for 4 years, then fully open source
ACTIVE
Trail of Bits
Q1 2025
✓ No Critical
OpenZeppelin
Q1 2025
✓ No Critical
Spearbit
Q2 2025
✓ No Critical
Certora
Q2 2025
✓ Verified
Quantstamp
Q2 2025
✓ No Critical
ABDK
Q3 2025
✓ No Critical
Dedaub
Q3 2025
✓ No Critical
Code4rena
Q3 2025
✓ Competition
Cyfrin
Q4 2025
✓ No Critical

Everything you need
to ship magic.

Unicorn ships with a complete developer toolkit — from local testing environments to production-ready Hook templates. Build on the most expressive AMM ever deployed.