Pinned Tweet
I see a lot of people talking about their bot and selling it at a high price, only to end up with 3 lines of code taken from protocol docs. So I decided to make a thread about how I developed mine using the same protocols and library : @JupiterExchange @solana/web3.js 馃У
MSK retweeted
Replying to @Bousquet_FR @Qofficiel
Mais il dit la v茅rit茅 . 脌 Paris il y a des quartiers o霉 les blancs ne sont plus pr茅sents. Le gars rigole, il vit ou ? Certainement pas dans ces quartiers
8/x
Then exec the following line
npm i @solana/web3.js
npm i cross-fetch
npm i @project-serum/anchor
npm i bs58
1
1
84
14/x
Finally, the global script, which includes all functions and is based on the "initially defined architecture".
1
1
44
4/x
-Token you want to sell: same thing, you need the token address
-The multiple you hope to make
1
1
32
6/x
2. Call the swap function to buy token
3. Refresh the price every 5 seconds until it reaches the desired price (purchase price x expected multiple).
4. Call the swap function to resell the previously purchased token and return to the starting currency.
1
27
5/x
Now let's talk about the "architecture". In order to keep the code as readable and comprehensible as possible, we're going to create one file per function. The main script will run as follows:
1. Call the Initialization function: we'll gather all the information needed.
1
24
3/x
-UserAddress: your private key - if you're going to publish your code / share it, make sure it's never visible - I highly recommend using a burn wallet
-Token you want to buy: you need the address of the token, e.g. for USDC: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
1
52
1/X
Note: the script is probably not optimized and may contain vulnerabilities - this thread is for informational purposes only - I can't be held responsible for any funds you may lose
1
26
2/X
We'll start by listing the information we'll need:
-RPC EndPoint: this allows you to connect to the blockchain to perform your transactions. You can find it for free at solana.com/rpc
1
24


