zSwapDocs GitHub Open app

Documentation

zSwap

zSwap is a DEX on Ethereum, Base and Robinhood Chain. It compares onchain venues and outside aggregators, then settles the best route through one router. The app itself is stored on Ethereum.

Youwallet zSwap appserved from Ethereum zQuoter · onchain venues Aggregators · from zSolverList best route, after slippage zRouterone transaction VenuesAMMs, books, Precision tokens, minimum checked
Every quote is simulated before you sign. The router reverts unless you receive at least the minimum.

Quick start

  1. Open the app at zswap.wei.limo, or any gateway under Onchain hosting.
  2. Connect a wallet. Browser wallets are detected automatically. Phone wallets connect by QR code.
  3. Pick a network with the network icon in the top right.
  4. Choose tokens and an amount. The best route appears. Tap ▾ next to the rate to compare alternatives.
  5. Confirm. The app simulates the transaction, then your wallet asks you to sign.
Use your own nodeNetwork icon → "Read node". Paste any https RPC URL and the app reads through it first. Signing always stays in your wallet.

Networks

FeatureEthereumBaseRobinhood
Swap, aggregators, orders, send✓✓✓
Precision pools, launch a coin✓✓✓
Launch a cause, names, markets, TAC/ETH farm✓––
Private (Tacit)FullETH poolETH pool

Explorers: Etherscan, Basescan, Robinhood Chain Blockscout.


Swap

Type an amount in either box. The pay box quotes exact input; the receive box quotes exact output.

Where prices come from

ChainOnchain venues
EthereumUniswap V2/V3/V4, SushiSwap, Curve, Lido, Tacit, Precision pools, zSwap orders
BaseUniswap V2/V3/V4, Aerodrome, Slipstream, Precision pools, zSwap orders
RobinhoodUniswap V2/V3/V4, Deepstate order book, Precision pools, zSwap orders

Routes can be one hop, pass through a hub token, or split across venues. Each settles in one transaction, with ETH wrapped or unwrapped as needed. zSwap orders join quotes once a wallet is connected.

How routes are built

Routing is done by onchain contracts the app calls with eth_call, so every candidate is ready-to-send router calldata:

  • zQuoter prices each AMM on the chain and builds the best single hop, two- and three-hop routes through hub tokens, a split of the input across the top two venues, and a hybrid of a direct route with a hub route.
  • Order-book plans fill resting asks and bids and take any remainder from a zQuoter route, settled together by Swapbol in one call.
  • Precision routes walk one or more Precision pools through PrecisionRoute.

The app compares these with the aggregators and sends the best through zRouter, which checks what you receive.

Aggregators

The app also asks 0x, 1inch, ParaSwap, KyberSwap, Enso and OKX on all three chains, and Bebop on Ethereum and Base. The list, and the chains each one serves, are read from the onchain registry zSolverList 0x1Dfbb2…A2e3.

  • Quotes are compared net of your slippage.
  • An aggregator must beat the best onchain route by its handicap, set in the registry (0.5% today).
  • A winning aggregator still settles through zRouter, which checks the amount you receive.
  • Aggregators never see your wallet address. Slow (over 1.5 s) or failing ones are skipped.

Trade safety

SimulationEvery transaction runs as a dry run before you sign.
Slippage0.5% by default, from 0.01% to 10%. If a split route needs more (up to 5%), the app tells you.
Price impactShown from 0.5%. Warning at 5%, confirmation at 15%, and at 30% you type the number to accept.
DeadlinesQuotes expire after at most 45 s. Transactions carry a deadline, enforced by zGuard 0x000000…1961 on routes without one of their own.
ApprovalsExact amounts only, never unlimited. Permit signatures are used when the token supports them.

Orders

Place orders for tokens, ETH or NFTs. The asset is held in escrow until filled or cancelled. Boards have no owner and no fee.

OrderHow the price moves
LimitFixed. Optional expiry. Can fill in parts.
DutchFalls over time, then rests at a floor or keeps falling.
Climbing bidRises to a ceiling. The bidder escrows the payment.

Send

Send to a 0x address or a name (.wei, .eth, .base.eth).

  • SLOW sends are time-locked and can be reversed until they unlock.
  • Ethereum → Base or Robinhood uses the chain's own bridge. Only ETH crosses.
  • Out of Base or Robinhood uses a relayer (off by default, under "Another chain"). If no relayer fills, you can reclaim after 8 days 6 hours.

Precision pools

Overview

Precision pools are zSwap's own AMM. Each pool trades one pair inside one price band, and the pool contract is also its LP token.

One bandper pool, fixed at creation
ERC-20 LP"Precision LP" (pLP), with permit and Permit2
Auto-compoundingfees stay in the pool; nothing to claim
No ownerno pause, no upgrade, no protocol fee
  • Fees compound automatically. Each trade's LP fee is added to the pool, so your pLP grows in value with no claiming, restaking or gas.
  • Simple LP. Everyone in a pool holds the same position. No NFTs, no ticks.
  • Concentrated. All liquidity sits inside the band, so trades there get deeper liquidity.
  • Native ETH. ETH is held as ETH, not WETH.
  • Price history built in. Every pool records its own candles onchain.
  • Same addresses everywhere. The factory, lenses, zap, hook, policy and launcher share one address on all three chains. PrecisionRoute has one on Ethereum and another on Base and Robinhood.

How it fits together

Precision pools and the order books are the two kinds of liquidity zSwap runs itself. Pools give passive liquidity across a band, and LPs earn the fees. Boards hold orders at prices their makers choose. For every swap the app quotes both, alongside other venues, and the best route settles through zRouter in one transaction. One order-book fill can also take its remainder from other AMMs (Uniswap, Curve and others, routed by zQuoter) in the same transaction. See How routes are built.

zSwap appquotes every venue zRouter · one transaction · checks the minimum you receive Precision AMMpassive liquidity PrecisionRoute pools · pLP Factory creates Lenses read Hook Farm Launcher optional hook · TAC farm · coin launches Order booksprices set by makers Swapbol Swapboard · limit Dutchboard · falling Floorboard · rising bids AMM remaindervia zQuoter one fill can mix asks, bids and AMMs
Both are onchain, have no owner and charge no protocol fee. Other venues and aggregators are quoted alongside them.

Jump to: Guide for LPs · Guide for developers · Deployments

How a band works

A band has a low and a high price. Inside it, the pool holds both tokens and earns fees on every trade. As the price moves, the pool sells the token that is rising and buys the other one. At the edges it holds one token only.

Example: ETH/USDC band from 2,000 to 4,000 USDC per ETH price 2,0004,000 inside: earns fees current price belowabove all ETH half each all USDC ■ ETH □ USDC, by value. Half each at about 2,830, the band's geometric middle.
  • A trade that would push the price past an edge is refused. Routes can instead fill up to the edge and send the rest elsewhere.
  • A wider band covers more prices but is shallower, so it earns less per dollar deposited. A narrower band earns more while the price stays inside, and stops earning sooner.

The math

The pool prices trades as a constant-product AMM on virtual reserves: its real reserves plus the liquidity that would sit outside the band.

X = r0 + L / √pHigh
Y = r1 + L · √pLow
out = in′ · Y / (X + in′)

r0, r1: real reserves. L: the pool's LP supply. in′: input after fees. Prices are token1 per token0, where token0 is the lower address and ETH is always token0. Onchain, square-root prices are scaled by 1018 in raw token units. Because fees stay in the reserves, a pool at an edge can still hold a little of the other token: earned fees, owned by LPs.

Fees

Trade input Feemax 10% total LPs: stays in the poolbase fee, minus any creator share Creator share (optional)up to 50% of the base fee Hook surcharge (optional)on top of the base fee
  • Base fee: chosen at creation and fixed. The app offers 0.05% (pairs that track each other), 0.30% (most pairs) and 1.00% (thin or volatile).
  • LP earnings compound. The LP part of the fee stays in the pool, so each pLP is worth more over time. There is nothing to claim.
  • Creator share and hook surcharge exist only if the pool was created with them; see Creator fees & hooks. Pools created in the app have neither.
  • No protocol fee, and no router fee.

For liquidity providers

Guide for LPs

Open the app, choose Liquidity from the menu, and pick the two tokens. Each band for that pair is listed with a bar showing where the price sits in it.

How you earn

Every trade inside your band pays the pool's fee, and the LP part goes straight into the pool's reserves. Your share of the pool grows with it, and those fees also deepen the pool for the next trade. There is nothing to claim or restake, and compounding costs no gas. Uniswap V3 and V4 positions collect fees separately, so you have to claim and re-deposit them yourself.

Add to a band

  1. Choose a band whose bar shows the price inside it.
  2. Enter amounts of both tokens. Whatever doesn't fit the pool's ratio is refunded.
  3. Or tick one-sided to deposit one token. The app swaps part of it in the same transaction, and reverts if you'd get fewer pLP than quoted minus slippage. Pools with a hook need both tokens.

Create a new band

  1. Under the list, choose Create a new band.
  2. Pick a range: Full range (the widest band your deposit supports), Wide 100×, 10×, 2×, Tight 25%, or custom prices. "10×" means from a tenth of the opening price to ten times it when you deposit both tokens. With one token, the band starts at the opening price and extends 10× in one direction.
  3. Pick a fee: 0.05%, 0.30% or 1.00%.
  4. Enter amounts. Their ratio sets the opening price. For a one-token deposit, type the opening price. Prices are shown as the second token per the first (the lower address); a band of only the first token sits above the opening price, and one of only the second sits below it.
  5. Preview, then create. The new pool has no owner, no fee recipient and no hook, and anyone can add to it.

Remove

Take 25%, 50%, 75% or all of a position. You get your share of both tokens at the current mix. Exits work at any price.

Risks

  • Price moves. As the price crosses your band you end up holding more of the token that fell (impermanent loss).
  • Out of range. Outside the band your position holds one token and earns nothing until the price returns.
  • Contracts and tokens. Pools can't be changed, but they can have bugs. Tokens that charge a transfer fee aren't supported.
  • Permit2. pLP gives the canonical Permit2 contract a standing allowance, like many newer tokens. Moving your pLP through it still needs your signature.

TAC/ETH farm

Stake LP from the TAC/ETH pool 0x015535…3D6E in the PrecisionFarm 0x000000…82E0 to earn TAC on top of pool fees. Open it from the menu (Farm) or with #farm.

  • Stake, unstake, claim. Unstaking everything also claims. Claim collects TAC without unstaking.
  • Zaps: start from ETH or TAC to add liquidity and stake in one transaction. Exit as ETH and TAC, ETH only, TAC only, or LP.
  • Rewards stream at a set rate while the farm holds TAC. Anyone can top it up. The owner (Tacit's governance multisig) can change the rate but can't touch staked LP or rewards already scheduled.

On October 14, 2026: 553.89 TAC per day, funded through December 19, 2026. Read rewardRate() and periodFinish() for current values.

Price charts

Every pool stores its own candles onchain, in two rings of 256 bars. The app's 5m, 1h, 4h and 1d charts read them directly.

5-minute bars256 bars ≈ 21 hours charts: 5m, and 1h (rolled up from 5m) finished bars fold in 4-hour bars256 bars ≈ 42 days charts: 4h, and 1d (rolled up from 4h)

Each bar holds open, high, low, close, volume and trade count, at the executed price with fees included. The tape is not an oracle: a single trade can move it, so don't rely on it where manipulation matters.

Creator fees & hooks

Elsewhere, the most common hook pays the pool's creator. Precision pools build that in. Hooks stay optional and can only add a capped fee.

Built-in creator fees

  • Set at creation with two fields of the pool's Market: feeRecipient and creatorFeeBps, the creator's share of the base fee (up to 5000, i.e. 50%). Both are fixed for the pool's life.
  • Traders pay the same fee. The creator share comes out of the base fee, and LPs keep the rest.
  • No extra contract and no external call per trade.
  • Claiming: the share builds up in whichever token was paid in. The fee recipient claims both tokens with collectCreatorFees(to).
  • Protected opening. A pool with a fee recipient can only be created and seeded through the factory by that fee recipient, so nobody else can set its opening price.
  • Coins launched in the app use this. Each launch pool's creator share goes to the launcher, which splits it between the coin's creator, the protocol and a tithe.

What a hook can do

A hook is optional, named when the pool is created, and fixed. The pool calls it in two places:

CallWhenLimits
feeFor(sender, tokenIn, amountIn)Before each trade, read-onlyReturns an extra fee. Capped at 150,000 gas. A failure counts as no extra fee. Base fee plus surcharge can't exceed 10%.
afterSwap(…)After each tradeA notification only. Capped at 150,000 gas. A failure is logged and the trade still completes.

A hook can't change the price curve, block or reverse a trade, move the pool's funds or touch liquidity. Its surcharge is held in the pool and paid only to the hook.

Hooked pools give up a few things. They can't be partly filled (swapUpTo), the app's one-sided add isn't available for them, and zSwap won't route through them unless the routing policy approves the pool. Their quotes can also change if the hook's fee changes.

ConstantSurchargeHook

The live hook 0x000000…ec03 is one contract shared by every pool that names it. It charges a flat surcharge controlled by each pool's fee recipient.

  • Cuts take effect immediately.
  • Increases must be announced. They can apply after 1 day, anyone can apply them during the next 7 days, and after that they lapse.
  • Anyone can call collect(pool), which pays the pool's fee recipient. The fee recipient can also send it elsewhere with collectTo.

Routing policy

PrecisionPoolPolicy 0x000000…EC6D says which pools routers should use: pools without a hook by default, plus hooked pools it approves, minus any pool it blocks. The zSwap app follows it when quoting. It doesn't stop anyone trading with a pool directly.

Compared with Uniswap V4 hooks

Uniswap V4Precision pools
Creator feeNeeds a hook contract that runs on each tradeBuilt into the pool, set at creation
What a hook can changeSwap and liquidity behavior, including amounts; it can revert tradesOnly an extra fee, capped so the total stays at or below 10%
Hook failureThe trade fails with itIgnored; the trade goes through
GasNo limit beyond the transaction150,000 per hook call
Pool and LPOne shared contract for all pools; positions are tracked per owner and rangeOne contract per pool, which is also its ERC-20 LP token

V4 hooks are general-purpose. Precision hooks can only add a fee.

For developers

Guide for developers

Everything here is permissionless: create pools, trade them, collect creator fees, attach a hook or launch a coin from your own contracts. Most addresses are the same on every chain; only PrecisionRoute differs.

FACTORY   = 0x000000Eb27B557aB426d9E99cFd54EC455799e81  // all chains
POOL_LENS = 0x000000Bad3a2fa57ed74fa06000573ccddF6B7fB  // all chains
LIQ_LENS  = 0x000000956bf20A41C54BaE4a4b6F5C8A166DAB4E  // all chains
ZROUTER   = 0x000000000000FB114709235f1ccBFfb925F600e4  // all chains
ZGUARD    = 0x00000057B53fB5feEdedaf7066e1f1C7002b1961  // all chains
HOOK      = 0x000000Aee5a5acCFe16088A29A555D93eE42ec03  // ConstantSurchargeHook
LAUNCHER  = 0x0000002fC8E77585A008Aa45d78A71ad36293aEe  // all chains
PROUTE    = 0x0000007Be74558A1F8c9045301c6F44C8eD0c9eB  // Ethereum
PROUTE    = 0x000000D14E24e5FC8965bcDE58f21f704C944999  // Base, Robinhood
ETH       = address(0)

The shell examples use FACTORY, POOL, ETH, TAC=0xA1313eb9f3A445606D9583bcAc3ebeB56a858279 and RPC=https://ethereum-rpc.publicnode.com.

1. Check a pool is genuine

Anyone can deploy a contract that looks like a pool. Only trust addresses the factory created.

cast call $FACTORY "isPool(address)(bool)" $POOL --rpc-url $RPC

PrecisionPoolLens returns nothing for any address the factory didn't create, so reading through the lens is safe too.

2. Find pools

# pools for a pair (token0 < token1; ETH is address 0)
cast call $FACTORY "poolsForPairSlice(address,address,uint256,uint256)(address[])" \
  $ETH $TAC 0 50 --rpc-url $RPC

factory.poolCount() · poolsSlice(start, count) · poolsForTokenSlice(token, start, count)
factory.poolsForCreatorSlice(creator, start, count)

// band, fee, reserves, price, hook, fee recipient for each pool of a pair
poolLens.marketsForPair(token0, token1, sender, start, count, probe) returns (PoolInfo[])

3. Quote

# 0.01 ETH in; returns (amountOut, fits). fits=false: the trade would leave the band.
cast call $POOL "quoteExactIn(address,address,uint256)(uint256,bool)" \
  $SENDER $ETH 10000000000000000 --rpc-url $RPC

poolLens.quoteRoute(address[] pools, address sender, address tokenIn, uint256 amountIn)
  returns (Leg[] legs, uint256 amountOut)

sender is whoever calls the pool, because a hook may price by caller. Through the router that is PROUTE; for a direct swap it is your contract.

4. Swap through zRouter

The recommended path. zRouter moves your input to PrecisionRoute, which walks the pools, and the router reverts unless the recipient's balance of tokenOut rose by at least minOut. PrecisionRoute only accepts calls from the router's executor, so always go through snwap.

interface IZRouter {
  function snwap(address tokenIn, uint256 amountIn, address recipient, address tokenOut,
                 uint256 amountOutMin, address executor, bytes calldata executorData)
    external payable returns (uint256 amountOut);
  function multicall(bytes[] calldata data) external payable returns (bytes[] memory);
}
interface IPrecisionRoute {
  function route(address[] calldata pools, address tokenIn, address tokenOut,
                 uint256 amountIn, uint256 minOut, address to) external payable returns (uint256);
  function checkpoint(address token, bytes32 intent, address refundTo) external;
}

ETH in: one call, sending the ETH with it.

bytes memory r = abi.encodeCall(IPrecisionRoute.route,
  (pools, address(0), tokenOut, amountIn, minOut, to));
IZRouter(ZROUTER).snwap{value: amountIn}(address(0), amountIn, to, tokenOut, minOut, PROUTE, r);

Token in: approve zRouter for amountIn, then a multicall of two legs. The first commits PrecisionRoute to the exact route calldata, the second funds and runs it.

bytes memory r = abi.encodeCall(IPrecisionRoute.route,
  (pools, tokenIn, tokenOut, amountIn, minOut, to));
bytes[] memory legs = new bytes[](2);
legs[0] = abi.encodeCall(IZRouter.snwap, (address(0), 0, to, address(0), 0, PROUTE,
  abi.encodeCall(IPrecisionRoute.checkpoint, (tokenIn, keccak256(r), refundTo))));
legs[1] = abi.encodeCall(IZRouter.snwap, (tokenIn, amountIn, to, tokenOut, minOut, PROUTE, r));
IZRouter(ZROUTER).multicall(legs);

Deadline: neither the pools nor PrecisionRoute check time. Put a zGuard leg first in the multicall. It reverts after by and returns any ETH to the router, so the next leg can still spend it.

bytes memory guard = abi.encodeCall(IZRouter.snwap, (address(0), 0, to, address(0), 0, ZGUARD,
  abi.encodeWithSignature("deadline(uint256,address)", block.timestamp + 600, ZROUTER)));
// ETH in:   multicall{value: amountIn} with legs [guard, route leg]
// token in: multicall with legs [guard, checkpoint leg, route leg]
zRouter zGuarddeadline PrecisionRoute pool pool the router checks the amount the recipient actually received

Other entry points on PrecisionRoute, called the same way: routeUpTo(pools, tokenIn, tokenOut, amountIn, minOut, to, refundTo) fills as much as every hop can take and refunds the rest in tokenIn (pools without a hook only); routeFromWETH(pools, tokenOut, amountIn, minOut, to) takes WETH into an ETH pool.

5. Swap a pool directly

// ETH in: send exactly amountIn as msg.value. Token in: approve the pool first.
pool.swapExactIn(address tokenIn, uint256 amountIn, uint256 minOut, address to)
  payable returns (uint256 amountOut)

// fills up to the band edge and refunds the rest (pools without a hook only)
pool.swapUpTo(address tokenIn, uint256 amountIn, uint256 minOut, address to)
  payable returns (uint256 amountOut, uint256 consumed)

Cheapest path for a contract that already holds the input. minOut is the only guard; add your own deadline check.

6. Add and remove liquidity

// ETH side as msg.value; approve the pool for the token side. Unused input is refunded.
// sqrtPriceInit only matters for the first deposit.
pool.addLiquidityExact(uint256 sqrtPriceInit, uint256 amount0, uint256 amount1,
                       uint256 minLP, address to) payable
  returns (uint256 lp, uint256 used0, uint256 used1)

pool.removeLiquidity(uint256 lp, uint256 min0, uint256 min1, address to)
  returns (uint256 amount0, uint256 amount1)

liqLens.previewAdd(pool, amount0, amount1)  returns (ok, lp, used0, used1, refund0, refund1)
liqLens.previewRemove(pool, shares)         returns (ok, amount0, amount1)
liqLens.previewZap(pool, tokenIn, amountIn) returns (ok, swapPortion, expectedLp)

One-asset deposit: PrecisionRoute.zapIn swaps swapPortion and deposits both sides. Call it through snwap exactly like route, with tokenOut = pool (the LP token) and amountOutMin = minLP, and a checkpoint leg for token input. Pools with a hook can't be zapped.

zapIn(address pool, address tokenIn, uint256 amountIn, uint256 swapPortion,
      uint256 minLP, address to, address refundTo) payable returns (uint256 lp)

7. Create a pool

struct Market {
  address token0;        // lower address; address(0) for ETH
  address token1;
  uint256 sqrtPLow;      // sqrt(price) × 1e18, see below
  uint256 sqrtPHigh;
  uint256 fee;           // pips: 3000 = 0.30%; must be below 100000 (10%)
  address hook;          // address(0) for none
  address feeRecipient;  // address(0) for an unowned pool
  uint256 creatorFeeBps; // feeRecipient's share of the base fee, max 5000
}

factory.createAndSeed(Market m, uint256 sqrtPriceInit, uint256 amount0,
                      uint256 amount1, uint256 minLP, address to) payable
  returns (address pool, uint256 lp, uint256 used0, uint256 used1)

factory.createPool(Market m) returns (address pool)        // deploy only
factory.seed(Market m, sqrtPriceInit, amount0, amount1, minLP, to) payable  // first deposit
factory.poolFor(Market m) view returns (address)           // address before creation
// a price, as token1 per token0 in whole units, to the onchain form
sqrtP = sqrt(price × 10^(decimals1 − decimals0)) × 1e18
  • Approve the factory for token inputs, and send ETH as msg.value.
  • The first deposit sets the opening price (sqrtPriceInit, inside the band). A deposit at an edge is one-sided.
  • 1,000 LP units from the first deposit are locked forever.
  • A pool with a feeRecipient must be created and seeded by that address, so call the factory from the contract or wallet that will receive fees.
  • Each Market maps to one address, so the same pool can't be created twice.

8. Collect creator fees

pool.creatorOwed0() / pool.creatorOwed1()             // accrued, per token
pool.collectCreatorFees(address to) returns (uint256 amount0, uint256 amount1)  // feeRecipient only

Both tokens are paid together. feeRecipient and the share are fixed, so a contract that needs to hand fees on, like the launcher, should be the fee recipient and forward them itself.

9. Hooks

Use the shared surcharge hook: create the pool with hook = HOOK and a feeRecipient (the share can be 0). The fee recipient then controls the surcharge, in pips:

hook.surchargeOf(pool)                          // current surcharge
hook.setSurcharge(pool, pips)                   // lower it, immediately
hook.scheduleSurchargeIncrease(pool, pips)      // raise it: usable after 1 day
hook.applySurchargeIncrease(pool)               // anyone, within 7 days after that
hook.cancelSurchargeIncrease(pool)
hook.collect(pool)                              // anyone; pays the pool's feeRecipient
hook.collectTo(pool, to)                        // feeRecipient only

Write your own: any contract with these two functions can be a pool's hook.

interface IPrecisionHook {
  // extra fee in pips (1e6 = 100%); capped so base + extra ≤ 10%
  function feeFor(address sender, address tokenIn, uint256 amountIn)
    external view returns (uint256 extraFee);
  // notification after each swap; failures are ignored
  function afterSwap(address sender, address tokenIn, uint256 amountIn,
                     uint256 amountOut, address to) external;
}

pool.hookOwed0() / pool.hookOwed1()
pool.collectHookFees(address to)   // callable only by the hook
  • Each call gets at most 150,000 gas. A feeFor that fails or answers badly means no surcharge.
  • Compute the fee from state the pool exposes (reserves, supply, the price tape), not from counters kept in afterSwap: a caller can starve that callback, and the trade still succeeds.
  • Hooked pools can't be partly filled or zapped, and zSwap only routes them if the routing policy approves them.

10. Launch a coin

launcher.launch(string name, string symbol, string uri, uint256 supply,
                uint256 allocBps, uint256 startMcapWei, address owner)
  returns (address token, address pool)
launcher.launchWithArt(…same…, bytes image, uint8 mime)  // 0 png, 1 webp, 2 svg, 3 gif, 4 jpeg, 5 avif

launcher.collectFees(address token)           // anyone; splits ETH 80/10/10, burns the token side
launcher.setCreator(token, newCreator)        // current creator starts a handoff
launcher.acceptCreator(token)                 // new creator accepts
launcher.redeem(token, amount, minEthOut, to) // burn coins for their share of the pool's ETH
launcher.quoteRedeem(token, amount) · floorPrice(token)
  • Coins have 18 decimals. allocBps (≤ 2000) goes to owner; the rest seeds an ETH pool with a 1% fee and a 50% creator share. No ETH is needed.
  • startMcapWei is the opening value of the pooled supply in wei. It sets both the opening price and the depth.
  • The launcher holds the pool's LP permanently. PrecisionLauncherLens 0x000000…296B lists launches by creator.

11. Read candles

pool.tapePeriods()        // [300, 14400]
pool.tape(300, 256)       // 5-minute bars, newest first; 0 = empty bar
pool.tape(14400, 256)     // 4-hour bars
pool.tapePair()           // (base = token0, quote = token1)

Each bar is one packed uint256. Decode it with src/pools/PriceTape.sol; the format is in docs/price-tape.md.

Good to know

  • Pools pull input with transferFrom and check the exact amount arrived, so tokens with transfer fees revert.
  • ETH sent to a pool outside a swap or deposit reverts.
  • Pools have no owner, pause or upgrade. Everything in Market is fixed for the pool's life.
  • Solidity 0.8.36, EVM target Prague (transient storage), MIT license. Source: src/pools/PrecisionPool.sol and the rest of src/pools. PrecisionOraclePool, PrecisionRangePool and PrecisionStablePool are research references and aren't deployed.

Deployments

The core contracts below are verified on Sourcify or the chain's explorer. Pools themselves are created by the factory.

ContractAddress & explorersSource
PrecisionPoolFactoryCreates and indexes pools; settles routes for the router's executor.0x000000Eb27B557aB426d9E99cFd54EC455799e81EthereumBaseRobinhoodPrecisionPoolFactory.sol
PrecisionPoolOne market per contract; also its ERC-20 LP token (pLP). Deployed by the factory.One per market, created by the factory.PrecisionPool.sol
PrecisionRouteMulti-pool routes, partial fills and one-asset zaps. Called through zRouter.0x0000007Be74558A1F8c9045301c6F44C8eD0c9eBEthereum
0x000000D14E24e5FC8965bcDE58f21f704C944999BaseRobinhood
PrecisionRoute.sol
PrecisionRouteL2.sol
PrecisionZapOne-transaction LP exits through the router.0x000000d193680877a83D3C6bCA73D8726D120c67EthereumBaseRobinhoodPrecisionZap.sol
PrecisionPoolLensQuotes, market lists, positions and route previews.0x000000Bad3a2fa57ed74fa06000573ccddF6B7fBEthereumBaseRobinhoodPrecisionPoolLens.sol
PrecisionLiquidityLensPreviews of seed, add, remove and zap.0x000000956bf20A41C54BaE4a4b6F5C8A166DAB4EEthereumBaseRobinhoodPrecisionLiquidityLens.sol
ConstantSurchargeHookShared optional hook: a per-pool surcharge with delayed increases.0x000000Aee5a5acCFe16088A29A555D93eE42ec03EthereumBaseRobinhoodConstantSurchargeHook.sol
PrecisionPoolPolicyAdvisory routing list. Nothing on chain enforces it.0x00000045fc7b570Be4d71F67219508ebD295EC6DEthereumBaseRobinhoodPrecisionPoolPolicy.sol
PrecisionLauncherOne-transaction coin launch into a one-sided ETH pool.0x0000002fC8E77585A008Aa45d78A71ad36293aEeEthereumBaseRobinhoodPrecisionLauncher.sol
PrecisionLauncherLensRead views over launched coins.0x00000041201F1542EE49F9722b2590DEDFE4296BEthereumBaseRobinhoodPrecisionLauncherLens.sol
FeeSplitterReceives and splits the protocol's 10% of launch fees.0x000000aA142133107c7D2664F900f80e28BbfFbdEthereumBaseRobinhoodFeeSplitter.sol
PrecisionFarm (TAC/ETH)Streams TAC to staked TAC/ETH LP.0x0000003bF4BA0B21f5e0d35119b337F4d4CF82E0EthereumPrecisionFarm.sol
TAC/ETH poolThe farmed market. Fee 0.30%, no hook.0x0155358241411dB868BA714aE7c83A27087e3D6EEthereumPrecisionPool.sol
ETH/Z poolThe first Precision market. Fee 0.30%.0xc37F8c7E9Afe897893952ABa7fD91E0AB947837dEthereumPrecisionPool.sol

Launch

A coin

One transaction, no ETH beyond gas. The PrecisionLauncher 0x000000…3aEe mints a fixed supply. You keep up to 20%; the rest opens a one-sided ETH Precision pool. The logo is stored onchain (the creator can replace it later), and the launcher keeps the pool's LP so liquidity can't be pulled.

  • Launched pools charge 1% per trade. Half stays in the pool. The other half is collectable and split 80% to the creator, 10% to the protocol, 10% to a tithe.
  • The token side of collected fees is burned. The tithe's ETH goes to the BETH burner address; on Ethereum that also records a BETH receipt.
  • Holders can always redeem coins for their share of the ETH in the launch pool. Developers: see Launch a coin.

A cause (Ethereum)

A cause is a small DAO with a funding goal in ETH. Backers buy units (non-voting loot), and the treasury is released to the creator over the time you set. Backers can burn their units at any time for their share of what hasn't been released. The creator holds the only vote and can turn that refund off, but only after a 3-day public delay that leaves backers time to burn.

Names

Register .wei names on Ethereum (WNS 0x000000…42EB). Paid names start at 0.0005 ETH per year and take two steps, at least 60 seconds apart. Free name.id.wei names take one. Address fields across the app accept .wei, .eth and .base.eth names.

Markets

Yes/no prediction markets on PM 0x000000…B5C5 (Ethereum). Winners split the losing side's pot.

  • Pots in ETH, wstETH, USDC, BOLD or tacUSD.
  • Each market names a resolver you trust, with a fee of at most 10% fixed at creation.
  • A market is void if a side is empty at resolution or the resolver voids it, and anyone can void one left unresolved 30 days after close. Each share then takes an equal part of the pot, with no fee.

Private

Private payments through Tacit: shield, send privately to a tacit1 address or a name, and withdraw. Ethereum has the full set, including cBTC and cUSD; Base and Robinhood have the private ETH pool.

  • Your Tacit key comes from one wallet signature per visit and is never stored.
  • A withdrawal's amount, recipient and timing are public.

Points

Activity in zSwap, such as ETH swaps and ETH prediction bets, can earn points in Tacit's program. Your points show under the swap box once a wallet is connected, and are claimed on Ethereum. Tacit sets and changes the rules; see tacit.finance.


For developers

zRouter

zRouter executes every zSwap trade. It has the same address on all three chains, with a build per chain for that chain's venues, and charges no fee. Calls are small typed legs (one venue each) that you chain in a multicall; transient balances pass each leg's output to the next.

ContractAddress & explorersSource
zRouterEthereum build: Uniswap V2/V3/V4, SushiSwap, zAMM, Curve, Lido.0x000000000000FB114709235f1ccBFfb925F600e4EthereumzRouter.sol
zRouterLiteBaseBase build: Uniswap V2/V3/V4, Aerodrome, Slipstream.0x000000000000FB114709235f1ccBFfb925F600e4BasezRouterLiteBase.sol
zRouterLiteRobinhoodRobinhood build: Uniswap V2/V3/V4, Deepstate.0x000000000000FB114709235f1ccBFfb925F600e4RobinhoodzRouterLiteRobinhood.sol

Swap legs

// shape: to, exactOut, [venue params], tokenIn, tokenOut, swapAmount, amountLimit, deadline
swapV2(address to, bool exactOut, address tokenIn, address tokenOut,
       uint256 swapAmount, uint256 amountLimit, uint256 deadline)
swapV3(address to, bool exactOut, uint24 swapFee, address tokenIn, address tokenOut,
       uint256 swapAmount, uint256 amountLimit, uint256 deadline)
swapV4(address to, bool exactOut, uint24 swapFee, int24 tickSpace, address tokenIn,
       address tokenOut, uint256 swapAmount, uint256 amountLimit, uint256 deadline)

// Ethereum:  swapVZ (zAMM), swapCurve, exactETHToSTETH / exactETHToWSTETH,
//            ethToExactSTETH / ethToExactWSTETH
// Base:      swapAero(to, stable, tokenIn, tokenOut, swapAmount, amountLimit, deadline)
//            swapAeroCL(to, exactOut, tickSpacing, tokenIn, tokenOut, swapAmount, amountLimit, deadline)
// Robinhood: swapDeep(to, token0, token1, epoch, order, isBid, amountInMax, amountOutMin, deadline)
  • address(0) means ETH. It is wrapped or unwrapped for the venue automatically.
  • Exact input (exactOut = false): swapAmount is what you pay and amountLimit the minimum you receive. Exact output: swapAmount is what you want and amountLimit the most you'll pay.
  • Every leg checks its own deadline, and returns (amountIn, amountOut).

Chaining with transient balances

Each leg records its output for its recipient in transient storage (EIP-1153), which lasts only for the transaction. When the recipient is the router, the next leg spends that credit instead of pulling from your wallet, so a multi-hop route is just a list of legs:

  • Send a leg's output to the router (to = ZROUTER) to keep it for the next leg.
  • On an exact-input leg, swapAmount = 0 spends everything the router holds of tokenIn (or msg.value for ETH), so you don't need to know the previous leg's output in advance.
  • deposit pre-funds the router once from your wallet, and permit2TransferFrom does the same with a Permit2 signature. Later legs spend it.
  • sweep(token, amount, to) sends leftovers out (amount = 0 sends everything). Add it after exact-output legs to return unspent input.
You0.01 ETH leg 1 · swapV3ETH → USDC, to router router credit24.32 USDC leg 2 · swapAmount 0all USDC → DAI, to you one multicall; the credit exists only during the transaction
interface IZRouter {
  function swapV3(address to, bool exactOut, uint24 swapFee, address tokenIn, address tokenOut,
                  uint256 swapAmount, uint256 amountLimit, uint256 deadline)
    external payable returns (uint256 amountIn, uint256 amountOut);
  function multicall(bytes[] calldata data) external payable returns (bytes[] memory);
}

bytes[] memory legs = new bytes[](2);
// 1. 0.01 ETH -> USDC on Uniswap V3 (0.05%), kept in the router
legs[0] = abi.encodeCall(IZRouter.swapV3,
  (ZROUTER, false, 500, address(0), USDC, 0.01 ether, 0, deadline));
// 2. all of that USDC -> DAI on Uniswap V3 (0.01%), paid to the caller
legs[1] = abi.encodeCall(IZRouter.swapV3,
  (msg.sender, false, 100, USDC, DAI, 0, minDai, deadline));
IZRouter(ZROUTER).multicall{value: 0.01 ether}(legs);

Simulated on Ethereum on October 14, 2026: 0.01 ETH → 24.32 USDC → 24.31 DAI. swapAmount = 0 reads the router's whole balance of the token, including anything someone else left there, so size legs explicitly when that matters.

snwap: any executor

snwap(tokenIn, amountIn, recipient, tokenOut, amountOutMin, executor, executorData) sends your input to executor, runs executorData through a SafeExecutor that holds no approvals, then reverts unless recipient's balance of tokenOut rose by at least amountOutMin. zSwap uses it for aggregator fills, PrecisionRoute, the order books and zGuard. See Swap through zRouter for a worked example.

Funding

  • ETH: send it as msg.value.
  • Tokens: approve the router for the amount, or put permit(token, value, deadline, v, r, s) (EIP-2612) or permit2TransferFrom(token, amount, nonce, deadline, signature) first in the multicall. Ethereum also has permitDAI and permit2BatchTransferFrom.
  • Quotes: zQuoter 0x000000…Bf9B returns ready-to-send legs (buildBestSwap, buildBestSwapViaETHMulticall, buildSplitSwap, buildHybridSplit) for the same address on each chain.

The router's admin powers are listed under Trust model.

Onchain hosting

The app is one 666,463-byte HTML file, split across 28 data contracts. The zSwap contract joins them in html(). Contract code can't change, so each zSwap address serves the same bytes forever.

28 data contracts zSwaphtml() · request() Gatewaywei.limo, web3:// Browser

Gateways

Standards

ERC-8244 (html() returns the page), ERC-5219 (request() returns status, headers and body) and ERC-4804 (resolveMode() returns "5219").

Read it yourself

cast call 0x0a0Be4271Ca53f0002800a323Dee65A6B31CD507 "html()(string)" --json \
  --rpc-url https://ethereum-rpc.publicnode.com | jq -j '.[0]' > zSwap.html

The result is byte-identical to zSwap.html. Open it in any browser.

What the app connects to

There is no zSwap server, analytics or tracking. The app connects to RPC nodes, the listed aggregators, the WalletConnect relay for phone wallets, and Tacit's services: its relay (Private, and points when you check them), its pool keepers and Bitcoin APIs (Private), and its airdrop proof files (while a wallet is connected on Ethereum). Private also downloads Tacit's wallet code from GitHub, tacit.finance or IPFS, checked against hashes in the page. Most endpoints are listed in onchain rosters (see Trust model), alongside defaults built into the page.

Upgrades

A version never changes. An upgrade is a new version at a new address, linked to the last one.

v0.1 v0.2 next versionby DAO vote successorsuccessor previousprevious zFi DAOdeployNext The resolver serves the newest version once it has existed for 3 days. Old versions show a "newer" link and never redirect.
  • Only the zFi DAO 0x5E58BA…053E can add a version to the lineage (v0.1 → v0.2 → …), once per version, and the new one must answer to the same DAO. Anyone can deploy a standalone copy, but it isn't part of the lineage.
  • zSwapResolver 0x000000…b7AC only serves a new version once it has stood for 3 days. A name pointed at the resolver gets that delay; a name its owner sets directly does not.
  • Members vote, queue and execute in the app's governance panel (footer → governance).
Status on October 14, 2026v0.3 0x0a0Be4…D507 is live at zswap.wei, which its owner (the steward key) points at v0.3 directly. A DAO proposal would link it as v0.2's successor through zSwapLink 0x000000…8ba9, which serves the v0.3 page and has no code until the vote executes.
ContractAddress & explorersSource
zSwap v0.3The current page. 28 data chunks, served by html() and request().0x0a0Be4271Ca53f0002800a323Dee65A6B31CD507EthereumzSwap.sol
zSwap v0.2Previous version and the lineage tip today.0xe686952842627A2cf81DF42CCaD54ef98046DB8DEthereumzSwap.sol
zSwap v0.1The lineage root.0x00000095643CFfA7D9fae407a84dfCB6406456c6EthereumzSwap.sol
zSwapLink (proposed)Successor to v0.2 that serves the v0.3 page. Pending a DAO vote; no code until executed.0x000000791BE31E1F70f2FFA9d32eE3C7bb6E8ba9Ethereum
zSwapResolverWalks the lineage and serves the newest version that has stood for 3 days.0x000000E7DAD6128683D1fb415e80B30c23dAb7ACEthereumzSwapResolver.sol
zFi DAOGoverns the lineage. Only it can deploy the next version.0x5E58BA0e06ED0F5558f83bE732a4b899a674053EEthereumMoloch.sol

Trust model

No admin: every zSwap version, the quoters and lenses, zGuard, zSolverFill, the order boards, and the whole Precision core (factory, every pool, route, zap).

Has an adminWhoCanCan't
zRouterzFi DAO on Ethereum; steward key 0x1C0Aa8…5A20 on Base and RobinhoodMark contracts as trusted for execute(), and approve any address to spend tokens the router holdsChange swap logic or charge fees. Trusting a token contract would expose standing approvals to the router; the app approves only each trade's amount.
Rosters
zSolverList, zRpcList, zEndpoints, zSwapFlags
Steward key 0x1C0Aa8…5A20Change endpoints, aggregators and switches, effective immediatelyHold funds or change which contracts the app calls
PrecisionFarmTacit governance multisigSet the reward rate, recover stray tokensTouch staked LP or scheduled rewards
PrecisionPoolPolicyTacit governance multisigMark pools as routable or notStop anyone trading with a pool directly
FeeSplitterTacit governance multisigChange who receives the protocol's 10% of launch feesTouch the creator's or tithe shares
zswap.wei nameSteward key 0x1C0Aa8…5A20Point the name at another contract, immediatelyChange what any version serves; every version stays reachable by its address
zSwap versionszFi DAOAdd the next versionChange any existing version

What third parties see

  • RPC nodes see your reads. Use your own under "Read node".
  • Aggregators see the trade, not your address.
  • Tacit's relay, if used, can link a private deposit to its withdrawal.
Use at your own riskOpen source and verified is not the same as bug-free. Check addresses against this page and the repository.

Contracts

Each address links to the explorer of every chain it is on. Source links go to github.com/z-fi/zFi unless marked otherwise. Precision pool contracts are under Deployments, and zSwap versions under Upgrades.

Routing and quoting

ContractAddress & explorersSource
zRouterExecutes every trade. Typed swap legs, multicall, permits, and snwap for external executors. No protocol fee.0x000000000000FB114709235f1ccBFfb925F600e4EthereumBaseRobinhoodzRouter.sol
zRouterLiteBase.sol
zRouterLiteRobinhood.sol
SafeExecutorApproval-less, storageless executor the router calls through.0x25Fc36455aa30D012bbFB86f283975440D7Ee8DbEthereumBaseRobinhoodzRouter.sol
zRouterLiteBase.sol
zRouterLiteRobinhood.sol
zQuoterPrices every venue on its chain and returns ready-to-send router calldata.0x000000bd2DB80567c23E353ca95a251c573cBf9BEthereumBaseRobinhoodzQuoter.sol
zQuoterBase.sol
zQuoterRobinhood.sol
zQuoterV4Uniswap V4 quoting used by the Ethereum zQuoter.0x56033EBF90EbdEf9D74b38e5F7201c0624EFef01EthereumzQuoterV4.sol
zQuoter3HopL2Three-hop routes through two hubs on Base and Robinhood.0x000000f584434F81fC115b1A59243a4287dB08beBaseRobinhoodzQuoter3HopL2.sol
V4QuoteLensL2Quotes hooked Uniswap V4 pools through Uniswap's V4Quoter.0x00000000Dc6f467A7AA88e216a904Cf758453EbCEthereumBaseRobinhoodV4QuoteLensL2.sol
V4PortExecutes trades on any Uniswap V4 pool, hooked or not.0x000000dfb53Fa7f1c486470034741d5BCBE14BE9Ethereum
0x508ad1b0ae31FaF295c5af8C5c2bE9e33E0D19C4BaseRobinhood
V4Port.sol
V4PortL2.sol
DeepstateQuoteLensPrices the Deepstate on-chain order book on Robinhood.0x000000D579c1829a4b9BB720f0C26062AE608C45RobinhoodDeepstateQuoteLens.sol
zGuardDeadline and end-to-end minimum legs added to router bundles.0x00000057B53fB5feEdedaf7066e1f1C7002b1961EthereumBaseRobinhoodzGuard.sol
zSolverFillStateless executor that settles aggregator quotes through zRouter.0x0000004c9a325cE92aE2B15b7093Cd3dAefE3E85EthereumBaseRobinhoodzSolverFill.sol

Onchain rosters

On Ethereum, read by the app on every chain.

ContractAddress & explorersSource
zSolverListAggregator endpoints, chains served and handicap.0x1Dfbb2f41B596F72187370469074C46de60dA2e3EthereumzSolverList.sol
zRpcListEthereum read nodes.0x8C7348D039f58C4e9cfA936EF410eec759213b12EthereumzRpcList.sol
zEndpointsAll other off-chain endpoints, keyed by service and chain.0x00000051F365d898132f4ebF345Cd3968e02F288EthereumzEndpoints.sol
zSwapFlagsOn/off switches for lanes that depend on outside infrastructure.0x0000008a1a3C78440d0a28EBB4bb5526abA91d45EthereumzSwapFlags.sol

Orders

ContractAddress & explorersSource
SwapboardEscrowed limit orders: tokens, ETH and NFTs, partial fills, expiry.0x000000dA7bb4B2A9E3e80e9A4D4157E26CA6189bEthereum
0x0000001330435808A906432449D233d482Bc9b60BaseRobinhood
Swapboard.sol
DutchboardListings whose price falls over time.0x000000a213b430D14Bae6062c176289B05e04489Ethereum
0x000000fa42d555173395323b2956e9c42EFaEFf2BaseRobinhood
Dutchboard.sol
FloorboardBids whose price rises over time.0x00000080198137F790DA4C52bb902cf87c276748Ethereum
0x000000AC7d32e802B003a31F790eb28Ed3294BacBaseRobinhood
Floorboard.sol
SwapbolFills board orders and an AMM remainder in one transaction.0x00000087A6dc5071779Ed1F8274A39230768B976Ethereum
0x000000015d9428959A495E31A6999E1C61C64F00BaseRobinhood
Swapbol.sol
SwapbolL2.sol
OrderbolOpens funded orders, listings and bids through the router.0x000000e6c7a12C80525ee74e7434aAb919447D95Ethereum
0x0000007a1c93d42dD739E8d6cA9Dabf330934970BaseRobinhood
Orderbol.sol
OrderbolL2.sol
SwapboardViewRead lens over Swapboard and Dutchboard.0x000000E0b25449F32f7D9259aC449bA88E78dFCEEthereumBaseRobinhoodSwapboardView.sol
FloorboardViewRead lens over Floorboard.0x0000004E376e9dB5D9EC28E6711E1a64997C6ba7EthereumBaseRobinhoodFloorboardView.sol

Send, markets, names and Tacit

ContractAddress & explorersSource
SLOWTime-locked, reversible transfers.0x000000006513B7821171C8447ec7ECdfa3b956FdEthereumBaseRobinhoodsource
SlowArrivalReceiving end of an Ethereum → L2 SLOW send.0x9F8D89D298caBDC0D64cbA3888D0DA85Dc95097fEthereumBaseRobinhoodsource
SlowRelayRelayer-filled sends out of Base and Robinhood.0xC58C217791E397550492c4F84a6995Db60aDE2daEthereumBaseRobinhoodsource
PMParimutuel yes/no prediction markets.0x0000003b32cDD39bc950e56093df98aF220aB5C5EthereumPM.sol
WNS.wei name registry.0x0000000000696760E15f265e828DB644A0c242EBEthereum
Tacit pool (V1)Confidential tETH / cBTC / cUSD.0x000000000Ed1eabD231Be41d93b719056F7febFCEthereumsource
Tacit router (V1)Entry point for the V1 pool.0x000000005dA3E3B73726af3c774Deeb9472D4992Ethereumsource
Tacit ETH poolPrivate ETH pool.0x000000c2A20657CE25f2Ba99737933D031AFBEE9EthereumBaseRobinhoodsource
Tacit ETH pool routerEntry point for the ETH pool.0x0000006C96Afa6f1cD4DF8FE19bc0d8B6A6Cd7B5EthereumBaseRobinhoodsource
TACTacit token; farm rewards.0xA1313eb9f3A445606D9583bcAc3ebeB56a858279Ethereum

Resources