{"id":21408523,"url":"https://github.com/oselezi/solana-volume-sdk","last_synced_at":"2025-07-11T07:36:04.244Z","repository":{"id":262610526,"uuid":"887801090","full_name":"oselezi/solana-volume-sdk","owner":"oselezi","description":"SDK to be used to generate trading volume and market making through various of AMMs on Solana ","archived":false,"fork":false,"pushed_at":"2024-11-26T13:50:11.000Z","size":98,"stargazers_count":39,"open_issues_count":0,"forks_count":30,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T07:17:13.393Z","etag":null,"topics":["blockchain","bundle","jito","jito-bundle","jito-solana","market-making","node","program","sdk","solana","solana-program","swap","typescript","volume"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oselezi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-13T10:04:28.000Z","updated_at":"2025-04-23T23:17:03.000Z","dependencies_parsed_at":"2024-11-13T11:20:07.665Z","dependency_job_id":"73f68b0c-6b07-4995-8353-4e0b810ddcdf","html_url":"https://github.com/oselezi/solana-volume-sdk","commit_stats":null,"previous_names":["oselezi/solana-volume-sdk"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/oselezi/solana-volume-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oselezi%2Fsolana-volume-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oselezi%2Fsolana-volume-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oselezi%2Fsolana-volume-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oselezi%2Fsolana-volume-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oselezi","download_url":"https://codeload.github.com/oselezi/solana-volume-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oselezi%2Fsolana-volume-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264756963,"owners_count":23659309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","bundle","jito","jito-bundle","jito-solana","market-making","node","program","sdk","solana","solana-program","swap","typescript","volume"],"created_at":"2024-11-22T17:16:25.700Z","updated_at":"2025-07-11T07:36:04.206Z","avatar_url":"https://github.com/oselezi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solana Volume SDK\n\n[![npm version](https://img.shields.io/npm/v/@oselezi/solana-volume-sdk.svg)](https://www.npmjs.com/package/@oselezi/solana-volume-sdk)\n[![license](https://img.shields.io/npm/l/@oselezi/solana-volume-sdk.svg)](https://github.com/oselezi/solana-volume-sdk/blob/main/LICENSE)\n\nA powerful and easy-to-use SDK for generating trading volume and market making on the Solana blockchain.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Setup](#setup)\n  - [Generate Volume](#generate-volume)\n  - [Create Makers](#create-makers)\n  - [Execute a Single Swap](#execute-a-single-swap)\n- [API Reference](#api-reference)\n  - [Class: Amm](#class-amm)\n    - [Constructor](#constructor)\n    - [Methods](#methods)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Introduction\n\nThe Solana Volume SDK allows developers to easily interact with the Solana blockchain to generate trading volume, create market maker orders, and perform swaps. It leverages the power of the Solana ecosystem and integrates with popular decentralized exchanges (DEXes) and services like Jupiter and Jito for MEV protection.\n\n## Features\n\n- 🚀 **Easy to Use**: Simple and intuitive API for interacting with the Solana blockchain.\n- 📈 **Volume Generation**: Generate trading volume for a given token to simulate market activity.\n- ⚡ **MEV Protection**: Integrates with Jito for transaction bundling and MEV protection.\n- 🔧 **DEX Integration**: Supports multiple DEXes and allows you to specify which ones to include.\n- 💰 **Market Making**: Create multiple maker orders to provide liquidity.\n- 🛠️ **TypeScript Support**: Fully typed for better developer experience and code safety.\n\n## Installation\n\nInstall the SDK via npm:\n\n```bash\nnpm install @oselezi/solana-volume-sdk\n```\n\nOr using yarn:\n\n```bash\nyarn add @oselezi/solana-volume-sdk\n```\n\n## Usage\n\n### Setup\n\n```typescript\nimport { Connection, Keypair, PublicKey } from '@solana/web3.js';\nimport { Amm } from '@oselezi/solana-volume-sdk';\n\n// Initialize Solana connection\nconst connection = new Connection('https://api.mainnet-beta.solana.com');\n\n// Load your payer wallet (ensure you handle private keys securely)\nconst payerSecretKey = Uint8Array.from([/* Your Secret Key Array */]);\nconst payerWallet = Keypair.fromSecretKey(payerSecretKey);\n\n// Specify the token mint address\nconst mint = new PublicKey('YourTokenMintAddress');\n\n// Create an instance of the Amm class\nconst amm = new Amm(connection, payerWallet, { disableLogs: false });\n```\n\n### Generate Volume\n\n```typescript\n// Volume generation parameters\nconst minSolPerSwap = 0.001; // Minimum SOL per swap\nconst maxSolPerSwap = 0.002; // Maximum SOL per swap\nconst mCapFactor = 1;        // Market cap factor\nconst speedFactor = 1;       // Speed factor (1 is normal speed)\n\n// Start volume generation\namm.volume(\n  mint,\n  minSolPerSwap,\n  maxSolPerSwap,\n  mCapFactor,\n  speedFactor,\n  {\n    includeDexes: ['Raydium', 'Orca', 'Whirlpool'], // Optional: specify DEXes\n    jitoTipLamports: 100_000,                      // Optional: tip amount for Jito in lamports\n  }\n).catch(console.error);\n```\n\n### Create Makers\n\n```typescript\n// Number of maker orders to create\nconst totalMakersRequired = 5000;\n\n// Start creating makers\namm.makers(\n  mint,\n  totalMakersRequired,\n  {\n    includeDexes: ['Raydium', 'Orca', 'Whirlpool'], // Optional: specify DEXes\n    jitoTipLamports: 100_000,                      // Optional: tip amount for Jito in lamports\n  }\n).then((stats) =\u003e {\n  console.log('Maker stats:', stats);\n}).catch(console.error);\n```\n\n### Execute a Single Swap\n\n```typescript\n// Swap parameters\nconst direction: 'buy' | 'sell' = 'buy';\nconst amount = 0.5; // Amount in SOL\n\n// Execute the swap\namm.swap(\n  mint,\n  direction,\n  amount,\n  {\n    includeDexes: ['Raydium', 'Orca', 'Whirlpool'], // Optional: specify DEXes\n    jitoTipLamports: 100_000,                      // Optional: tip amount for Jito in lamports\n  }\n).catch(console.error);\n```\n\n### Perform Custom Swap for Makers\n\n```typescript\n// Create a signer for the swap\nconst signer = Keypair.generate();\n\n// Swap parameters for makers\nconst direction: 'buy' | 'sell' = 'buy';\nconst dexes = 'Raydium,Orca,Whirlpool'; // DEXes to include\n\n// Execute the swapMakers method\namm['swapMakers'](\n  direction,\n  mint,\n  signer,\n  'recentBlockhash', // Replace with actual blockhash\n  dexes\n).then((transaction) =\u003e {\n  // Handle the transaction, e.g., send it to the network\n}).catch(console.error);\n```\n\n### Perform Custom Swap for Volume\n\n```typescript\n// Create a signer for the swap\nconst signer = Keypair.generate();\n\n// Swap parameters for volume\nconst direction: 'buy' | 'sell' = 'sell';\nconst amount = 1_000_000; // Amount in lamports\nconst dexes = 'Raydium,Orca,Whirlpool'; // DEXes to include\n\n// Execute the swapVolume method\namm['swapVolume'](\n  direction,\n  mint,\n  amount,\n  'recentBlockhash', // Replace with actual blockhash\n  signer,\n  dexes\n).then((transaction) =\u003e {\n  // Handle the transaction, e.g., send it to the network\n}).catch(console.error);\n```\n\n\u003e **Note:** The `swapMakers` and `swapVolume` methods are private methods intended for internal use within the `Amm` class. The above examples demonstrate how to use them if you choose to expose them or adjust their access modifiers.\n\n## API Reference\n\n### Class: `Amm`\n\n#### Constructor\n\n```typescript\nconstructor(connection: Connection, payerKeypair: Keypair, options?: AmmOptions)\n```\n\n- **Parameters:**\n  - `connection`: `Connection` - Solana RPC connection.\n  - `payerKeypair`: `Keypair` - Keypair for the payer account.\n  - `options`: `AmmOptions` (optional)\n    - `disableLogs`: `boolean` - If `true`, disables logging output.\n\n#### Methods\n\n- `volume(mint: PublicKey, minSolPerSwap: number, maxSolPerSwap: number, mCapFactor: number, speedFactor?: number, options?: VolumeOptions): Promise\u003cvoid\u003e`\n\n  Generates trading volume for a token.\n\n- `makers(mint: PublicKey, totalMakersRequired: number, options?: MakerOptions): Promise\u003cMakerStats\u003e`\n\n  Executes maker orders for a token.\n\n- `swap(mint: PublicKey, direction: 'buy' | 'sell', amount: number, options?: SwapOptions): Promise\u003cvoid\u003e`\n\n  Executes a single swap.\n\n- `getTokenBalance(mint: PublicKey): Promise\u003cnumber\u003e`\n\n  Gets the token balance for the payer account.\n\n- `getSolBalance(): Promise\u003cnumber\u003e`\n\n  Gets the SOL balance for the payer account.\n\n- `swapMakers(direction: 'buy' | 'sell', mint: PublicKey, signer: Keypair, blockhash: string, dexes: string): Promise\u003cVersionedTransaction\u003e`\n\n  Swaps tokens for the makers method.\n\n  - **Parameters:**\n    - `direction`: `'buy' | 'sell'` - Direction of the swap.\n    - `mint`: `PublicKey` - Token mint address.\n    - `signer`: `Keypair` - Keypair of the signer.\n    - `blockhash`: `string` - Recent blockhash.\n    - `dexes`: `string` - Comma-separated list of DEXes to include.\n\n- `swapVolume(direction: 'buy' | 'sell', mint: PublicKey, amount: number, blockhash: string, signer: Keypair, dexes: string): Promise\u003cVersionedTransaction\u003e`\n\n  Swaps tokens for the volume method.\n\n  - **Parameters:**\n    - `direction`: `'buy' | 'sell'` - Direction of the swap.\n    - `mint`: `PublicKey` - Token mint address.\n    - `amount`: `number` - Amount to swap in lamports.\n    - `blockhash`: `string` - Recent blockhash.\n    - `signer`: `Keypair` - Keypair of the signer.\n    - `dexes`: `string` - Comma-separated list of DEXes to include.\n\n\u003e **Note:** The `swapMakers` and `swapVolume` methods are marked as `private` in the class. If you wish to use them directly, you can change their access modifiers or use them as shown in the [Usage](#usage) section.\n\n## Contributing\n\nContributions are welcome! Please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch: `git checkout -b feature/my-feature`\n3. Commit your changes: `git commit -am 'Add my feature'`\n4. Push to the branch: `git push origin feature/my-feature`\n5. Submit a pull request.\n\nPlease make sure to follow the coding style guidelines and include appropriate tests.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n### Disclaimer\n\nThis SDK is provided as-is, without warranty of any kind. Use it at your own risk. Ensure you understand the implications of interacting with the Solana blockchain and handle private keys securely.\n\n---\n\nIf you have any questions or need further assistance, feel free to open an issue on the [GitHub repository](https://github.com/oselezi/solana-volume-sdk/issues) or contact me directly.\n---\n\n**Note:** Replace placeholders like `YourTokenMintAddress` and `/* Your Secret Key Array */` with actual values specific to your setup.\n\n---\n\n### Acknowledgments\n\n- [Solana Labs](https://solana.com/) for providing the ecosystem.\n- [Jupiter Aggregator](https://jup.ag/) for liquidity aggregation.\n- [Jito Labs](https://jito.wtf/) for MEV protection services.\n\n---\n\n### Contact\n\n- **Author:** Osman Elezi\n- **GitHub:** [@oselezi](https://github.com/oselezi)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foselezi%2Fsolana-volume-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foselezi%2Fsolana-volume-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foselezi%2Fsolana-volume-sdk/lists"}