Hartii developer docs

Guides

Guide: swap tokens

This guide is for anyone who wants to exchange one token for another, or QUAI for a token, at hartiilabs.com/swap. The swap runs on HartiiSwap, a standard pool-based exchange. A pool is a pot of two tokens that anyone can trade against. The price comes from how much of each token is in the pot.

What you need

  • A Quai wallet: Pelagus on a computer or Blip on a phone.
  • The token you want to pay with. For QUAI, keep a little extra for network gas, the small fee every transaction pays to the network.
  • Your wallet set to Quai Network.

Steps

  1. Open hartiilabs.com/swap. The page is titled Swap.
  2. Under From, QUAI is already chosen. To change it, click the box. You can search by name or symbol, or paste a token address. Choose Use this address after pasting.
  3. Under To, click Select a token and pick what you want.
  4. Type the amount in Amount. If you are connected, you can press 50% or Max. When you pay in QUAI, Max keeps some back for gas.
  5. Read You receive (est.). Under it the page says the least you will get "even if the price moves", the swap fee, and a small network fee.
  6. Press Connect wallet if you have not connected. Approve in your wallet.
  7. If you pay with a token other than QUAI, the button first says Approve and the token symbol. This lets the swap contract move that amount of your token. Press it and confirm. It is a separate transaction.
  8. Press Swap and confirm in your wallet.

What you will see

  • While it works: Confirming transaction….
  • When done: Confirmed. with a View on Quaiscan link, and a message that you swapped one token for the other.

More options

Press Details to open extra settings (it then says Hide details).

  • Rate, price impact, minimum received, route and LP fee are listed. Price impact is how much your own swap moves the pool's price. Large swaps against small pools move it more.
  • Route says Direct pair, or Via WQUAI (2-hop) when no direct pool exists. WQUAI is wrapped QUAI, and the swap simply goes through it in two steps.
  • Slippage tolerance is how far the price may move against you before the swap cancels instead of filling at a worse price. Choose 0.1%, 0.5%, 1.0% or Custom.
  • Unlimited approval skips the approve step next time. Leave it off if you prefer to approve exact amounts.

Fees

ItemValue
Swap fee0.30% of the amount you pay, paid to the people who provided the liquidity
Network gasExtra, shown as an estimate

Good to know

  • If you buy a HartiiLabs token with QUAI and its bonding curve would give you more, a notice says so and links to Trade on the curve.
  • If the price moves past your tolerance while the page is open, the button shows Price updated and a notice offers Accept new price. Read the new number before you accept.

Common mistakes

  • Wrong network. Switch your wallet to Quai Network.
  • Button says "Not enough" plus the token name. Your balance is lower than the amount. Lower the amount.
  • Failed with a slippage message. The price moved during signing. Try again. Raise slippage only a little; very high slippage can let the swap fill at a bad price.
  • Max left no gas. Keep a few QUAI aside, or use 50%.
  • Waiting a long time. Do not press Swap again. Open the View on Quaiscan link, or check your wallet on quaiscan.io, and read the receipt first.

Next

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.