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
    • Ethos
    • Executive Summary
    • Tokenholder Value
    • Problem Summary
    • Total Addressable Market
    • Multi-chain Rollout
    • Customers And Use Cases
    • Team
    • Community Stealth Launch
    • X7 System Design Philosophy
    • X7 Functionality Summary
    • Xchange: A Leveraged Liquidity Decentralized
    • Trading Functionality
    • Understanding Swap Creation
    • Liquidity Functionality
    • Lending Pool
    • Lending Functionality
    • Borrowing
    • Governance
    • X7 ecosystem token Liquidity Provider Tokens (LP)
    • Tokenomics
    • Ecosystem Overview
    • X7R
    • X7DAO
    • X7Deposit (X7D)
    • Non-Fungible Tokens
    • Roadmap
    • DAO Handoff
    • Future Developments
Whitepaper
whitepaper

Understanding Swap Creation

Below follows a quick overview of how the smart contracts for swapping are created in Uniswap and on Xchange

Overview - Uniswap

In Uniswap, a user has 100M TokenA and & 10 ETH and wants to launch a Swap: calls TokenA#approve, then calls the Uniswap#AddLiquidityETH function sending 100M TokenA and 10Eth. A successful result yields a newly launched Liquidity Pair contract with 100M TokenA and 10Eth of liquidity. User now has 10 ETH worth of liquidity tokens.

Uniswap Flow

Overview - Xchange

In Xchange, a user has 100M TokenA and & 1 ETH and wants to launch a Swap with 10 ETH of Liquidity: calls TokenA#approve, LendingPool#InitialLiquidityLoan which calls Xchange#AddLoanedLiquidity function sending 100M TokenA and 1Eth and a selected Initial Liquidity Loan. A successful result yields a newly launched contract with 100M TokenA and 10Eth of liquidity. User now has 10 ETH worth of liquidity tokens.

Xchange Flow

Previous
← Trading Functionality
Next
Liquidity Functionality →

-

  • 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

On this page

  1. Overview - Uniswap

  2. Overview - Xchange