The SOLANA SOR (Smart Order Router) SmartContract repository implements a decentralized exchange (DEX) on the Solana blockchain. This project leverages the Solana Program Library (SPL) and Anchor framework to provide robust and efficient token swap functionality.
programs/
: Contains the Solana smart contracts (on-chain programs) for the DEX.src/
:- adapters/: Provides abstraction layers for integrating various external protocols and utilities into the DEX, ensuring a modular and extensible architecture.
- instructions/: Contains the core program logic, handling essential DEX functionalities such as token swaps, liquidity management, and fee calculations.
- utils/: Includes utility functions and helper methods used across the program.
Anchor.toml
: Configuration file for Anchor projects.Cargo.toml
: Rust project configuration file.package.json
: Contains dependencies and scripts for JavaScript-based tests or utilities.
- Split Trading: The DexRouter allows for split trading, enabling users to execute trades across multiple liquidity sources.
- Security: The contracts has been audited by okx innter audit team.
- Extensible Architecture: Easily integrates with other Solana-based programs and tokens.
- Anchor Framework: Utilizes Anchor for seamless program development and deployment.
- High Performance: Built on Solana, ensuring high throughput and low latency.
-
Rust: Install Rust from rustup.rs.
-
Solana CLI: Install the Solana command-line tools from Solana CLI Documentation (Recommended version: 1.18.26 for compatibility).
-
Anchor Framework: Install Anchor by running:
cargo install --git https://github.com/coral-xyz/anchor avm --force
Alternatively, follow the installation guide from the Solana Documentation to ensure compatibility and proper setup.(Recommended version: 0.30.0 and 0.30.1 for compatibility)
-
Node.js and npm (or yarn) for JavaScript utilities.
-
Clone the Repository:
git clone https://github.com/okx/WEB3-DEX-SOLANA-OPENSOURCE.git cd WEB3-DEX-SOLANA-OPENSOURCE
-
Install Dependencies:
-
With Yarn:
yarn install
-
With npm:
npm install
-
Build the Project: Use Anchor to build the smart contracts:
anchor build
-
Deploy the Smart Contracts: Configure your
Anchor.toml
with the appropriate cluster URL and deploy:anchor deploy
-
Run Tests: Use Anchor's test suite to ensure functionality:
anchor test
There are several ways you can contribute to the SOR SmartContract project:
Join our Discord community to help other developers troubleshoot their integration issues and share your experience with the SOR SmartContract. Our Discord is the main hub for technical discussions, questions, and real-time support.
- Open issues to suggest features or report minor bugs
- Before opening a new issue, search existing issues to avoid duplicates
- When requesting features, include details about use cases and potential impact
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
- Discuss non-trivial changes in an issue first
- Include tests for new functionality
- Update documentation as needed
- Add a changelog entry describing your changes in the PR
- PRs should be focused and preferably address a single concern
- Look for issues labeled "good first issue"
- Read through our documentation
- Set up your local development environment following the Installation guide
- A maintainer will review your PR
- Address any requested changes
- Once approved, your PR will be merged
- Open a discussion issue for general questions
- Join our community for real-time discussions
- Review existing issues and discussions
Thank you for contributing to the SOLANA SOR SmartContract repo!