Sino Global Capital

Sep 13, 2021

8 min read

How to Solana — Chapter 2: Overview of DEX & AMM

Primitive I: Decentralized Exchange — DEX

Objectives: Global Access to Markets | Non-Custodial Commerce | Transparent & Trustless Trade

As a nascent financial primitive, DEXes lagged behind, in both adoption and disruption, for years after inception. Most traders simply lacked any practical thesis for conducting transactions on anything other than a centralized exchange (CEX), therefore the broader ecosystem was relegated to only a few thousand enthusiasts & early adopters. However, after years of quiet development, an innovative alternative to the standalone orderbook model, known as Automated Market Makers (AMMs) emerged as the second fundamental primitive for practical, permissionless commerce.

Primitive II: Automated Market Makers — AMM

Objectives: 24/7 Liquidity | Stable Buy & Sell Spreads | Transparent & Universal MM Incentives

Solana’s high-throughput, low-latency, processing capabilities provide the means for a vast suite of sophisticated AMM applications for decentralized operations, such as high-frequency trading, central limit order books(CLOB), derivatives, cloud computing, and cloud storage. These financial instruments and Web3 interfaces are rapidly being built on Solana, with seamless scaling to support over 1 billion user accounts on a single state machine.

Solana DEX/AMM Suite I: Raydium

*Note: Currently, there are two supported operations for trading on Raydium. Users can transact through the Orderbook (Trading tab) or through the AMM (Swap tab).

How to use Raydium:


2. As one can see from the image above, Raydium will ask users to connect a wallet before conducting a token swap. Click Connect on the top right button above, it will pop out a menu to select your wallet.

3. Select a desired wallet and connect to Raydium. Once the tab has recorded a public address, the user now has access to Raydium’s entire product suite.

  • Note: We recommend using either Phantom or Sollet for Web3 integration , as they are currently the most supported and adopted within the greater Solana ecosystem.

4. Select the token to be sold in the top slot, and the token to be bought in the bottom slot.

5. Insert a desired quantity, and observe the terms of the “Minimum Received” and the “Price Impact” values.

6. After confirming that the user’s selected slippage tolerance < price impact, the swap will execute once acted upon. If all displayed conditions are acceptable, click swap.

Limit Order Trading

1. Click the Trading tab on the Raydium dashboard to access Limit Orders for both buy & sell side operations.

Note: The orderbook feed will display critical data such as bid/ask spreads, real-time order flow updates, and recent on-chain trades.

2. Select a supported trading pair for an asset that the user has already deposited and settled on the Raydium interface. If the trading pair is not listed on the front-end, it is also possible to add a custom market for existing Raydium.

3.Insert desired limit order price (less than highest bid and greater than highest ask).

4. Insert desired size as either a positive real number value or as a percentage of relevant asset holdings.

Note: In this example, a limit buy of 10 SOL at $170 you be executed if/when SOL drops to $170, and should not be made above a market price of $170/SOL.

5. Click LIMIT BUY SOL and approve the transaction on your web wallet. That’s it. Repeat the same steps for Buying/Selling other tokens for a specified price on Raydium.

Solana DEX/AMM Suite II: Serum

Documentation Guide:

  • Serum is a protocol and ecosystem that brings unprecedented speed and low transaction costs to decentralized finance. It is built on Solana and is completely permissionless. Ecosystem partners can compose with Serum’s on-chain central limit order book to share liquidity and power markets-based features for institutional and retail users.
  • Serum’s on-chain central limit order book and matching engine provides liquidity and price-time-priority matching to traders and composing projects. Users benefit from this exchange model through the ability to choose the price, size and direction of their trades. Composable protocols are extensively supported by Serum’s existing architecture, bootstrapped liquidity, and matching service.
  • Users can access Serum directly for pairs that are not available on Raydium. For example Saber (SBR) is not available on Raydium, but users are able to trade it on Serum.
  • Serum’s Web3 interface also follows a standard integration procedure. Users will first connect their wallet, and then enter desired price and tokens quantities for buy/sell side execution.
  • Serum’s UI/UX for limit order trading should feel quite familiar for Raydium users.

Solana DEX/AMM Suite III: Orca

  • Orca is a relatively new, yet promising addition to the Solana ecosystem. Orca’s interface focuses on simple, straightforward UI/UX design to onboard users unfamiliar with both Solana & DeFi operations. Orca can offer casual, curious users an intuitive introduction to Solana, without sacrificing any of the backend, technical efficiency that experienced Raydium & Serum users have come to expect.
  • Orca’s DEX/AMM trading operations are all accessible from the Exchange tab on the homepage.
  • Swapping on Orca is possible with two differing inputs: numbers & words. The former is similar to Raydium/Serum. Swapping between two existing pairs requires a single input for desired quantity. Click swap, approve the transaction, and watch it confirm in milliseconds.
  • The second method requires users to write out a desired transaction into the search bar located above the swapping function ( e.g “24 USDC to orca). Orca will then proceed to register this input through its front-end and offer back suggestions which can be acted upon as on-chain trading operations. After clicking through, Orca will fill in the inputs for the user’s selected swap, and if the terms are acceptable to the user, the user will be able to click “Exchange” to commence the swap.

Supplementary Resource: Additional step-by-step examples regarding web3 integration for DEX/AMM protocols can be found in published How to Defi book, written by Coingecko.

Reference Protocols — DEX & AMM

Mainnet Products:

  1. Raydium [Mainnet][Solana]: First Solana AMM with fully decentralized central limit orderbooks.
  2. Orca [Mainnet][Solana]:DEX/AMM with intuitive, straightforward UI/UX that also features collectibles, high yield SPL-Stablecoin pools, and YF mechanics.
  3. Mango Markets [Mainnet][Solana]: Decentralized Trading Platform with spot and margin trading (up to 5x) with Serum-derived orderbook data.
  4. Mercurial [Mainnet][Solana]: Multi-token stablecoin swapper with minimal slippage.
  5. Bonfida [Mainnet][Solana] : Full product suite for critical solana infrastructure such as perpetual swaps, trading bots, token vesting, and naming services.
  6. Saber [Mainnet][Solana, Cross-Chain]: Solana’s leading cross-chain stablecoin and wrapped assets exchange for large, low-slippage stablecoin swaps

Pre-launch & Conceptual Products:

  1. Nerve Finance [BSC Mainnet][Solana Devnet]: AMM launched on BSC for low slippage trading of primarily stablecoins and other pegged assets (gold, euro, etc.)
  2. Solster Finance [Devnet][Solana]: Launchpad for Initial Dex Offerings (IDOs) seeking to provide decentralized lottery and KYC services for whitelisted token sales.
  3. Hydraswap [Devnet][Solana]: AMM leveraging Pyth’s real-time oracle feeds to offer a CEX-like experience for liquidity providers (no IL, negligible slippage) and a native cross-chain bridge.
  4. Coinmeca [Proof-of-Concept][Solana,Ethereum]: Hybrid CEX/DEX architecture with a high-speed interoperable exchange. IDO first on Ethereum as ERC-20 before transitioning to SPL token model
  5. IdentitySwap [Proof-of-Concept][Solana]: AMM bypassing traditional KYC/AML norms with decentralized identity (based on Civic’s product).

A team of former consulting, Wall Street, private equity, government, and corporate veterans accelerating the blockchain revolution

Love podcasts or audiobooks? Learn on the go with our new app.