EcosystemNFTsDocs

Footer

Xchange

  • Swap
  • Liquidity
  • Loans
  • Fund
  • Vote

Tokens

  • X7R
  • X7DAO
  • X7D
  • X7101-X7105

Explore

  • Dashboard
  • Guides
  • Integration
  • Whitepaper
  • Breakdowns
  • Onchains
  • FAQs

Community

  • Telegram
  • Twitter
  • Discord
  • Warpcast
  • Blog
  • Links

Permissionless Trustless Decentralized Exchange

Launch your project on Xchange with 10-1000x the initial liquidity across multiple blockchains where anyone can Swap, Borrow and Lend!

X7 Finance·Trust No One. Trust Code. Long Live DeFi.
  • Telegram
  • Twitter
  • Discordś
  • Warpcast
  • YouTube
  • Reddit
  • GitHub
  • Pioneer 1488 avatar
    Guides
    View
  • Pioneer 1488 avatar
    Integration
    View
  • Pioneer 1488 avatar
    Whitepaper
    View
  • Pioneer 1488 avatar
    Breakdowns
    View
  • Pioneer 1488 avatar
    Onchains
    View
  • Pioneer 1488 avatar
    FAQ
    View
    • Introduction
    • Initiate A Loan
    • Provide Liquidity
    • Trade
    • Launch
    • Integrate
    • Lending
    • How Xchange Works
    • Ecosystem Participants
    • Smart Contracts
    • Glossary
    • How Lending Works
    • How Liquidiation Works
    • Swaps
    • Swapping on Xchange
    • Pools
    • Flash Swaps
    • Fees
    • Slippage
    • Pricing
    • Understanding Returns
    • ERC-20 Tokens
    • Liquidity Pools
    • Impermanent Loss
Protocol Overview

How Xchange Works

How Xchange Works

Xchange is an automated liquidity protocol driven by a constant product formula and executed through a set of immutable smart contracts on the Ethereum blockchain. It eliminates the necessity for trusted intermediaries, giving utmost importance to decentralization, censorship resistance, and security. Xchange is an open-source software.

Each Xchange smart contract, also known as a pair, operates a liquidity pool comprising reserves of two ERC-20 tokens.

Anyone can participate as a liquidity provider (LP) for a pool by depositing an equal value of each underlying token, receiving pool tokens in return. These tokens represent proportional LP shares of the total reserves and are freely exchangeable for the underlying assets at any given moment.

Xchange operates using pairs as automated market makers, ready to facilitate token exchanges following the "constant product" formula. This formula, represented as x * y = k, ensures that the product (k) of a pair's reserve balances (x and y) remains unchanged during trades, which is commonly referred to as the invariant. The advantage of this formula is that larger trades, relative to the reserves, experience progressively worse execution rates compared to smaller trades.

In practical terms, Xchange imposes a 0.20% fee on trades, which 50% is added to the reserves and the other 50% going back into the eco-system. Consequently, each trade increases the value of k. This serves as a payout to liquidity providers (LPs), which they receive when redeeming their pool tokens to withdraw their share of the total reserves.

AMM

As trading is the sole mechanism capable of altering the relative price of the two paired assets on Xchange, any divergences between the Xchange price and external market prices create arbitrage opportunities. This fundamental characteristic ensures that Xchange prices consistently trend towards the market-clearing price, promoting efficient price discovery within the protocol.

To see how token swaps work in practice, and to walk through the lifecycle of a swap, check out Swaps. Or, to see how liquidity pools work, see Pools.

Ultimately, of course, the Xchange protocol is just smart contract code running on Ethereum. To understand how they work, head over to Smart Contracts.

Previous
← Lending
Next
Ecosystem Participants →

-

  • Pioneer 1488 avatar
    Guides
    View
  • Pioneer 1488 avatar
    Integration
    View
  • Pioneer 1488 avatar
    Whitepaper
    View
  • Pioneer 1488 avatar
    Breakdowns
    View
  • Pioneer 1488 avatar
    Onchains
    View
  • Pioneer 1488 avatar
    FAQ
    View