⛏ Witness School · MELEK · PRANA pool
SchoolDevTokenServicesLearnAcademyBuildWhitepaperRunPoolMineFeesServersWalletHathorLibrary

KulaSwap · swapping and liquidity on PRANA

KulaSwap is a Uniswap-V2-style automated market maker on PRANA. There is no order book and no counterparty waiting to take your trade. Every market is a pool holding two tokens, and the pool quotes a price purely from how much of each it holds. You are always trading against the pool itself.

The one formula

A V2 pool keeps x · y = k. x and y are the two reserves; k must not fall. Put some of token A in and the pool gives you however much of token B keeps the product the same. That is the pricing mechanism.

Two consequences worth understanding before you trade:

Every swap also pays 0.30% to the liquidity providers of that pool. That is the entire fee; KulaSwap takes no cut on top.

Live pairs on KulaSwap

The chain did not answer just now, so no live pairs are shown. The mechanics below are unaffected.

How to swap

  1. Add PRANA to your wallet. RPC https://rpc.prana.melek.salon, chain id 712217. One tap on the Akasha wallet page.
  2. Hold some PRANA for gas. Every swap is a transaction; gas is paid in the native coin, not in the token you are swapping.
  3. Approve the router once per token. ERC-20 requires you to authorise the router (0x24e53792B7f6609c85Bd3a3179A90638c9Dbc8B5) to move a token before it can. The approval is a transaction of its own and only has to be done once per token. Approve the amount you intend to trade rather than an unlimited allowance.
  4. Check the pool you are actually routing through. Use the table above. If a pair is one-sided there is no market; if it is small, your trade will move it.
  5. Set a slippage tolerance you chose deliberately and a deadline. Slippage tolerance is the worst price you will accept — set it too high on a thin pool and you can be filled far from the quote.

How to provide liquidity — and what it costs you

Adding liquidity means depositing both tokens in the pool's current ratio. You receive LP tokens representing your share, and you earn your share of the 0.30% fee on every trade through that pool. You can withdraw by burning the LP tokens.

Impermanent loss. If the two tokens change in relative price while you are in the pool, the pool rebalances against you — it sells you out of the one that is rising and into the one that is falling. Withdraw at that point and you hold less value than if you had simply kept both tokens in your wallet. The fees you earned may or may not cover it. It is called impermanent because it reverses if the ratio returns, and it becomes permanent the moment you withdraw.

Supplying liquidity is therefore a position in both tokens, not a deposit paying a yield.

Creating a market for your own token

If you have minted a token — see PRC-20 and Make a token — it has no price until a pool exists. You create one by calling the factory (0xFb5B83ed7F54e5fa45ED528dbe2167bB0b93b1E6) and then funding both sides.

The first deposit sets the price. There is nothing to arbitrage against, so whatever ratio you deposit becomes the opening price. Deposit 1,000 of your token against 1 PRANA and you have declared your token worth a thousandth of a PRANA. A pair with no reserve on one side cannot be traded against until both sides hold a balance.

Contracts

Router0x24e53792B7f6609c85Bd3a3179A90638c9Dbc8B5UniswapV2-style; swaps and liquidity go through here
Factory0xFb5B83ed7F54e5fa45ED528dbe2167bB0b93b1E6creates and indexes pairs

Verified from the chain: the router's factory() returns the factory address above, and the factory reports the pair count shown in the table. ABIs and the full contract set are on PRANA contract dev.

The theory behind this page

KulaSwap and the DEX lineage · PRANA compute chain · The two-token economy — MELEK and PRANA · PRANA pool payouts · The bridge toll — power-down and the cost of exit