Thanks to visit codestin.com
Credit goes to github.com

Skip to content

swap-dot-io/swap-io-clmm

 
 

Repository files navigation

Swap.io CLMM is an open-sourced concentrated liquidity market maker (CLMM) program built for the Solana ecosystem. This project is a fork of Raydium's CLMM, and while it builds upon the original design, it has been adapted and enhanced by the Swap.io team. For reference, you can review the original project at Raydium-Amm-v3.

Concentrated Liquidity Market Maker (CLMM) pools allow liquidity providers to select a specific price range at which liquidity is active for trades within a pool. This is in contrast to constant product Automated Market Maker (AMM) pools, where all liquidity is spread out on a price curve from 0 to ∞. For LPs, the CLMM design enables capital to be deployed with higher efficiency and earn increased yield from trading fees. For traders, CLMMs improve liquidity depth around the current price which translates to better prices and lower price impact on swaps. CLMM pools can be configured for pairs with different volatility.

Use

With docker compose

Build

docker compose run anchor_build ./build-script.sh

The output will be located in the docker-target/ directory.

Deploy

docker compose run anchor_build anchor deploy

Manual

Environment Setup

  1. Install Rust

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    rustup default 1.79.0
  2. Install Solana

    sh -c "$(curl -sSfL https://release.solana.com/v1.17.0/install)"

    then run solana-keygen new to create a keypair at the default location.

  3. install Anchor

    # Installing using Anchor version manager (avm) 
    cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
    # Install anchor
    avm install 0.29.0

Manual build and deploy

Clone the repository and enter the source code directory.

git clone https://github.com/swap-dot-io/swap-io-clmm
cd swap-io-clmm

Build

anchor build

After building, the smart contract files are all located in the target/ directory.

Deploy

anchor deploy

Attention, check your configuration and confirm the environment you want to deploy.

CPI

An example of calling clmm can be found here

License

The source code is licensed under Apache 2.0.

About

Open-Source Concentrated Liquidity Market Maker

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%