HartiiLabs docs

HartiiSwap

Liquidity

Creating a pool

Any address can create a pool for any token pair by calling the router's addLiquidity / addLiquidityETH: if the pair does not exist the router creates it and your deposit becomes the first one. On hartiilabs.com this is Pools → Create pool, or Create the first pool on a token page.

Step by step on hartiilabs.com

  1. Open a token page and press Create the first pool (or go to Pools → Add liquidity and pick any token — search by name, or paste any ERC-20 address; pasting something that isn't a token contract is rejected with a clear message instead of silently accepting it).
  2. Type how many tokens to deposit, or press Max. Pairing with an existing pool instead of creating one? The page detects that automatically and switches to Add liquidity mode — pick either amount and the other fills in at the pool's ratio, with any excess refunded by the router.
  3. For a HartiiLabs token the QUAI side fills itself at the token's current curve price (rounded up, so the pool never opens below the curve). Edit it only if you deliberately want a different opening price — if your price still ends up more than 3% away from the curve, a warning explains by how much before you can confirm.
  4. Check Starting price, your pool share, and LP tokens you'll receive. Set slippage tolerance (0.1% / 0.5% / 1% / custom) and, if you'd rather not approve per-deposit in future, check Approve unlimited. The Network fee (est.) line shows the gas cost up front. Creating a pool deploys its pair contract, which costs about 2.2M gas (roughly 55 QUAI at a 25,000 gwei gas price) — later deposits are about 150k gas. Max on the QUAI side keeps enough back to pay that fee.
  5. Press Create pool. The wallet asks for a one-time token approval (skipped next time if you chose unlimited), then the deposit — the button shows which step it's waiting on. The pool exists as soon as the deposit confirms, and a success screen links straight to swapping the token, the pool's position, and its farm if one exists.

The first deposit sets the price

With an empty pool, the ratio of what you deposit is the price. Deposit 20,000 QAXE and 60.84 QUAI and the pool opens at 0.003042 QUAI per QAXE. Get it wrong and arbitrageurs will trade the pool to the market price at your expense.

The first 1000 LP units are minted to address(0) and locked forever; you receive sqrt(amountToken × amountQuai) − 1000 LP.

Adding to an existing pool

Later deposits must match the pool ratio. The router takes your desired amounts, computes the optimal counterpart with quote(amountA, reserveA, reserveB) = amountA × reserveB / reserveA, and uses whichever side fits; excess QUAI is refunded. Set amountAMin/amountBMin (e.g. 99.5% of desired) so a price move between signing and inclusion cannot give you a worse deposit. LP received: min(amount0 × totalSupply / reserve0, amount1 × totalSupply / reserve1).

Seeing your position

Your LP position is on-chain the moment the deposit confirms: the pair mints LP tokens to your address in that same transaction. On hartiilabs.com you see it in three places:

  • The success screen right after a deposit shows the exact LP tokens received, read from the transaction receipt itself, and roughly what share of the pool it is, with a link to the transaction.
  • Pools → My positions lists every pool you hold LP in: LP tokens, your share of the pool, the underlying tokens your LP is worth right now, and its value in QUAI, with Add / Remove shortcuts. It refreshes every 20 seconds, when you come back to the tab, and right after any confirmed transaction. After a new deposit it checks every few seconds until the position appears.
  • The token's page shows "Your position" inside its HartiiSwap pool card.

The underlying amounts change as people trade (that is how the 0.3% fees accrue to you, and why impermanent loss exists — see Risks). Your share of the pool only changes when you or others add or remove liquidity.

Removing liquidity

Approve the pair's LP token to the router (or use a …WithPermit function), then removeLiquidityETH(token, liquidity, minToken, minQuai, to, deadline). You receive liquidity / totalSupply of both reserves at that moment.

On Pools → Remove, pick 25/50/75/Max, drag the slider, or type an exact LP amount, and the preview shows exactly what you'll receive. If one side is QUAI you can choose to receive it as native QUAI (default) or as WQUAI. Set slippage tolerance the same way as adding, optionally approve the LP token unlimited to skip that step on future removals from the same pool, then confirm — the button tracks whether the wallet is waiting on the approval or the removal itself.

What liquidity providers earn

Every swap pays 0.30% of its input into the pool, so each LP unit is backed by slightly more tokens over time. Of that growth, 1/6 (≈ 0.05% of volume) is minted to the protocol-fee recipient (factory.feeTo(), the Hartii treasury) the next time liquidity is added or removed — the standard Uniswap V2 fee switch. LPs keep the remaining ≈ 0.25%. Where a farm exists, LP tokens can also be staked for rewards.

Risks

  • Impermanent loss. A pool always holds a 50/50 value split. If the token's price moves, you end up with more of whichever side fell in value, and — before fees — less value than if you had just held both. A 2× price move costs about 5.7%; 5× about 25.5%.
  • Token risk. A pool is only as good as its tokens. A token whose contract can freeze or tax transfers can trap or drain LPs; HartiiLabs launch tokens have no transfer tax and no freeze, but anyone can create a pool for any token.
  • Thin pools move a lot. A small pool gives large price impact; check it before swapping.

Two venues for one token

A graduated HartiiLabs token trades in its curve's locked internal pool and can trade in a HartiiSwap pool. The two prices are independent; arbitrage keeps them close. The token page shows both and links to the better one. Seeding at the curve price (above) means nothing is given away when the pool opens.

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.