Skip to main content

raydium

Python library to trade on Raydium.

Setting up

bash

export PRIVATE_KEY=base_58_private_key
export RPC_URL=rpc_url

cmd

set PRIVATE_KEY=base_58_private_key
set RPC_URL=rpc_url

FAQS

What format should my private key be in?

The private key should be in the base58 string format, not bytes.

Why are my transactions being dropped?

You get what you pay for. Don't use the main-net RPC, just spend the money for Helius or Quick Node.

How do I change the fee?

Modify the UNIT_BUDGET and UNIT_PRICE in the config.py.

Why is this failing for USDC pairs?

This code only works for SOL pairs.

Why are there "no pool keys found"?

IF YOU ARE USING A FREE TIER RPC, THIS REPO WILL NOT WORK FOR YOU. FREE TIER RPCS DO NOT ALLOW GET_ACCOUNT_INFO_PARSED().

Examples

from raydium import buy
from utils import get_pair_address

# Buy Example
token_address = "7GCihgDB8fe6KNjn2MYtkzZcRjQy3t9GHdC8uHYmW2hr" # POPCAT
pair_address = get_pair_address(token_address)
sol_in = .1
slippage = 5
buy(pair_address, sol_in, slippage)
from raydium import sell
from utils import get_pair_address

# Sell Example
token_address = "7GCihgDB8fe6KNjn2MYtkzZcRjQy3t9GHdC8uHYmW2hr" # POPCAT
pair_address = get_pair_address(token_address)
percentage = 100
slippage = 5
sell(pair_address, percentage, slippage)

Release files for raydiumsdk 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for raydiumsdk 0.3.0
File Size Uploaded
raydiumsdk-0.3.0.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for raydiumsdk 0.3.0
File Interpreter ABI Platform
raydiumsdk-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size:19.4 kB

Release files / raydiumsdk-0.3.0.tar.gz

Download URL raydiumsdk-0.3.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b76cfbd037c4d8ac69a244c461c35e509faa2545b08f2d94b3466f783dbb598f
BLAKE2b-256 checksum
How to use checksums
27ab59d34b1aa62a4d5fea43bc5a7d871b9719c13c252a63e601de244d126cdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.13.0

Release files / raydiumsdk-0.3.0-py3-none-any.whl

Download URL raydiumsdk-0.3.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a657527e5e9d7fd979eb736de11a7bd798ecf802bfe407d1e3d1bb75bf46280
BLAKE2b-256 checksum
How to use checksums
2503145629b141c96665f129afb3e15e797f0bd132846d31ff477b67e5b3b969
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.13.0

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page