Skip to content

DEX and AMM

KnyxSwap is a Uniswap-V2-style constant-product automated market maker.

Interfaceapp.testnet.kriptonyx.com
Subgraphhttps://app.testnet.kriptonyx.com/subgraphs/name/kriptonyx/

Because it is a V2 fork, the router, factory and pair interfaces are the ones you already know. Two things differ, and both will produce wrong results if you assume otherwise:

The swap fee is 0.2%, not 0.3%

amountInWithFee = amountIn × 998 / 1000. Code that assumes 997 computes the wrong output.

Use the deployed INIT_CODE_PAIR_HASH

It is 0xf1bf8e2a6157730155748d7dda53c849265620eeef1bd1a3a9da5430eedc8fb6. The hash is build-dependent — a router built from a local checkout embeds a different one and will not resolve pair addresses against the live factory. Take it from the deployed factory, never from a local compile.

Contracts

ContractAddress
KnyxSwapFactory0x7bd16633C4Be95117C9444D982fc608aA9ED3783
KnyxSwapRouter0x0C7A38D71E351eBd4cc2c1B2988c7dF025fc28A4
KnyxFarm0xC2682e516E64D0e6Df83D5d97FC70725E2414999
Multicall20x00fd1F986cf2e263f0Bca6391925c6a704Fa394e
WKNYX0xEaB9208A1b83BB2F85E13Af19E6BB8254Ac0d35b
KUSD0xf30443F13fd8f9de14Ea632E47bC874422858E9F
KNP0x95f79e7d12BBC353991f856C5330D0424E2BA7FD

How it works

The factory deploys one pair contract per token pair. A pair holds reserves of both tokens and enforces the constant product invariant:

x · y = k

A swap moves the reserves along that curve. Taking tokens out means putting more in, and the further you move the price the worse the rate — that is slippage, and it is a property of the curve, not a fee.

The 0.2% fee stays in the pool, so k grows slightly with every swap. That growth is the return to liquidity providers.

Live pool

PairWKNYX / KUSD
Address0x8470B792d2c2Ed1C8Bfe9F8600a0B2d1C80dF947
LP tokenKnyxSwap LPs (KNYX-LP), 18 decimals

Where next

KriptoNyx testnet — chain ID 3009 (kriptonyx_3009-1)