solana_swap

Crates.iosolana_swap
lib.rssolana_swap
version1.1.0
sourcesrc
created_at2024-09-08 15:34:24.425325
updated_at2024-10-25 17:13:30.092219
descriptionCreated with Anchor
homepagehttps://github.com/zubayr1/solana_swap
repositoryhttps://github.com/zubayr1/solana_swap
max_upload_size
id1368301
size18,403
(zubayr1)

documentation

README

SOLANA TOKEN SWAP PROGRAM

This project implements a decentralized token swap program on the Solana blockchain. Users can swap tokens, add and remove liquidity, and an admin receives fees from swaps.

FEATURES:

  1. Token Swapping: Allows users to swap between two tokens (e.g., USDT and wBTC).
  2. Add Liquidity: Liquidity providers can add tokens to the pool.
  3. Remove Liquidity: Providers can remove their liquidity from the pool.
  4. Fee Mechanism: A fee is applied to swaps and transferred to an admin account.

REQUIREMENTS:

  • Rust & Cargo (for Solana program development)
  • Solana CLI tools
  • Anchor framework
  • Phantom wallet for interaction

SETUP:

  1. Install Solana CLI: https://docs.solana.com/cli/install-solana-cli-tools
  2. Install Anchor: https://book.anchor-lang.com/getting_started/installation.html
  3. Configure Solana for Devnet: solana config set --url https://api.devnet.solana.com

DEPLOYMENT:

  1. Update Anchor.toml with correct Program ID and cluster.
  2. Deploy the program to Devnet:
anchor build
anchor deploy
  1. Verify deployment:
solana program show <ProgramID>

USAGES:

  1. Create the necessary token accounts for two tokens (Token A and Token B), pool accounts, and admin account using the Solana CLI.
  2. Use the program to: a. Add Liquidity b. Remove Liquidity c. Swap Tokens
Commit count: 24

cargo fmt