Implement computing associatedBondingCurve from bondingCurve
For reference #26
This commit is contained in:
@@ -8,7 +8,9 @@ Make sure you have the required packages installed `pip install -r requirements.
|
||||
|
||||
Make sure you have your endpoints set up in `config.py`.
|
||||
|
||||
Quick note on a couple of new scripts in `/learning-examples`:
|
||||
Quick note on a couple on a few new scripts in `/learning-examples`:
|
||||
|
||||
*(this is basically a changelog now)*
|
||||
|
||||
## Bonding curve state check
|
||||
|
||||
@@ -29,3 +31,38 @@ Note that it's using the [blockSubscribe]([url](https://docs.chainstack.com/refe
|
||||
To run:
|
||||
|
||||
`python listen_to_raydium_migration.py`
|
||||
|
||||
**The new two additions are based on this question [associatedBondingCurve #26](https://github.com/chainstacklabs/pump-fun-bot/issues/26)**
|
||||
|
||||
You can take the compute the associatedBondingCurve address following the [Solana docs PDA](https://solana.com/docs/core/pda) description logic. Take the following as input *as seed* (order seems to matter):
|
||||
|
||||
- bondingCurve address
|
||||
- the Solana system token program address: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`
|
||||
- the token mint address
|
||||
|
||||
And compute against the Solana system associated token account program address: `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL`.
|
||||
|
||||
The implications of this are kinda huge:
|
||||
* you can now use `logsSubscribe` to snipe the tokens and you are not limited to the `blockSubscribe` method
|
||||
* see which one is faster
|
||||
* not every provider supports `blockSubscribe` on lower tier plans or at all, but everyone supports `logsSubscribe`
|
||||
|
||||
The following script showcase the implementation.
|
||||
|
||||
## Compute associated bonding curve
|
||||
|
||||
`compute_associated_bonding_curve.py` — computes the associated bonding curve for a given token.
|
||||
|
||||
To run:
|
||||
|
||||
`python compute_associated_bonding_curve.py` and then enter the token mint address.
|
||||
|
||||
## Listen to new direct full details
|
||||
|
||||
`listen_new_direct_full_details.py` — listens to the new direct full details events and prints the signature, the token address, and the bonding curve address.
|
||||
|
||||
To run:
|
||||
|
||||
`python listen_new_direct_full_details.py`
|
||||
|
||||
So now you can run `listen_create_from_blocksubscribe.py` and `listen_new_direct_full_details.py` at the same time and see which one is faster.
|
||||
Reference in New Issue
Block a user