_A High-Performance Solana Swap using Meteora's DLMM
Meteora DLMM Swap is a high-speed decentralized liquidity management market (DLMM) swap implementation for the Solana blockchain. This tool allows users to swap tokens efficiently using Meteora's liquidity pools.
- 🔄 Efficient Token Swapping - Execute swaps with optimized pricing.
- ⚡ Fast Execution - Built on Solana for high-speed transactions.
- 🔍 Low Slippage - Uses Meteora's DLMM for enhanced price stability.
- 📊 Analytics Support - Fetch live pool data and trade volumes.
Ensure you have the following installed before running the project:
- Node.js (v16+ recommended)
- Yarn or npm
- Solana CLI (
solana --version
) - Wallet (e.g., Phantom, Solflare) with SOL for transaction fees
Clone the repository and install dependencies:
git clone https://github.com/0xSabonis/meteora-dlmm-swap.git
cd meteora-dlmm-swap
yarn install # or npm install
Create a .env
file and set your Solana RPC and wallet details:
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
PRIVATE_KEY=your_private_key_here
Run the script to execute a swap:
yarn start # or npm run start
Example swap function in TypeScript:
import { swapTokens } from "./src/swap";
const main = async () => {
const tx = await swapTokens(
"SOL", // Input token
"USDC", // Output token
1 // Amount of SOL to swap
);
console.log("Swap Transaction: ", tx);
};
main();
To run in development mode:
yarn dev
Lint and format your code:
yarn lint
yarn format
Pull requests are welcome! For major changes, please open an issue first to discuss what you’d like to change.