Questions tagged [python]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

Custom program error 0x2e

I an trying to send a transaction to RAYDIUM V4 program to remove liquid from an Liquidity Pool. However, I encountered an error with code 0x2e. From here: https://github.com/raydium-io/raydium-amm/...
Bach Kim's user avatar
2 votes
0 answers
34 views

Alternative to getProgramAccounts?

It seems Helius depreciated getGetProgramAccounts: https://www.helius.dev/blog/solana-account-webhooks I'd like to be able to query, for an SPL, the token addresses of all holders. Is there a manually ...
Yoshi 's user avatar
  • 21
1 vote
1 answer
75 views

Simulating a buy/sell transaction

I just need some direction in figuring out how to simulate a buy/sell transaction of an spl token. example token: G33s1LiUADEBLzN5jL6ocSXqrT2wsUq9W6nZ8o4k1b4L i've messed around with solana-py/solders ...
user9116's user avatar
1 vote
1 answer
39 views

Why doesn't my transactions that transfer SOL use priority fees?

When I use the method of setting the compute unit price of a transaction message for example a token swap, it sets the priority fee as intended. But when I try to set this compute unit price for a ...
sashavsthewrld's user avatar
0 votes
0 answers
6 views

"Encountering ValueError: *signers args are not used when sending VersionedTransaction in Solana Python Library"

I'm currently working on integrating Solana functionality into my Python application using the Solana Python library. During the process of sending a transaction, I encountered a ValueError with the ...
Cosinus basic function's user avatar
0 votes
1 answer
23 views

TransactionSignatureVerificationFailure when Sending Solana Swap Transaction

I'm attempting to execute a swap transaction on the Solana network using Python and the Solana API. However, I'm encountering an error related to TransactionSignatureVerificationFailure during the ...
Cosinus basic function's user avatar
1 vote
1 answer
62 views

"Solana Transaction Error: Invalid Transaction due to Missing Address Table Account"

I'm encountering an issue while trying to execute a transaction on the Solana blockchain.(swaping solana to bonk using jupiter swap api) When attempting to execute the transaction, I receive the ...
Cosinus basic function's user avatar
0 votes
0 answers
21 views

How to subscribe to NFT transfers in solana py?

I'm using solana library in python to write a program that subscribe to an account and show balance changes in real time. import asyncio from asyncstdlib import enumerate from solana.rpc.websocket_api ...
Amir reza Riahi's user avatar
0 votes
0 answers
17 views

How to perform a swap on raydium with Python [duplicate]

so I've written a simple crypto trading bot as a little project and so far im trading using the Jup API but its quite buggy and so I would like to try using raydium but Im a bit lost on how to do it ...
Elladan's user avatar
1 vote
1 answer
45 views

WSOL Account Keypairs

I created a WSOL token account so I don't have to be creating temporary token accounts every time I want to make a transaction. Thing is, I created that account using Python and the function that does ...
lsrth's user avatar
  • 21
1 vote
0 answers
19 views

Getting all "Anchor Data" variables using solana-py

I'm using solana-py to get account info from Token Acccounts on Solana, however the returned data doesn't include the full "Anchor Data" I'm seeing on solana.explorer from solana.rpc.api ...
thomas.mac's user avatar
1 vote
1 answer
36 views

Simple transfer in Python: 'not enough signers'

and apologies if there's a obvious better place to ask this. I'm writing experimental Python 3.12 code to move SOL from/to an address I create "by hand" and a centralized exchange (Kraken), ...
Richard Hickling's user avatar
2 votes
1 answer
48 views

Python - Sign encoded transaction and broadcast

I am using an API that builds a TX for me. I get the following fields: { "encoded_transaction": "...
José D.'s user avatar
  • 121
0 votes
1 answer
87 views

Jupiter Swap raise Transfer: insufficient lamports

I am trying to execute a swap on jupiter in Python. I followed the doc https://station.jup.ag/docs/apis/swap-api But when I execute I have an error: RPCException: ...
Nicolas Rey's user avatar
0 votes
1 answer
51 views

Writing Hello World program in seahorse and got this error

could not find import at /src + Seahorse.prelude. from Seahorse.prelude import * I’m writing hello world in seahorse and i got this error, if anyone help me with this.
Vishal Patadia's user avatar
1 vote
1 answer
183 views

How to Programmatically Buy SPL Solana Tokens Using Python and the Solana SDK?

I am exploring ways to automate the process of buying SPL Solana tokens using Python and the Solana SDK. I have been working with the Solana blockchain and understand the basics of creating wallets, ...
Cosinus basic function's user avatar
0 votes
0 answers
85 views

How can i fetch SPL token metadata in Python? (Symbol and Image)

im trying to fetch metadata of SPL Token in Python but it isn't working, i tried using BeautifulSoup. I need the Symbol & Image for embed post in discord. Here is an example of a token: https://...
Asus Rog's user avatar
1 vote
1 answer
106 views

How to support limit orders on a python bot

I am working on a bot that will swap tokens using python. Currently, my bot uses the dexscreener api to continuously retrieve the current price of the token to determine when to sell. However, this is ...
Ishaq Ruhani's user avatar
0 votes
0 answers
73 views

Jupiter listing delay

I am working on a bot to swap on Jupiter using python. A lot of the tokens I will be swapping will be newer tokens, (within a few minutes of listing and with a few thousand mktcap). However, when I ...
Ishaq Ruhani's user avatar
3 votes
1 answer
125 views

How do I derive the public key from a seedphrase using Python

I'm trying to write a Python script to derive a public key from a Seed Phrase using Python. My current code is the following. def generate_solana_address_from_seed(seed_phrase): seed_phrase_str = '...
Francisco Peixoto's user avatar
0 votes
0 answers
23 views

Retrieving Asset Information from Confirmed Transaction RPC Response for Compressed NFTs

Currently working on a project involving Solana and its NFT functionality, specifically dealing with compressed NFTs. I am trying to understand how to retrieve the asset information (including the ...
phybarin's user avatar
0 votes
1 answer
45 views

Multiple ATAs for the same mint

I've created a Python script that creates a wallet and monitors all SPL transactions of this wallet. Using an example to illustrate the problem: The generated public key belongs to account A with ...
theb's user avatar
  • 3
0 votes
1 answer
89 views

How to get historical solana events?

I'd like to be able to get all the events emitted for a given smart contract, let's say Mango Markets(just an example): 4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg. What I've tried (using python here,...
Madman's user avatar
  • 11
1 vote
1 answer
142 views

checking ruggability of a token [closed]

I'm trying to write some python code to check the safety of a token - I'm trying to access things like the isMutable in the metadata, work out if it's still mintable, and eventually check if LP is ...
mark's user avatar
  • 46
1 vote
2 answers
281 views

Get Holder count

How can I get the total number of holder counts for any given Solana token in python? Every API I use seems to give me an incorrect value and I need the exact value at the time of get request. Hoping ...
Guruu's user avatar
  • 11
2 votes
2 answers
3k views

How to perform a swap transaction in raydium with python?

I'm currently on a project that makes me need to do a swap transaction between SOL and a specific token (specifying the token's address) through raydium, and we are using python to build this ...
Eric vinicius's user avatar
2 votes
2 answers
173 views

How to add a new instruction to an existing transaction?

I have a serialized transaction from the Jupiter Swap API from which I can create a versioned transaction. raw_tx = VersionedTransaction.from_bytes(base64.b64decode(serialized_transaction)) But I ...
sashavsthewrld's user avatar
0 votes
1 answer
153 views

How to computeAmountOut in Python?

Assume i have the given information from raydium swap (retrieved it using simulateTransaction): { 'status': 1, 'coin_decimals': 9, 'pc_decimals': 9, 'lp_decimals': 9, 'pool_pc_amount': ...
kokiez's user avatar
  • 95
2 votes
1 answer
176 views

custom error 27 during simulate transaction

I keep getting this error and totally lost, can someone please help? The code is in python, i am using raydium pool keys to send a simulated transaction so i can calculate the price for my swap. ...
kokiez's user avatar
  • 95
1 vote
1 answer
125 views

PYTHON - Error when getting Quote in Jupyter

I'm trying to get a quote in Jupyter with Python, however it keeps giving me the error: "{'error': 'The route plan does not consume all the input amount, please lower your input amount'}". I'...
Steel Hard's user avatar
2 votes
2 answers
2k views

Faster method to retrieve pool keys [Raydium]

Currently I am downloading the whole json file from here https://api.raydium.io/v2/sdk/liquidity/mainnet.json and save it into json file, then get the pool info. Code given below for further ...
kokiez's user avatar
  • 95
2 votes
1 answer
610 views

How do i send a swap Jupiter's into Python?

im trying to buy a token in solana dex using jupiter dex, i do the next steps: 1- Get Quote 2- With the quote i get the swapTransaction How do i send this "swapTransaction" variable and ...
Emanuel's user avatar
  • 21
0 votes
1 answer
105 views

How to getProgramAccounts for Token 2022 Program?

I am trying to send get request as follows but it returns nothing... Can you please guide me how to fix this issue? and how to figure out the datasize and bytes for any program address... { jsonrpc:&...
kokiez's user avatar
  • 95
0 votes
0 answers
36 views

Getting Solona Notifications

Anyone have any idea how I can get burn or mint status of any token that triggers these functions? Theres a current tg bot that does this and im not sure how they do it... they get liqudity and ...
Guruu's user avatar
  • 11
0 votes
0 answers
164 views

How to get token balance change details for a transaction?

Given a transaction signature, and using Python, is it possible to generate a table of token balance changes for that transaction of the form (token, from, to, amount), without using the ...
data-adventure's user avatar
1 vote
1 answer
288 views

How to use custom priority fee when sending solana transactions using solana.py

This is my current code. CODE: from solana.rpc.api import Client from solana.keypair import Keypair from solana.transaction import Transaction from solana.system_program import TransferParams, ...
aste123's user avatar
  • 141
1 vote
0 answers
29 views

Invalid request on client.request_airdrop()

CODE: from solana.rpc.api import Client from solana.keypair import Keypair LAMPORT_PER_SOL = 1000000000 client = Client("https://rpc.ankr.com/solana_devnet") wallet = Keypair.generate() ...
aste123's user avatar
  • 141
0 votes
1 answer
51 views

Converting JS IDL to Python [closed]

does anyone have any example to convert IDL in Javascript to a useable one in Python? I want to be able to decode data with the IDL in python
wonton's user avatar
  • 21
1 vote
1 answer
196 views

How to send versioned transaction from bytes

I am using Magic Eden's API to generate a buy transaction, and it returns the bytes of the transaction. I'm using Python, solanapy and solders to send the transaction. However I don't know how to ...
RiadZX's user avatar
  • 21
2 votes
0 answers
215 views

The most time-efficient way to set slippage before swapping

I have the following python code to perform a swap on RAYDIUM: def make_swap_instruction( self, amount_in: int, token_account_in: PublicKey, token_account_out: ...
modalxx's user avatar
  • 21
0 votes
1 answer
201 views

how to parse transaction in python

I am trying to query a token (USDC for instance) balance for a wallet like that: response = client.get_token_accounts_by_owner( Pubkey.from_string(wallet_address), opts=TokenAccountOpts(mint=...
Nicolas Rey's user avatar
0 votes
1 answer
663 views

How to Swap on Jupiter in Python

I am trying to build a bot to swap programmatically in python on Jupiter, but could not find any doc for that. Anyone managed to do so please? Thanks!
Nicolas Rey's user avatar
0 votes
0 answers
55 views

How to get a token's "pubkey" prior to owning it?

executing the following code using solana's mint address, So11111111111111111111111111111111111111112, I can't get the public key for Solana if I don't have wrapped Solana in my wallet. How can you ...
modalxx's user avatar
  • 21
1 vote
0 answers
94 views

How to send a transaction with custom data to a Solana program in Python

I'm new to solana development, and I've been reading docs all morning and I can't seem to find a way to send a transaction to a program with custom data. I tried using TransactionInstruction but it ...
flray's user avatar
  • 11
1 vote
2 answers
1k views

Fetch newly listed created pairs on Raydium

I am facing following error:- Error finding latest created pair: argument 'program': 'str' object cannot be converted to 'Pubkey' when i try convert string to PublicKey.. It starts giving me import ...
Rana Nabeel's user avatar
0 votes
3 answers
428 views

How to create a metadata account with python?

Original Question I would like to write a python script that can create tokens. Since the Metaplex Python API seems outdated and only targeted to NFTs, I decided to do it myself. With the help of the (...
KingKevin23's user avatar
1 vote
0 answers
515 views

Trying to get started with solana-py

I hope this is ok to ask here. I've been attempting to get my feet web in web3 dev stuff for awhile now. It's had fits and starts for months now. We had baby 3 a few months ago, but I'm back in the ...
TradeUpCards's user avatar
0 votes
1 answer
614 views

How can I get block data with all transactions with one Solana API request?

How can I get the last block or slot with all transactions in it with one Solana API request? The way I found: getSlot() -> getBlock(slotNumber). The problem with this method is that it is very ...
Сергей's user avatar
1 vote
1 answer
672 views

Staking in python?

I'm currently trying to use this branch of Solana-py to create a script which allows me to automatically find the best validator and stake my SOL with it. I'm having an issue when trying to pass the ...
Morgandril's user avatar
1 vote
1 answer
432 views

Solana multiple spl tokens transfer python

I managed to send some USDC-dev token on the devnet with the following code. Is there a way to send more than 1 transaction with something like Transaction.add() Here is the working code for 1 ...
Emericdt's user avatar