Hartii developer docs

HartiiSwap

HartiiSwap

HartiiSwap is a standard constant-product AMM (Uniswap V2 semantics) deployed by Hartii on Quai mainnet. Anyone can create a pool for any pair of tokens, add or remove liquidity, swap, and — where a farm exists — stake LP tokens for rewards. It sits beside the HartiiLabs bonding curves: a curve is a token's launch market; a HartiiSwap pool is a normal pair that wallets, bots and aggregators already understand, and that anyone can provide liquidity to.

Live addresses — Quai mainnet (chain 9, Cyprus-1)

Pools (read the full list live with the Lens):

PoolPairSeeded
QAXE / WQUAI0x00052a890c39FF5592Ca88A89924D6083E4E31792026-09-23 by the treasury at the QAXE curve price: seeded with 20,000 QAXE + 60.84 QUAI, then deepened to ~79,000 QAXE + ~270 QUAI (≈ 541 QUAI TVL) funded from swept protocol fees

On hartiilabs.com

PageWhat it does
/swapSwap QUAI, WQUAI or any token; direct or via WQUAI, with price impact, slippage and the 0.30% fee shown. For Hartii tokens it also quotes the bonding curve and links there when the curve pays more.
/poolsEvery pool (read live via the Lens) with reserves and TVL, plus your positions.
/pools/addCreate a pool or add to one. First deposits get a Match curve price button for Hartii tokens.
/pools/removeWithdraw 25/50/75/100% or an exact LP amount.
/farmsStake LP in funded farms.
Token pageA HartiiSwap pool card: the live pool, or Create the first pool.
PortfolioYour LP positions and their underlying amounts.

The numbers that matter

Swap fee0.30% of the input, paid to liquidity providers
Protocol fee1/6 of the LP fee growth (≈ 0.05% of volume), minted as LP tokens to factory.feeTo() — the Hartii treasury — on the next liquidity event. Set on at deploy.
Locked liquidityThe first MINIMUM_LIQUIDITY = 1000 LP units of every pool are minted to address(0) forever
Price formulaamountOut = amountIn·997·reserveOut / (reserveIn·1000 + amountIn·997)
LP tokenHartiiSwap LP / HSLP, 18 decimals, EIP-2612 permit

How it differs from Uniswap V2 (read this if you've integrated V2 before)

  1. Pairs are created with plain CREATE, not CREATE2. On Quai a CREATE2 address lands in the Cyprus-1 zone only about 1 time in 256 without salt grinding; contract CREATE is proven zone-valid. Consequence: you cannot compute a pair address from an init-code hash. Always call factory.getPair(tokenA, tokenB). The router does the same internally.
  2. "ETH" means QUAI. Router functions keep V2's names (addLiquidityETH, swapExactETHForTokens, …) so existing tooling works; router.WETH() returns WQUAI.
  3. Solidity 0.8.20. Checked arithmetic replaces SafeMath; the timestamp delta and price accumulators are explicitly unchecked exactly where V2 relies on wrap-around. One visible effect: minting into a never-funded pair reverts with a Panic (0x11) rather than a text message.
  4. Two-step feeToSetter (proposeFeeToSetteracceptFeeToSetter). The flash-swap callback is hartiiSwapCall(sender, amount0, amount1, data).

What nobody can do

There is no owner of pooled funds, no pause, no upgrade and no blacklist. The factory's only privileged powers are setFeeTo (where the 0.05% protocol share goes, or turn it off) and handing that role over — held by the treasury. Liquidity providers can always withdraw their share.

Pages

  • Contracts — factory, pair, router, Lens: every function, event and revert.
  • Liquidity — creating a pool, first-deposit pricing, adding and removing, fees and impermanent loss, the protocol fee.
  • Integrate — runnable quais code for quoting, swapping, providing liquidity and reading pools.
  • Farms — LP incentives with HartiiFarm.

HartiiLabs tokens can trade on both their bonding curve and a HartiiSwap pool; see Pricing a token for how to price each venue.

Quai Network mainnet · chain 9 · Cyprus-1. Figures marked "read on" a date were read from the chain that day; re-read before relying on them.