- Notifications
You must be signed in to change notification settings - Fork4
Tee-py/raydium-scripts
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This script facilitates the swapping of tokens and adding liquidity to markets on the Raydium.io decentralized exchange. It's designed to work with the Raydium pools and liquidity markets.
- Node.js installed on your machine
- ts-node installed
- A valid JavaScript environment
Clone the repository:
git clone<repository-url>cd<repository-directory>
Install dependencies:
npm install
Generate Keys for buying and adding liquidity to the
keys/
folder in this repositoryEdit the
MARKET_ID
constant in of thesrc/fetchMarketInfo.ts
file with the appropriate market ID for the pool on raydiumrun
npm run fetchMarket
to download the market data atpool_info/<market_id>.json
Configure your script by editing the script file (
src/main.ts
). Update the following variables at the beginning of the script:constTOKEN_TO_BUY_MINT="<TOKEN MINT ADDRESS TO BUY>";constSWAP_AMOUNT="<AMOUNT OF TOKEN TO SWAP>";constSWAP_SLIPPAGE="SLIPPAGE TOLERANCE FOR SWAP";constLIQUIDITY_INPUT_TOKEN_MINT="<INPUT TOKEN MINT ADDRESS FOR LIQUIDITY>";constLIQUIDITY_INPUT_TOKEN_AMOUNT="<LIQUIDITY TOKEN INPUT AMOUNT>";constLIQUIDITY_SLIPPAGE="<LIQUIDITY SLIPPAGE>";constPOOL_MARKET_ID="<MARKET ID OF THE POOL ON RAYDIUM>";
To execute the script:
npm run script
The script will connect to the Raydium mainnet RPC, perform the specified swap and liquidity addition, and log the result.
- Ensure that your wallet and necessary private keys are securely configured in the environment where the script is run.
- Be cautious when adjusting slippage values, as they affect the likelihood of transaction success.
- Double-check token mints and market IDs to match your specific use case.
Happy Hacking 🇳🇬🚀🤖