Crownswap
CrownSwap
Published in
3 min readNov 9, 2021

--

AMM model

AMM model

AMM is known as Automated Market Maker. The AMM mechanism consists the CrownSwap algorithm mechanism is X*Y=Z.

Z is an invariant constant and x and y represent the number of PRC20 tokens available in a given transaction. By using this formula, the number and price of the two PRC20 tokens can be calculated. The relationship between the two tokens is illustrated in the following diagram.is depicted in the following diagram.

The PROS and CONS of market maker

The revenue of users who make a market with CrownSwap is derived from the trader’s share of the commission, while the risk for market makers arises from impermanent losses.

Processing fee: Traders pay a 0.25% processing fee per trade.

LP token: Market makers provide liquidity (CRO and USDT) to obtain a specific number of LP token credentials.

Withdrawal from market making. Redemption of CRO and USDT in proportion to the proportion of LP token against the entire pool and the number of coins in the pool.

Examples are given below.

User A, the first market maker, injected 1,000 CRO and 2,000 USDT into the pool and received 100 LP token with a weight of 100%.

Traders trading in the CRO/USDT pool contribute 1,000 CRO and 2,000 USDT fees to the pool, which becomes 2,000 CRO and 4,000 USDT.

If User A withdraws liquidity at this time, he will receive 100% of the CRO and USDT in the pool

The second market maker, User B, injects 1,000 CROs and 2,000 USDT into the pool, which has a total of 3,000 CROs and 6,000 USDT, with User A LP accounting for 2/3 of the pool and User B LP accounting for 1/3.

If the pool becomes 4500CRO and 9000USDT after the trader trades at this time.

User A can get 4500*2/3=3000CRO and 9000*2/3=6000USDT when withdrawing from the pool

User B can get 4500*1/3=1500CRO and 9000*1/3=3000USDT when withdrawing from the pool

Although User A and User B provide LPs with the same principal amount, it is more profitable for User A because User A gets the trader’s fee earlier.

Impermanent loss

Example:

When the user added 1000 CROs and 2000 USDT into liquidity pool, If the CRO price rose to $3 in a short time, this is equivalent that the user’s CRO inside the liquidity pool being sold from between $2-$3. If the user did not add liquidity and holds the CRO (3 USDT/coin), the value of CRO at this point will be greater than the value of the existing amount of CRO in the liquidity pool, which is called the impermanent loss.

--

--

Crownswap
CrownSwap

A stable technical context to guarantee smooth transactions