GithubHelp home page GithubHelp logo

raydium-clmm's Introduction

Raydium-Amm-v3 is an open-sourced concentrated liquidity market maker (CLMM) program built for the Solana ecosystem.

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, 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.

Environment Setup

  1. Install Rust.
  2. Install Solana and then run solana-keygen new to create a keypair at the default location.
  3. install Anchor.

Quickstart

Clone the repository and enter the source code directory.

git clone https://github.com/raydium-io/raydium-amm-v3
cd raydium-amm-v3

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.

License

The source code is licensed under Apache 2.0.

raydium-clmm's People

Contributors

0x777a avatar rainraydium avatar rudy5348 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

raydium-clmm's Issues

Programs fail tests when cargo update is ran

Similar to raydium-io/raydium-library#4, a lot of the dependancies and hooks on this are very out of date and focused around old verisons of solana, and because they havent been updated in so long a simple cargo update is enough to break everything, and theres a huge web of different versions of the same package being used because of this. software should be able to successfully work based off of cargo.toml. a better job of maintaining this has to be made.

Are tests supposed to pass?

When I run cargo test-sbf on my local machine, I see the following:

---- states::pool::pool_test::use_tickarray_bitmap_extension_test::get_first_initialized_tick_array_test stdout ----
thread 'states::pool::pool_test::use_tickarray_bitmap_extension_test::get_first_initialized_tick_array_test' panicked at programs/amm/src/states/pool.rs:177:69:
called `Result::unwrap()` on an `Err` value: InvalidSeeds

---- states::pool::pool_test::use_tickarray_bitmap_extension_test::next_initialized_tick_array_start_index_test::from_extension_positive_bitmap_to_extension_negative_bitmap stdout ----
thread 'states::pool::pool_test::use_tickarray_bitmap_extension_test::next_initialized_tick_array_start_index_test::from_extension_positive_bitmap_to_extension_negative_bitmap' panicked at programs/amm/src/states/pool.rs:177:69:
called `Result::unwrap()` on an `Err` value: InvalidSeeds

---- states::pool::pool_test::use_tickarray_bitmap_extension_test::next_initialized_tick_array_start_index_test::from_extension_negative_bitmap_to_extension_positive_bitmap stdout ----
thread 'states::pool::pool_test::use_tickarray_bitmap_extension_test::next_initialized_tick_array_start_index_test::from_extension_negative_bitmap_to_extension_positive_bitmap' panicked at programs/amm/src/states/pool.rs:177:69:
called `Result::unwrap()` on an `Err` value: InvalidSeeds

---- states::pool::pool_test::use_tickarray_bitmap_extension_test::next_initialized_tick_array_start_index_test::from_pool_bitmap_to_extension_positive_bitmap stdout ----
thread 'states::pool::pool_test::use_tickarray_bitmap_extension_test::next_initialized_tick_array_start_index_test::from_pool_bitmap_to_extension_positive_bitmap' panicked at programs/amm/src/states/pool.rs:177:69:
called `Result::unwrap()` on an `Err` value: InvalidSeeds

---- states::pool::pool_test::use_tickarray_bitmap_extension_test::next_initialized_tick_array_start_index_test::min_tick_max_tick_initialized_test stdout ----
thread 'states::pool::pool_test::use_tickarray_bitmap_extension_test::next_initialized_tick_array_start_index_test::min_tick_max_tick_initialized_test' panicked at programs/amm/src/states/pool.rs:177:69:
called `Result::unwrap()` on an `Err` value: InvalidSeeds

---- states::pool::pool_test::use_tickarray_bitmap_extension_test::next_initialized_tick_array_start_index_test::from_pool_bitmap_to_extension_negative_bitmap stdout ----
thread 'states::pool::pool_test::use_tickarray_bitmap_extension_test::next_initialized_tick_array_start_index_test::from_pool_bitmap_to_extension_negative_bitmap' panicked at programs/amm/src/states/pool.rs:177:69:
called `Result::unwrap()` on an `Err` value: InvalidSeeds

Am I doing something wrong? I've tried Solana version 0.16.17 and 0.18.4.

Program returned error: SBF program panicked

Invoking Raydium Concentrated Liquidity
Program log: Instruction: Swap
Program log: panicked at 'Integer overflow when casting to u64', programs/amm/src/libraries/big_num.rs:9:1
Program CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK consumed 32541 of 1304817 compute units
Program returned error: SBF program panicked

hi, can anyone tell me why this these transactions panicked ? Thanks a lot

transaction1: https://solscan.io/tx/9ATPJbbw4oGN9Eby8wAm497JVG2zaFnJZz8rVVi8ez1CSPxxzXvUoMcAfEcFToqpU4PwMMqMBn3ZDEzvabWijyv

transaction2: https://solscan.io/tx/aYdm3BEsjCawTaMD9o37L6oTwEN1BYK3VLdgqY2oUsnsArqACiMbPomSp1eJHw8FKAC4ZcRqrxL6BrFt8t3Jz1S

How to swap assets on-chain?

SOL <-> token or vise versa, or token <-> token

How does one swap assets on-chain? Within a smart contract or program. Is there an example?

How do handle minimize large stack variables

Hello there, I'm newbie with Rust and researching Raydium Program, I'm getting some errors with Error: Function ZN173$LT$raydium_amm_v3..instructions..open_position..OpenPositionV2$u20$as$u20$anchor_lang..Accounts$LT$raydium_amm_v3..instructions..open_position..OpenPositionV2Bumps$GT$$GT$12try_accounts17hd80ee50634db5fd5E Stack offset of 5056 exceeded max offset of 4096 by 960 bytes, please minimize large stack variables when run "anchor build". I'm not sure how to setup or run it

Thank all!!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.