HOW TO: Maiar and Elrond
Posted on:November 03, 2022, 01:27 pm

The author is not a financial advisor. Hence, he is not qualified to give a financial advice. Everything in the article is for educational and entertainment purposes only.
What is the Maiar Exchange?
It is an automated market maker (a type of decentralized exchange (DEX) protocol) like Uniswap or PancakeSwap running on the Elrond Network.
The difference between Maiar Exchange and exchanges like Binance, Coinbase, and Kraken
Binance, Coinbase, and Kraken are known as centralized or traditional exchanges. They have an order book, which requires a buyer and a seller. The fees that the buyer pays to buy an asset and the fees that the seller pays are the profit of the exchange. Additionally, you must register an account on the exchange by providing an ID, proof of address, etc.
In contrast to a decentralized exchange, such as Maiar, there is no need for an account, therefore you keep your data to yourself, and by being an automated market maker (AMM) there is no need for a counterparty.
How does an AMM work?
If you want to buy or sell an asset, you interact with a smart contract (same as a traditional contract, but written in code). So, a trade happens between users, and contracts and the price is determined by a formula.
Token A Quantity * Token B Quantity = Constant
Imagine, Token A is Bitcoin and Token B is a stablecoin – USDC.
BTC Quantity * USDC Quantity = Constant
The liquidity pool must always have 50/50 of each cryptocurrency. If 1 BTC is $10, then for each BTC we must provide $10 of USDC or 10 USDC tokens.
10 BTC * 100 USDC = 1000
Scenario: A user bought 2 BTC for a certain amount of USDC
Constant must stay at 1000
(10 BTC – 2 BTC) * (100 USDC + x) = 1000
8 BTC *(100 USDC + x) = 1000
100 USDC + x = 1000/8
100 USDC + x = 125
x = 25
The user bought 2 BTC for $25 and the liquidity pool will look like this
8 BTC * 125 USDC = 1000
Now, the price of 1 BTC rose from $10 per BTC to $15.625.
At this moment, another user (an arbitrageur) finds an opportunity on Binance:
1 BTC = $10
He buys 2 BTC on Binance and sells them on the DEX
(8 BTC + 2 BTC) * (125USDC – x) = 1000
10 BTC * (125USDC – x) = 1000
125USDC – x = 1000/10
125USDC – x = 100
x = 25
He bought 2 BTC for $20 on CEX and sold them for $25 on DEX, netting $5 of profit.
The liquidity pool will look like this:
10 BTC * 100 USDC = 1000
Share this Post