Skip to content

Latest commit

 

History

History
71 lines (58 loc) · 1.89 KB

README.md

File metadata and controls

71 lines (58 loc) · 1.89 KB

Meteora DLMM Swap

_A High-Performance Solana Swap using Meteora's DLMM

🚀 Overview

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.

✨ Features

  • 🔄 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.

📌 Prerequisites

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

🔧 Installation

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

⚙️ Configuration

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

🚀 Usage

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();

🛠 Development

To run in development mode:

yarn dev

Lint and format your code:

yarn lint
yarn format

🤝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you’d like to change.