CenturionDEX
Launch App

How CenturionDEX v2 works

Last modified:

 Liquidity Provider          Trader
        |                      |
        v                      v
 +-------------+  +-------------------------+  +-----------+
 |   Deposit   |->| CenturionDEX Pool       |<-|   Swap    |
 |             |  |                         |  |           |
 | Input:      |  |  Reserves               |  | Input:    |
 |  10 Token A |  |  +-------+ +--------+  |  |  10 A     |
 |  + 1 B      |  |  | 100 A | |  10 B  |  |  |           |
 |             |  |  +-------+ +--------+  |  | Output:   |
 | Output:     |  |                         |  |  1 B      |
 |  4 LP Shares|  |  Liquidity Shares       |  |           |
 +-------------+  |  +------------------+  |  +-----------+
                  |  | 12 Pool Tokens   |  |
                  |  +------------------+  |
                  +-------------------------+

CenturionDEX v2 is an automated liquidity protocol governed by a constant product formula and implemented as a system of non-upgradeable smart contracts on the Ethereum blockchain. It requires no trusted intermediaries and prioritizes decentralization, censorship resistance, and security. CenturionDEX v2 is open-source software licensed under the GPL.

Each pair contract manages a liquidity pool holding reserves of two ERC-20 tokens.

Anyone can become a liquidity provider (LP) by depositing an equivalent value of each token. In return they receive pool tokens representing their pro-rata share of total reserves, redeemable at any time.

 Liquidity           CenturionDEX Pair (A/B)
 Provider
    |        Increased liquidity reduces price
    |        slippage for trades.
    |
    |          Token B                Reserves
    |            |                    +--------------+
    |            | \                  | 1210 Token A |
    v            |  \  <-- before     +--------------+
 +-----------+   |   \.
 | Deposit   |-->|    .\              Liquidity Shares
 |           |   |    . \  low        +--------------+
 | In: 3 A   |   |    .  . slippage   | 12 Pool      |
 |   + 1 B   |   |    .   .<- after   |    Tokens     |
 |           |   |    .    .          +--------------+
 | Out: 12.4 |   +----'----'-----
 | Pool Tkns |       Token A
 +-----------+
              Price curve: x * y = k

Pairs act as automated market makers: they accept one token for the other as long as the constant product x * y = k is preserved — trades must not change the product of a pair's reserve balances. Because k is unchanged from the reference frame of a single trade, it is called the invariant. This formula causes larger trades (relative to reserves) to execute at exponentially worse rates than smaller ones.

In practice, a 0.30% fee is charged on every trade and added to reserves, so each trade increases k. This serves as a payout to LPs, realized when they burn pool tokens to withdraw their share. A future protocol upgrade may reduce the LP fee to 0.25%, directing the remaining 0.05% to a protocol-wide charge.

 Trader               CenturionDEX Pair (A/B)
    |
    |        Trades change the balance of reserves
    |        resulting in a new price.
    |
    |          Token B                Reserves
    |            |                    +----------------+
    |            | \                  | ~1203.009 A    |
    v            |  . <-- before      +----------------+
 +-----------+   |   \
 | Swap      |-->|    \               Liquidity Shares
 |           |   |     \  low         +----------------+
 | In: 3 A   |   |      . slippage   | 12 Pool Tokens |
 | + 0.3% fee|   |       .<-- after   +----------------+
 |           |   +--------'------
 | Out:      |       Token A
 | ~0.997 B  |
 +-----------+   Pool End: ~1203 / ~399 = ~3.015
                                   --> Next price
              Price curve: x * y = k

Because pair prices can only move through trading, any divergence from external market prices creates an arbitrage opportunity. This mechanism keeps CenturionDEX v2 prices aligned with the broader market.

Further reading