├── assets
├── desktop.ini
├── orders.jpg
├── pumpfun-bot.jpg
├── sol-sniper1.jpg
├── sol-sniper2.jpg
├── sol-sniper3.jpg
├── sol-trading.jpg
├── uidisplay.jpg
├── sol-trading1.jpg
├── sol-trading2.jpg
└── sol-trading3.jpg
├── requirements.txt
├── api
└── API_main
├── transaction.js
├── LICENSE
├── sol.py
├── telegram.py
├── sell.py
├── trade.py
├── README.md
└── idl
├── pump_fun_idl.json
└── raydium_amm_idl.json
/assets/desktop.ini:
--------------------------------------------------------------------------------
1 | [LocalizedFileNames]
2 | bfd.jpg=@bfd,0
3 |
--------------------------------------------------------------------------------
/assets/orders.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pumpfun-sol/Solana-Pumpfun-Trading-Bot/HEAD/assets/orders.jpg
--------------------------------------------------------------------------------
/assets/pumpfun-bot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pumpfun-sol/Solana-Pumpfun-Trading-Bot/HEAD/assets/pumpfun-bot.jpg
--------------------------------------------------------------------------------
/assets/sol-sniper1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pumpfun-sol/Solana-Pumpfun-Trading-Bot/HEAD/assets/sol-sniper1.jpg
--------------------------------------------------------------------------------
/assets/sol-sniper2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pumpfun-sol/Solana-Pumpfun-Trading-Bot/HEAD/assets/sol-sniper2.jpg
--------------------------------------------------------------------------------
/assets/sol-sniper3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pumpfun-sol/Solana-Pumpfun-Trading-Bot/HEAD/assets/sol-sniper3.jpg
--------------------------------------------------------------------------------
/assets/sol-trading.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pumpfun-sol/Solana-Pumpfun-Trading-Bot/HEAD/assets/sol-trading.jpg
--------------------------------------------------------------------------------
/assets/uidisplay.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pumpfun-sol/Solana-Pumpfun-Trading-Bot/HEAD/assets/uidisplay.jpg
--------------------------------------------------------------------------------
/assets/sol-trading1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pumpfun-sol/Solana-Pumpfun-Trading-Bot/HEAD/assets/sol-trading1.jpg
--------------------------------------------------------------------------------
/assets/sol-trading2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pumpfun-sol/Solana-Pumpfun-Trading-Bot/HEAD/assets/sol-trading2.jpg
--------------------------------------------------------------------------------
/assets/sol-trading3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pumpfun-sol/Solana-Pumpfun-Trading-Bot/HEAD/assets/sol-trading3.jpg
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | base58>=2.1.1
2 | borsh-construct>=0.1.0
3 | construct>=2.10.68
4 | construct-typing>=0.5.6
5 | solana>=0.34.3
6 | solders>=0.21.0
7 | websockets>=10.4
8 |
--------------------------------------------------------------------------------
/api/API_main:
--------------------------------------------------------------------------------
1 |
2 | import web3
3 |
4 | def place_order(w3, pair, amount, price):
5 | """Places an order on a DEX exchange.
6 |
7 | Args:
8 | w3: Web3 object connected to the wallet.
9 | pair: The trading pair (e.g. "ETH/USDT").
10 | amount: The amount of the order.
11 | price: The price of the order.
12 |
13 | Returns:
14 | The transaction of placing the order.
15 | """
16 | # Create an exchange contract
17 | exchange_contract = w3.eth.contract(
18 | address="YOUR_EXCHANGE_CONTRACT_ADDRESS",
19 | abi="YOUR_EXCHANGE_CONTRACT_ABI"
20 | )
21 |
22 | # Create order
23 | order = exchange_contract.functions.createOrder(
24 | pair, amount, price
25 | ).buildTransaction()
26 |
27 | # Send the order
28 | transaction_hash = w3.eth.sendTransaction(order)
29 |
30 | return transaction_hash
31 |
--------------------------------------------------------------------------------
/transaction.js:
--------------------------------------------------------------------------------
1 | # Initialize Solana Client and Telegram Bot
2 | solana_client = Client(config["solana_rpc_url"])
3 | telegram_bot = TeleBot(config["telegram_token"])
4 |
5 | # Utility: Get token balance
6 | def get_token_balance(wallet_address, token_address):
7 | result = solana_client.get_token_accounts_by_owner(wallet_address, {
8 | "mint": token_address
9 | })
10 | if "result" in result and "value" in result["result"]:
11 | return sum([int(account['account']['data']['parsed']['info']['tokenAmount']['amount']) for account in result["result"]["value"]])
12 | return 0
13 |
14 | # Utility: Create a transaction (mock function for MVP)
15 | def create_transaction():
16 | return "Transaction Created (Mocked)"
17 |
18 | # Function: Place a pump order
19 | def place_pump_order(wallet_address, token_address, amount, interval, repeats):
20 | print(f"Placing pump order: {amount} tokens of {token_address}")
21 | for _ in range(repeats):
22 | transaction = create_transaction()
23 | print(f"Transaction: {transaction}")
24 | time.sleep(interval)
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) [year] [fullname]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/sol.py:
--------------------------------------------------------------------------------
1 | import anchorpy
2 | from anchorpy.errors import ProgramError
3 | from solana.keypair import Keypair
4 | from solana.publickey import PublicKey
5 | from solana.system_program import SYS_PROGRAM_ID
6 | from solana.transaction import Transaction
7 | from solana.utils.token_program import TOKEN_PROGRAM_ID
8 |
9 | # Set up the wallet and RPC endpoint
10 | wallet = keypair.from_seed(bytes.fromhex("YOUR_PRIVATE_KEY")))
11 | rpc_endpoint = "https://ssc-dao.genesysgo.net"
12 |
13 | # Connect to the Solana network
14 | connection = anchorpy.Connection(rpc_endpoint)
15 |
16 | # Install the token sniper program
17 | token_sniper_program_id = PublicKey("YOUR_IDENTIFICATOR_PROGRAM_SNIPPING_TOKENS")
18 | token_sniper_program = anchorpy.Program(connection, token_sniper_program_id, wallet)
19 |
20 | # Set the address of the liquidity pool you want to snipe
21 | pool_address = PublicKey("LICIDITY POOL_ADDRESS")
22 |
23 | # Set the amount of tokens you want to buy
24 | amount_to_buy = 1000
25 |
26 | # Set the price you are willing to pay for the tokens
27 | price_to_pay = 0.01
28 |
29 | # Create a transaction for sniping tokens
30 | transaction = Transaction()
31 | transaction.add(
32 | token_sniper_program.instruction.snipe_tokens(
33 | pool_address,
34 | amount_to_buy,
35 | price_to_pay
36 | )
37 | )
38 |
39 | # Sign the transaction and send it to the network
40 | try:
41 | transaction.sign([wallet])
42 | connection.send_transaction(transaction)
43 | print("Transaction successfully sent!")
44 | except ProgramError as e:
45 | print("Error during transaction execution:", e)
46 |
--------------------------------------------------------------------------------
/telegram.py:
--------------------------------------------------------------------------------
1 | # Telegram Bot Commands
2 | @telegram_bot.message_handler(commands=['start'])
3 | def start(message: Message):
4 | telegram_bot.reply_to(message, "Welcome to PumpTrader Bot for Solana! Use /help to see commands.")
5 |
6 | @telegram_bot.message_handler(commands=['help'])
7 | def help_command(message: Message):
8 | commands = """Available commands:
9 | /balance - Get token balance
10 | /pump - Place pump orders
11 | /monitor - Monitor token price
12 | /liquidity - Manage liquidity
13 | /create_wallet - Create a new wallet
14 | """
15 | telegram_bot.reply_to(message, commands)
16 |
17 | @telegram_bot.message_handler(commands=['balance'])
18 | def balance_command(message: Message):
19 | try:
20 | _, wallet_address, token_address = message.text.split()
21 | balance = get_token_balance(wallet_address, token_address)
22 | telegram_bot.reply_to(message, f"Token balance: {balance}")
23 | except Exception as e:
24 | telegram_bot.reply_to(message, f"Error: {e}")
25 |
26 | @telegram_bot.message_handler(commands=['pump'])
27 | def pump_command(message: Message):
28 | try:
29 | _, wallet_address, token_address, amount, interval, repeats = message.text.split()
30 | place_pump_order(wallet_address, token_address, int(amount), int(interval), int(repeats))
31 | telegram_bot.reply_to(message, "Pump order executed!")
32 | except Exception as e:
33 | telegram_bot.reply_to(message, f"Error: {e}")
34 |
35 | @telegram_bot.message_handler(commands=['monitor'])
36 | def monitor_command(message: Message):
37 | try:
38 | _, token_address = message.text.split()
39 | monitor_price(token_address) # Start monitoring (simplified for MVP)
40 | except Exception as e:
41 | telegram_bot.reply_to(message, f"Error: {e}")
42 |
43 | @telegram_bot.message_handler(commands=['liquidity'])
44 | def liquidity_command(message: Message):
45 | try:
46 | _, wallet_address, token_a_address, token_b_address, pool_address, target_balance = message.text.split()
47 | manage_liquidity(wallet_address, token_a_address, token_b_address, pool_address, int(target_balance))
48 | telegram_bot.reply_to(message, "Liquidity management executed!")
49 | except Exception as e:
50 | telegram_bot.reply_to(message, f"Error: {e}")
51 |
52 | @telegram_bot.message_handler(commands=['create_wallet'])
53 | def create_wallet_command(message: Message):
54 | try:
55 | wallet = create_wallet()
56 | response = f"New wallet created:\nPublic Key: {wallet['public_key']}\nPrivate Key: {wallet['private_key']}"
57 | telegram_bot.reply_to(message, response)
58 | except Exception as e:
59 | telegram_bot.reply_to(message, f"Error: {e}")
60 |
61 | # Main loop
62 | if __name__ == "__main__":
63 | print("Starting PumpTrader Bot...")
64 | telegram_bot.polling()
65 |
--------------------------------------------------------------------------------
/sell.py:
--------------------------------------------------------------------------------
1 | import asyncio
2 | import json
3 | import base64
4 | import struct
5 | import base58
6 | from typing import Final
7 |
8 | from solana.rpc.async_api import AsyncClient
9 | from solana.transaction import Transaction
10 | from solana.rpc.commitment import Confirmed
11 | from solana.rpc.types import TxOpts
12 |
13 | from solders.pubkey import Pubkey
14 | from solders.keypair import Keypair
15 | from solders.instruction import Instruction, AccountMeta
16 | from solders.system_program import TransferParams, transfer
17 |
18 | from spl.token.instructions import get_associated_token_address
19 | import spl.token.instructions as spl_token
20 |
21 | from construct import Struct, Int64ul, Flag
22 |
23 | from config import *
24 |
25 | # Here and later all the discriminators are precalculated. See learning-examples/discriminator.py
26 | EXPECTED_DISCRIMINATOR: Final[bytes] = struct.pack(" None:
40 | parsed = self._STRUCT.parse(data[8:])
41 | self.__dict__.update(parsed)
42 |
43 | async def get_pump_curve_state(conn: AsyncClient, curve_address: Pubkey) -> BondingCurveState:
44 | response = await conn.get_account_info(curve_address)
45 | if not response.value or not response.value.data:
46 | raise ValueError("Invalid curve state: No data")
47 |
48 | data = response.value.data
49 | if data[:8] != EXPECTED_DISCRIMINATOR:
50 | raise ValueError("Invalid curve state discriminator")
51 |
52 | return BondingCurveState(data)
53 |
54 | def calculate_pump_curve_price(curve_state: BondingCurveState) -> float:
55 | if curve_state.virtual_token_reserves <= 0 or curve_state.virtual_sol_reserves <= 0:
56 | raise ValueError("Invalid reserve state")
57 |
58 | return (curve_state.virtual_sol_reserves / LAMPORTS_PER_SOL) / (curve_state.virtual_token_reserves / 10 ** TOKEN_DECIMALS)
59 |
60 | async def get_token_balance(conn: AsyncClient, associated_token_account: Pubkey):
61 | response = await conn.get_token_account_balance(associated_token_account)
62 | if response.value:
63 | return int(response.value.amount)
64 | return 0
65 |
66 | async def sell_token(mint: Pubkey, bonding_curve: Pubkey, associated_bonding_curve: Pubkey, slippage: float = 0.25, max_retries=5):
67 | private_key = base58.b58decode(PRIVATE_KEY)
68 | payer = Keypair.from_bytes(private_key)
69 |
70 | async with AsyncClient(RPC_ENDPOINT) as client:
71 | associated_token_account = get_associated_token_address(payer.pubkey(), mint)
72 |
73 | # Get token balance
74 | token_balance = await get_token_balance(client, associated_token_account)
75 | token_balance_decimal = token_balance / 10**TOKEN_DECIMALS
76 | print(f"Token balance: {token_balance_decimal}")
77 | if token_balance == 0:
78 | print("No tokens to sell.")
79 | return
80 |
81 | # Fetch the token price
82 | curve_state = await get_pump_curve_state(client, bonding_curve)
83 | token_price_sol = calculate_pump_curve_price(curve_state)
84 | print(f"Price per Token: {token_price_sol:.20f} SOL")
85 |
86 | # Calculate minimum SOL output
87 | amount = token_balance
88 | min_sol_output = float(token_balance_decimal) * float(token_price_sol)
89 | slippage_factor = 1 - slippage
90 | min_sol_output = int((min_sol_output * slippage_factor) * LAMPORTS_PER_SOL)
91 |
92 | print(f"Selling {token_balance_decimal} tokens")
93 | print(f"Minimum SOL output: {min_sol_output / LAMPORTS_PER_SOL:.10f} SOL")
94 |
95 | for attempt in range(max_retries):
96 | try:
97 | accounts = [
98 | AccountMeta(pubkey=PUMP_GLOBAL, is_signer=False, is_writable=False),
99 | AccountMeta(pubkey=PUMP_FEE, is_signer=False, is_writable=True),
100 | AccountMeta(pubkey=mint, is_signer=False, is_writable=False),
101 | AccountMeta(pubkey=bonding_curve, is_signer=False, is_writable=True),
102 | AccountMeta(pubkey=associated_bonding_curve, is_signer=False, is_writable=True),
103 | AccountMeta(pubkey=associated_token_account, is_signer=False, is_writable=True),
104 | AccountMeta(pubkey=payer.pubkey(), is_signer=True, is_writable=True),
105 | AccountMeta(pubkey=SYSTEM_PROGRAM, is_signer=False, is_writable=False),
106 | AccountMeta(pubkey=SYSTEM_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM, is_signer=False, is_writable=False),
107 | AccountMeta(pubkey=SYSTEM_TOKEN_PROGRAM, is_signer=False, is_writable=False),
108 | AccountMeta(pubkey=PUMP_EVENT_AUTHORITY, is_signer=False, is_writable=False),
109 | AccountMeta(pubkey=PUMP_PROGRAM, is_signer=False, is_writable=False),
110 | ]
111 |
112 | discriminator = struct.pack("
2 |
3 | PumpTrader Bot is a tool for managing trading strategies, liquidity and monitoring tokens on the Solana blockchain.
4 |
5 | This bot is designed for token creators, liquidity pools and traders, providing a user-friendly interface for automating trading operations via Telegram.
6 |
7 | (The bot is available on macOS and windows)
8 |
9 | ## Release
10 | - [Windows x64](../../releases)
11 | - [Linux](../../releases)
12 |
13 | # Creation of "Pump" orders
14 | This feature automatically places token buy/sell orders to create visibility of activity on Pumpfun.
15 |
16 | Buying tokens in small batches.
17 |
18 | The frequency is set by the user.
19 |
20 | 
21 |
22 | ## How it works?
23 | User input:
24 |
25 | - Token: the address of the token on Solana.
26 |
27 | - Quantity: total number of tokens to be bought/sold.
28 |
29 | - Breakdown: the size of batches (for example, 10 purchases of 100 tokens each).
30 |
31 | - Time between orders: interval in seconds.
32 |
33 | - The bot is connected to DEX (e.g. Raydium) via RPC.
34 |
35 | Algorithm:
36 |
37 | - Checks the availability of liquidity in the pool.
38 |
39 | - Places a buy order.
40 |
41 | - Waits for a specified interval, repeats the process.
42 |
43 | - Notifies of completion via Telegram or log file.
44 |
45 | # Market-making(AMM)
46 | The bot maintains a narrow spread between buying and selling a token to increase liquidity and improve market behavior.
47 |
48 | ## How it works?
49 | User input:
50 |
51 | - Token.
52 |
53 | - Minimum spread (e.g. 1%).
54 |
55 | - Maximum trading volume for one cycle.
56 |
57 | ## Algorithm:
58 |
59 | - Analyzes the current price in the pool.
60 |
61 | - Places buy and sell orders taking into account the specified spread.
62 |
63 | - Monitors the execution of orders and corrects them.
64 |
65 | ## Notices:
66 | - The bot sends reports on liquidity maintenance.
67 | - Logs price and spread changes.
68 |
69 | # Antidamp protection
70 | This feature protects the token from a sharp drop in price by automatically placing protective orders.
71 |
72 | ## How it works?
73 | The user enters:
74 |
75 | - Token.
76 |
77 | - Minimum price.
78 |
79 | - Number of tokens to protect.
80 |
81 | ## Algorithm:
82 |
83 | - Continuously monitors the price of the token on DEX.
84 |
85 | - If the price falls below the minimum level:
86 | Automatically places a large buy order to stabilize the price.
87 |
88 | ## Notices:
89 | If the antidump feature is triggered, the bot sends a notification to Telegram.
90 |
91 | # Create and manage wallets:
92 |
93 | - Automatic creation of Solana wallets from main wallet.
94 |
95 | - Manage your balance and transactions with a command in Telegram.
96 |
97 | - Support for multiple wallets for different tasks.
98 |
99 | Bot wallets provide the following functionality:
100 |
101 | Creating wallets for transactions:
102 |
103 | Each wallet gets its own private and public key.
104 | Wallets can be used for token storage, liquidity transactions, or to participate in trading strategies.
105 |
106 | Wallet Management:
107 |
108 | Checking the balance for specified tokens.
109 | Transfer tokens between wallets.
110 | Setting up automatic transactions for strategies such as Pump or liquidity management.
111 |
112 | Liquidity integration:
113 |
114 | Using wallets to add liquidity to pools or to trade on DEX.
115 |
116 | # Trading Operations:
117 |
118 | - Placing pump orders to artificially increase the trading volume.
119 |
120 | - Real-time monitoring of token prices.
121 |
122 | - Integration with popular decentralized exchanges (DEX) on Solana.
123 |
124 | # Liquidity management:
125 | The bot allows you to automate the addition and withdrawal of liquidity from pools on DEX (e.g. Raydium, Orca).
126 |
127 | How it works?
128 | The user enters:
129 |
130 | - Token A and B: addresses of tokens in the pool.
131 |
132 | - Target balance: the number of tokens to be maintained in the pool.
133 |
134 | - Minimum reserve: limit for liquidity withdrawal.
135 |
136 | Algorithm:
137 |
138 | - Checks the current balance of tokens in the pool.
139 |
140 | - If there are not enough tokens, adds liquidity.
141 |
142 | - If there are too many tokens, withdraws some liquidity.
143 |
144 | Notices:
145 | Sends reports when there are significant changes in liquidity.
146 |
147 | - Automatic addition of liquidity to pools on DEX.
148 |
149 | - Balancing tokens in liquidity pools.
150 |
151 | # Mass transactions (drops)
152 | The feature allows mass distribution of tokens (airdrops) to users.
153 |
154 | How it works?
155 | The user uploads a CSV file with recipient addresses and number of tokens.
156 |
157 | Algorithm:
158 |
159 | - Checks if there are enough tokens on the wallet.
160 |
161 | - Splits transactions into batches to bypass network limits.
162 |
163 | - Signs and sends each transaction.
164 |
165 | Logs:
166 | Saves the results to a file (successful and unsuccessful sends).
167 |
168 | Notices:
169 | Sends the final report to Telegram.
170 |
171 | # Market monitoring
172 | The feature collects token data from Pumpfun and DEX to help the user keep track of market dynamics.
173 |
174 | How does it work?
175 | The bot connects to the Pumpfun and DEX APIs via RPC.
176 |
177 | It collects data:
178 |
179 | -Price, trading volume, liquidity.
180 | -Comparison with competitors.
181 |
182 | Notifications:
183 |
184 | -Sends pump/dump alerts.
185 | -Indicates key changes in the market.
186 |
187 | Conclusion:
188 |
189 | Data is displayed in a graphical interface.
190 |
191 | # Setting up scenarios
192 | The feature allows you to automate actions such as running pump, creating liquidity or drops on a schedule.
193 |
194 | How it works?
195 | The user creates a scenario:
196 |
197 | - Selects actions (e.g. “add liquidity”).
198 |
199 | - Specifies parameters and schedule.
200 |
201 | Algorithm:
202 |
203 | - Executes the script at the specified time.
204 | - Monitors successful execution.
205 |
206 | Notifications:
207 |
208 | Sends a report of each scenario execution.
209 |
210 | # Integration with Telegram
211 | The bot sends notifications and accepts commands via Telegram.
212 |
213 | How does it work?
214 | The user connects the bot to Telegram by entering the bot token.
215 |
216 | Notices:
217 |
218 | Important events (e.g., price drop, drop completion).
219 |
220 | Teams:
221 |
222 | '/status' — bot state.
223 |
224 | '/pause' — temporarily stopping all tasks.
225 |
226 | '/resume' — continued employment.
227 |
228 | '/report' — a report on the bot's actions.
229 |
230 | # Price monitoring:
231 |
232 | - Ongoing price tracking and notification of significant changes.
233 |
234 | - Setting up notifications via Telegram.
235 |
236 | ## RPCs and APIs used
237 |
238 | # Solana RPC:
239 |
240 | - Basic RPC: https://lb.drpc.org/ogrpc?network=solana&dkey=Arc_JqtwaUlmmje2rvgtJWyamxyDxxAR77DXIlZWwHzR (or other custom RPC just add from settings).
241 | Used for blockchain data, including token balances, transaction creation, and interaction with Solana programs.
242 |
243 | # API for price monitoring:
244 |
245 | - [CoinGecko API](https://www.coingecko.com/): To get current token prices.
246 |
247 | - [Serum DEX API](https://projectserum.com/): To get order stack data and interact with the exchange.
248 |
249 | # DEX Integration:
250 |
251 | - Raydium: For transactions with liquidity pools and token exchanges.
252 |
253 | - Orca: For token trading and liquidity management.
254 |
255 | - Jupiter Aggregator: To find the best prices among DEX.
256 |
257 | - Serum: For direct interaction with order stacks.
258 |
259 | ## How the bot uses DEX
260 |
261 | # Raydium:
262 |
263 | - Adding or withdrawing liquidity from pools.
264 |
265 | - Token trading through automated market makers (AMM).
266 |
267 | # Orca:
268 |
269 | - Simple and fast token trading.
270 |
271 | - Optimized transactions for low volumes.
272 |
273 | # Serum:
274 |
275 | - Token trading via order stacks.
276 |
277 | - Ideal for strategies that require direct price control.
278 |
279 | # Jupiter:
280 |
281 | - Price aggregation and transaction routing to minimize slippage.
282 |
283 | - Conveniently choose the best path for token exchange.
284 |
285 |
286 | ## How to connect a bot to Telegram
287 |
288 | # 1. Get a token for your bot
289 |
290 | 1. Open the Telegram app.
291 |
292 | 2. Find the BotFather bot (type @BotFather in the Telegram search box).
293 |
294 | 3. Send the '/start' command to start the interaction.
295 |
296 | 4. Create a new bot using the command '/newbot.'
297 |
298 | 5. Enter a name for the bot (e.g. PumpTraderBot).
299 |
300 | 6. Enter a unique username for the bot ending in bot (e.g. PumpTrader_PumpBot).
301 |
302 | 7. BotFather will generate an API token (for example: 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11).
303 |
304 | 8. Save this token, you will need it for customization.
305 |
306 | # 2. Configure the token in your code
307 |
308 | 1. Open the 'config.json' file in your bot's code directory.
309 |
310 | 2. Make sure it contains the following format:
311 |
312 | '{
313 | "telegram_token": "YOUR_TOKEN_FROM_BOTFATHER",
314 | "solana_rpc_url": "https://api.mainnet-beta.solana.com"
315 | }'
316 |
317 | 3. Replace 'YOUR_TOKEN_FROM_BOTFATHER' with the token provided by BotFather.
318 |
319 | 4. If you have your own RPC URL for Solana, replace https://api.mainnet-beta.solana.com.
320 |
321 | # 3. Start the bot
322 |
323 | 1. Make sure you have Python version 3.8 or higher installed.
324 |
325 | 2. Install the necessary libraries:
326 |
327 | 'pip install py-solana pyTelegramBotAPI'
328 |
329 | 3. Run the script:
330 |
331 | 'python your_bot_file.py'
332 |
333 | 4. Make sure that 'your_bot_file.py' replaced by the name of the bot code file.
334 |
335 | # 4. Check the bot's performance
336 |
337 | 1. In Telegram, search for your bot by username (e.g. @PumpTrader_PumpBot).
338 |
339 | 2. Send the command '/start'
340 |
341 | 3. Check the available commands with '/help'.
342 |
--------------------------------------------------------------------------------
/idl/pump_fun_idl.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.1.0",
3 | "name": "pump",
4 | "instructions": [
5 | {
6 | "name": "initialize",
7 | "docs": [
8 | "Creates the global state."
9 | ],
10 | "accounts": [
11 | {
12 | "name": "global",
13 | "isMut": true,
14 | "isSigner": false
15 | },
16 | {
17 | "name": "user",
18 | "isMut": true,
19 | "isSigner": true
20 | },
21 | {
22 | "name": "systemProgram",
23 | "isMut": false,
24 | "isSigner": false
25 | }
26 | ],
27 | "args": []
28 | },
29 | {
30 | "name": "setParams",
31 | "docs": [
32 | "Sets the global state parameters."
33 | ],
34 | "accounts": [
35 | {
36 | "name": "global",
37 | "isMut": true,
38 | "isSigner": false
39 | },
40 | {
41 | "name": "user",
42 | "isMut": true,
43 | "isSigner": true
44 | },
45 | {
46 | "name": "systemProgram",
47 | "isMut": false,
48 | "isSigner": false
49 | },
50 | {
51 | "name": "eventAuthority",
52 | "isMut": false,
53 | "isSigner": false
54 | },
55 | {
56 | "name": "program",
57 | "isMut": false,
58 | "isSigner": false
59 | }
60 | ],
61 | "args": [
62 | {
63 | "name": "feeRecipient",
64 | "type": "publicKey"
65 | },
66 | {
67 | "name": "initialVirtualTokenReserves",
68 | "type": "u64"
69 | },
70 | {
71 | "name": "initialVirtualSolReserves",
72 | "type": "u64"
73 | },
74 | {
75 | "name": "initialRealTokenReserves",
76 | "type": "u64"
77 | },
78 | {
79 | "name": "tokenTotalSupply",
80 | "type": "u64"
81 | },
82 | {
83 | "name": "feeBasisPoints",
84 | "type": "u64"
85 | }
86 | ]
87 | },
88 | {
89 | "name": "create",
90 | "docs": [
91 | "Creates a new coin and bonding curve."
92 | ],
93 | "accounts": [
94 | {
95 | "name": "mint",
96 | "isMut": true,
97 | "isSigner": true
98 | },
99 | {
100 | "name": "mintAuthority",
101 | "isMut": false,
102 | "isSigner": false
103 | },
104 | {
105 | "name": "bondingCurve",
106 | "isMut": true,
107 | "isSigner": false
108 | },
109 | {
110 | "name": "associatedBondingCurve",
111 | "isMut": true,
112 | "isSigner": false
113 | },
114 | {
115 | "name": "global",
116 | "isMut": false,
117 | "isSigner": false
118 | },
119 | {
120 | "name": "mplTokenMetadata",
121 | "isMut": false,
122 | "isSigner": false
123 | },
124 | {
125 | "name": "metadata",
126 | "isMut": true,
127 | "isSigner": false
128 | },
129 | {
130 | "name": "user",
131 | "isMut": true,
132 | "isSigner": true
133 | },
134 | {
135 | "name": "systemProgram",
136 | "isMut": false,
137 | "isSigner": false
138 | },
139 | {
140 | "name": "tokenProgram",
141 | "isMut": false,
142 | "isSigner": false
143 | },
144 | {
145 | "name": "associatedTokenProgram",
146 | "isMut": false,
147 | "isSigner": false
148 | },
149 | {
150 | "name": "rent",
151 | "isMut": false,
152 | "isSigner": false
153 | },
154 | {
155 | "name": "eventAuthority",
156 | "isMut": false,
157 | "isSigner": false
158 | },
159 | {
160 | "name": "program",
161 | "isMut": false,
162 | "isSigner": false
163 | }
164 | ],
165 | "args": [
166 | {
167 | "name": "name",
168 | "type": "string"
169 | },
170 | {
171 | "name": "symbol",
172 | "type": "string"
173 | },
174 | {
175 | "name": "uri",
176 | "type": "string"
177 | }
178 | ]
179 | },
180 | {
181 | "name": "buy",
182 | "docs": [
183 | "Buys tokens from a bonding curve."
184 | ],
185 | "accounts": [
186 | {
187 | "name": "global",
188 | "isMut": false,
189 | "isSigner": false
190 | },
191 | {
192 | "name": "feeRecipient",
193 | "isMut": true,
194 | "isSigner": false
195 | },
196 | {
197 | "name": "mint",
198 | "isMut": false,
199 | "isSigner": false
200 | },
201 | {
202 | "name": "bondingCurve",
203 | "isMut": true,
204 | "isSigner": false
205 | },
206 | {
207 | "name": "associatedBondingCurve",
208 | "isMut": true,
209 | "isSigner": false
210 | },
211 | {
212 | "name": "associatedUser",
213 | "isMut": true,
214 | "isSigner": false
215 | },
216 | {
217 | "name": "user",
218 | "isMut": true,
219 | "isSigner": true
220 | },
221 | {
222 | "name": "systemProgram",
223 | "isMut": false,
224 | "isSigner": false
225 | },
226 | {
227 | "name": "tokenProgram",
228 | "isMut": false,
229 | "isSigner": false
230 | },
231 | {
232 | "name": "rent",
233 | "isMut": false,
234 | "isSigner": false
235 | },
236 | {
237 | "name": "eventAuthority",
238 | "isMut": false,
239 | "isSigner": false
240 | },
241 | {
242 | "name": "program",
243 | "isMut": false,
244 | "isSigner": false
245 | }
246 | ],
247 | "args": [
248 | {
249 | "name": "amount",
250 | "type": "u64"
251 | },
252 | {
253 | "name": "maxSolCost",
254 | "type": "u64"
255 | }
256 | ]
257 | },
258 | {
259 | "name": "sell",
260 | "docs": [
261 | "Sells tokens into a bonding curve."
262 | ],
263 | "accounts": [
264 | {
265 | "name": "global",
266 | "isMut": false,
267 | "isSigner": false
268 | },
269 | {
270 | "name": "feeRecipient",
271 | "isMut": true,
272 | "isSigner": false
273 | },
274 | {
275 | "name": "mint",
276 | "isMut": false,
277 | "isSigner": false
278 | },
279 | {
280 | "name": "bondingCurve",
281 | "isMut": true,
282 | "isSigner": false
283 | },
284 | {
285 | "name": "associatedBondingCurve",
286 | "isMut": true,
287 | "isSigner": false
288 | },
289 | {
290 | "name": "associatedUser",
291 | "isMut": true,
292 | "isSigner": false
293 | },
294 | {
295 | "name": "user",
296 | "isMut": true,
297 | "isSigner": true
298 | },
299 | {
300 | "name": "systemProgram",
301 | "isMut": false,
302 | "isSigner": false
303 | },
304 | {
305 | "name": "associatedTokenProgram",
306 | "isMut": false,
307 | "isSigner": false
308 | },
309 | {
310 | "name": "tokenProgram",
311 | "isMut": false,
312 | "isSigner": false
313 | },
314 | {
315 | "name": "eventAuthority",
316 | "isMut": false,
317 | "isSigner": false
318 | },
319 | {
320 | "name": "program",
321 | "isMut": false,
322 | "isSigner": false
323 | }
324 | ],
325 | "args": [
326 | {
327 | "name": "amount",
328 | "type": "u64"
329 | },
330 | {
331 | "name": "minSolOutput",
332 | "type": "u64"
333 | }
334 | ]
335 | },
336 | {
337 | "name": "withdraw",
338 | "docs": [
339 | "Allows the admin to withdraw liquidity for a migration once the bonding curve completes"
340 | ],
341 | "accounts": [
342 | {
343 | "name": "global",
344 | "isMut": false,
345 | "isSigner": false
346 | },
347 | {
348 | "name": "mint",
349 | "isMut": false,
350 | "isSigner": false
351 | },
352 | {
353 | "name": "bondingCurve",
354 | "isMut": true,
355 | "isSigner": false
356 | },
357 | {
358 | "name": "associatedBondingCurve",
359 | "isMut": true,
360 | "isSigner": false
361 | },
362 | {
363 | "name": "associatedUser",
364 | "isMut": true,
365 | "isSigner": false
366 | },
367 | {
368 | "name": "user",
369 | "isMut": true,
370 | "isSigner": true
371 | },
372 | {
373 | "name": "systemProgram",
374 | "isMut": false,
375 | "isSigner": false
376 | },
377 | {
378 | "name": "tokenProgram",
379 | "isMut": false,
380 | "isSigner": false
381 | },
382 | {
383 | "name": "rent",
384 | "isMut": false,
385 | "isSigner": false
386 | },
387 | {
388 | "name": "eventAuthority",
389 | "isMut": false,
390 | "isSigner": false
391 | },
392 | {
393 | "name": "program",
394 | "isMut": false,
395 | "isSigner": false
396 | }
397 | ],
398 | "args": []
399 | }
400 | ],
401 | "accounts": [
402 | {
403 | "name": "Global",
404 | "type": {
405 | "kind": "struct",
406 | "fields": [
407 | {
408 | "name": "initialized",
409 | "type": "bool"
410 | },
411 | {
412 | "name": "authority",
413 | "type": "publicKey"
414 | },
415 | {
416 | "name": "feeRecipient",
417 | "type": "publicKey"
418 | },
419 | {
420 | "name": "initialVirtualTokenReserves",
421 | "type": "u64"
422 | },
423 | {
424 | "name": "initialVirtualSolReserves",
425 | "type": "u64"
426 | },
427 | {
428 | "name": "initialRealTokenReserves",
429 | "type": "u64"
430 | },
431 | {
432 | "name": "tokenTotalSupply",
433 | "type": "u64"
434 | },
435 | {
436 | "name": "feeBasisPoints",
437 | "type": "u64"
438 | }
439 | ]
440 | }
441 | },
442 | {
443 | "name": "BondingCurve",
444 | "type": {
445 | "kind": "struct",
446 | "fields": [
447 | {
448 | "name": "virtualTokenReserves",
449 | "type": "u64"
450 | },
451 | {
452 | "name": "virtualSolReserves",
453 | "type": "u64"
454 | },
455 | {
456 | "name": "realTokenReserves",
457 | "type": "u64"
458 | },
459 | {
460 | "name": "realSolReserves",
461 | "type": "u64"
462 | },
463 | {
464 | "name": "tokenTotalSupply",
465 | "type": "u64"
466 | },
467 | {
468 | "name": "complete",
469 | "type": "bool"
470 | }
471 | ]
472 | }
473 | }
474 | ],
475 | "events": [
476 | {
477 | "name": "CreateEvent",
478 | "fields": [
479 | {
480 | "name": "name",
481 | "type": "string",
482 | "index": false
483 | },
484 | {
485 | "name": "symbol",
486 | "type": "string",
487 | "index": false
488 | },
489 | {
490 | "name": "uri",
491 | "type": "string",
492 | "index": false
493 | },
494 | {
495 | "name": "mint",
496 | "type": "publicKey",
497 | "index": false
498 | },
499 | {
500 | "name": "bondingCurve",
501 | "type": "publicKey",
502 | "index": false
503 | },
504 | {
505 | "name": "user",
506 | "type": "publicKey",
507 | "index": false
508 | }
509 | ]
510 | },
511 | {
512 | "name": "TradeEvent",
513 | "fields": [
514 | {
515 | "name": "mint",
516 | "type": "publicKey",
517 | "index": false
518 | },
519 | {
520 | "name": "solAmount",
521 | "type": "u64",
522 | "index": false
523 | },
524 | {
525 | "name": "tokenAmount",
526 | "type": "u64",
527 | "index": false
528 | },
529 | {
530 | "name": "isBuy",
531 | "type": "bool",
532 | "index": false
533 | },
534 | {
535 | "name": "user",
536 | "type": "publicKey",
537 | "index": false
538 | },
539 | {
540 | "name": "timestamp",
541 | "type": "i64",
542 | "index": false
543 | },
544 | {
545 | "name": "virtualSolReserves",
546 | "type": "u64",
547 | "index": false
548 | },
549 | {
550 | "name": "virtualTokenReserves",
551 | "type": "u64",
552 | "index": false
553 | }
554 | ]
555 | },
556 | {
557 | "name": "CompleteEvent",
558 | "fields": [
559 | {
560 | "name": "user",
561 | "type": "publicKey",
562 | "index": false
563 | },
564 | {
565 | "name": "mint",
566 | "type": "publicKey",
567 | "index": false
568 | },
569 | {
570 | "name": "bondingCurve",
571 | "type": "publicKey",
572 | "index": false
573 | },
574 | {
575 | "name": "timestamp",
576 | "type": "i64",
577 | "index": false
578 | }
579 | ]
580 | },
581 | {
582 | "name": "SetParamsEvent",
583 | "fields": [
584 | {
585 | "name": "feeRecipient",
586 | "type": "publicKey",
587 | "index": false
588 | },
589 | {
590 | "name": "initialVirtualTokenReserves",
591 | "type": "u64",
592 | "index": false
593 | },
594 | {
595 | "name": "initialVirtualSolReserves",
596 | "type": "u64",
597 | "index": false
598 | },
599 | {
600 | "name": "initialRealTokenReserves",
601 | "type": "u64",
602 | "index": false
603 | },
604 | {
605 | "name": "tokenTotalSupply",
606 | "type": "u64",
607 | "index": false
608 | },
609 | {
610 | "name": "feeBasisPoints",
611 | "type": "u64",
612 | "index": false
613 | }
614 | ]
615 | }
616 | ],
617 | "errors": [
618 | {
619 | "code": 6000,
620 | "name": "NotAuthorized",
621 | "msg": "The given account is not authorized to execute this instruction."
622 | },
623 | {
624 | "code": 6001,
625 | "name": "AlreadyInitialized",
626 | "msg": "The program is already initialized."
627 | },
628 | {
629 | "code": 6002,
630 | "name": "TooMuchSolRequired",
631 | "msg": "slippage: Too much SOL required to buy the given amount of tokens."
632 | },
633 | {
634 | "code": 6003,
635 | "name": "TooLittleSolReceived",
636 | "msg": "slippage: Too little SOL received to sell the given amount of tokens."
637 | },
638 | {
639 | "code": 6004,
640 | "name": "MintDoesNotMatchBondingCurve",
641 | "msg": "The mint does not match the bonding curve."
642 | },
643 | {
644 | "code": 6005,
645 | "name": "BondingCurveComplete",
646 | "msg": "The bonding curve has completed and liquidity migrated to raydium."
647 | },
648 | {
649 | "code": 6006,
650 | "name": "BondingCurveNotComplete",
651 | "msg": "The bonding curve has not completed."
652 | },
653 | {
654 | "code": 6007,
655 | "name": "NotInitialized",
656 | "msg": "The program is not initialized."
657 | }
658 | ],
659 | "metadata": {
660 | "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
661 | }
662 | }
--------------------------------------------------------------------------------
/idl/raydium_amm_idl.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.3.0",
3 | "name": "raydium_amm",
4 | "instructions": [
5 | {
6 | "name": "initialize",
7 | "accounts": [
8 | {
9 | "name": "tokenProgram",
10 | "isMut": false,
11 | "isSigner": false
12 | },
13 | {
14 | "name": "systemProgram",
15 | "isMut": false,
16 | "isSigner": false
17 | },
18 | {
19 | "name": "rent",
20 | "isMut": false,
21 | "isSigner": false
22 | },
23 | {
24 | "name": "amm",
25 | "isMut": true,
26 | "isSigner": false
27 | },
28 | {
29 | "name": "ammAuthority",
30 | "isMut": false,
31 | "isSigner": false
32 | },
33 | {
34 | "name": "ammOpenOrders",
35 | "isMut": true,
36 | "isSigner": false
37 | },
38 | {
39 | "name": "lpMintAddress",
40 | "isMut": true,
41 | "isSigner": false
42 | },
43 | {
44 | "name": "coinMintAddress",
45 | "isMut": false,
46 | "isSigner": false
47 | },
48 | {
49 | "name": "pcMintAddress",
50 | "isMut": false,
51 | "isSigner": false
52 | },
53 | {
54 | "name": "poolCoinTokenAccount",
55 | "isMut": false,
56 | "isSigner": false
57 | },
58 | {
59 | "name": "poolPcTokenAccount",
60 | "isMut": false,
61 | "isSigner": false
62 | },
63 | {
64 | "name": "poolWithdrawQueue",
65 | "isMut": true,
66 | "isSigner": false
67 | },
68 | {
69 | "name": "poolTargetOrdersAccount",
70 | "isMut": true,
71 | "isSigner": false
72 | },
73 | {
74 | "name": "userLpTokenAccount",
75 | "isMut": true,
76 | "isSigner": false
77 | },
78 | {
79 | "name": "poolTempLpTokenAccount",
80 | "isMut": false,
81 | "isSigner": false
82 | },
83 | {
84 | "name": "serumProgram",
85 | "isMut": false,
86 | "isSigner": false
87 | },
88 | {
89 | "name": "serumMarket",
90 | "isMut": false,
91 | "isSigner": false
92 | },
93 | {
94 | "name": "userWallet",
95 | "isMut": true,
96 | "isSigner": true
97 | }
98 | ],
99 | "args": [
100 | {
101 | "name": "nonce",
102 | "type": "u8"
103 | },
104 | {
105 | "name": "openTime",
106 | "type": "u64"
107 | }
108 | ]
109 | },
110 | {
111 | "name": "initialize2",
112 | "accounts": [
113 | {
114 | "name": "tokenProgram",
115 | "isMut": false,
116 | "isSigner": false
117 | },
118 | {
119 | "name": "splAssociatedTokenAccount",
120 | "isMut": false,
121 | "isSigner": false
122 | },
123 | {
124 | "name": "systemProgram",
125 | "isMut": false,
126 | "isSigner": false
127 | },
128 | {
129 | "name": "rent",
130 | "isMut": false,
131 | "isSigner": false
132 | },
133 | {
134 | "name": "amm",
135 | "isMut": true,
136 | "isSigner": false
137 | },
138 | {
139 | "name": "ammAuthority",
140 | "isMut": false,
141 | "isSigner": false
142 | },
143 | {
144 | "name": "ammOpenOrders",
145 | "isMut": true,
146 | "isSigner": false
147 | },
148 | {
149 | "name": "lpMint",
150 | "isMut": true,
151 | "isSigner": false
152 | },
153 | {
154 | "name": "coinMint",
155 | "isMut": false,
156 | "isSigner": false
157 | },
158 | {
159 | "name": "pcMint",
160 | "isMut": false,
161 | "isSigner": false
162 | },
163 | {
164 | "name": "poolCoinTokenAccount",
165 | "isMut": true,
166 | "isSigner": false
167 | },
168 | {
169 | "name": "poolPcTokenAccount",
170 | "isMut": true,
171 | "isSigner": false
172 | },
173 | {
174 | "name": "poolWithdrawQueue",
175 | "isMut": true,
176 | "isSigner": false
177 | },
178 | {
179 | "name": "ammTargetOrders",
180 | "isMut": true,
181 | "isSigner": false
182 | },
183 | {
184 | "name": "poolTempLp",
185 | "isMut": true,
186 | "isSigner": false
187 | },
188 | {
189 | "name": "serumProgram",
190 | "isMut": false,
191 | "isSigner": false
192 | },
193 | {
194 | "name": "serumMarket",
195 | "isMut": false,
196 | "isSigner": false
197 | },
198 | {
199 | "name": "userWallet",
200 | "isMut": true,
201 | "isSigner": true
202 | },
203 | {
204 | "name": "userTokenCoin",
205 | "isMut": true,
206 | "isSigner": false
207 | },
208 | {
209 | "name": "userTokenPc",
210 | "isMut": true,
211 | "isSigner": false
212 | },
213 | {
214 | "name": "userLpTokenAccount",
215 | "isMut": true,
216 | "isSigner": false
217 | }
218 | ],
219 | "args": [
220 | {
221 | "name": "nonce",
222 | "type": "u8"
223 | },
224 | {
225 | "name": "openTime",
226 | "type": "u64"
227 | },
228 | {
229 | "name": "initPcAmount",
230 | "type": "u64"
231 | },
232 | {
233 | "name": "initCoinAmount",
234 | "type": "u64"
235 | }
236 | ]
237 | },
238 | {
239 | "name": "monitorStep",
240 | "accounts": [
241 | {
242 | "name": "tokenProgram",
243 | "isMut": false,
244 | "isSigner": false
245 | },
246 | {
247 | "name": "rent",
248 | "isMut": false,
249 | "isSigner": false
250 | },
251 | {
252 | "name": "clock",
253 | "isMut": false,
254 | "isSigner": false
255 | },
256 | {
257 | "name": "amm",
258 | "isMut": true,
259 | "isSigner": false
260 | },
261 | {
262 | "name": "ammAuthority",
263 | "isMut": false,
264 | "isSigner": false
265 | },
266 | {
267 | "name": "ammOpenOrders",
268 | "isMut": true,
269 | "isSigner": false
270 | },
271 | {
272 | "name": "ammTargetOrders",
273 | "isMut": true,
274 | "isSigner": false
275 | },
276 | {
277 | "name": "poolCoinTokenAccount",
278 | "isMut": true,
279 | "isSigner": false
280 | },
281 | {
282 | "name": "poolPcTokenAccount",
283 | "isMut": true,
284 | "isSigner": false
285 | },
286 | {
287 | "name": "poolWithdrawQueue",
288 | "isMut": true,
289 | "isSigner": false
290 | },
291 | {
292 | "name": "serumProgram",
293 | "isMut": false,
294 | "isSigner": false
295 | },
296 | {
297 | "name": "serumMarket",
298 | "isMut": true,
299 | "isSigner": false
300 | },
301 | {
302 | "name": "serumCoinVaultAccount",
303 | "isMut": true,
304 | "isSigner": false
305 | },
306 | {
307 | "name": "serumPcVaultAccount",
308 | "isMut": true,
309 | "isSigner": false
310 | },
311 | {
312 | "name": "serumVaultSigner",
313 | "isMut": false,
314 | "isSigner": false
315 | },
316 | {
317 | "name": "serumReqQ",
318 | "isMut": true,
319 | "isSigner": false
320 | },
321 | {
322 | "name": "serumEventQ",
323 | "isMut": true,
324 | "isSigner": false
325 | },
326 | {
327 | "name": "serumBids",
328 | "isMut": true,
329 | "isSigner": false
330 | },
331 | {
332 | "name": "serumAsks",
333 | "isMut": true,
334 | "isSigner": false
335 | }
336 | ],
337 | "args": [
338 | {
339 | "name": "planOrderLimit",
340 | "type": "u16"
341 | },
342 | {
343 | "name": "placeOrderLimit",
344 | "type": "u16"
345 | },
346 | {
347 | "name": "cancelOrderLimit",
348 | "type": "u16"
349 | }
350 | ]
351 | },
352 | {
353 | "name": "deposit",
354 | "accounts": [
355 | {
356 | "name": "tokenProgram",
357 | "isMut": false,
358 | "isSigner": false
359 | },
360 | {
361 | "name": "amm",
362 | "isMut": true,
363 | "isSigner": false
364 | },
365 | {
366 | "name": "ammAuthority",
367 | "isMut": false,
368 | "isSigner": false
369 | },
370 | {
371 | "name": "ammOpenOrders",
372 | "isMut": false,
373 | "isSigner": false
374 | },
375 | {
376 | "name": "ammTargetOrders",
377 | "isMut": true,
378 | "isSigner": false
379 | },
380 | {
381 | "name": "lpMintAddress",
382 | "isMut": true,
383 | "isSigner": false
384 | },
385 | {
386 | "name": "poolCoinTokenAccount",
387 | "isMut": true,
388 | "isSigner": false
389 | },
390 | {
391 | "name": "poolPcTokenAccount",
392 | "isMut": true,
393 | "isSigner": false
394 | },
395 | {
396 | "name": "serumMarket",
397 | "isMut": false,
398 | "isSigner": false
399 | },
400 | {
401 | "name": "userCoinTokenAccount",
402 | "isMut": true,
403 | "isSigner": false
404 | },
405 | {
406 | "name": "userPcTokenAccount",
407 | "isMut": true,
408 | "isSigner": false
409 | },
410 | {
411 | "name": "userLpTokenAccount",
412 | "isMut": true,
413 | "isSigner": false
414 | },
415 | {
416 | "name": "userOwner",
417 | "isMut": false,
418 | "isSigner": true
419 | },
420 | {
421 | "name": "serumEventQueue",
422 | "isMut": false,
423 | "isSigner": false
424 | }
425 | ],
426 | "args": [
427 | {
428 | "name": "maxCoinAmount",
429 | "type": "u64"
430 | },
431 | {
432 | "name": "maxPcAmount",
433 | "type": "u64"
434 | },
435 | {
436 | "name": "baseSide",
437 | "type": "u64"
438 | }
439 | ]
440 | },
441 | {
442 | "name": "withdraw",
443 | "accounts": [
444 | {
445 | "name": "tokenProgram",
446 | "isMut": false,
447 | "isSigner": false
448 | },
449 | {
450 | "name": "amm",
451 | "isMut": true,
452 | "isSigner": false
453 | },
454 | {
455 | "name": "ammAuthority",
456 | "isMut": false,
457 | "isSigner": false
458 | },
459 | {
460 | "name": "ammOpenOrders",
461 | "isMut": true,
462 | "isSigner": false
463 | },
464 | {
465 | "name": "ammTargetOrders",
466 | "isMut": true,
467 | "isSigner": false
468 | },
469 | {
470 | "name": "lpMintAddress",
471 | "isMut": true,
472 | "isSigner": false
473 | },
474 | {
475 | "name": "poolCoinTokenAccount",
476 | "isMut": true,
477 | "isSigner": false
478 | },
479 | {
480 | "name": "poolPcTokenAccount",
481 | "isMut": true,
482 | "isSigner": false
483 | },
484 | {
485 | "name": "poolWithdrawQueue",
486 | "isMut": true,
487 | "isSigner": false
488 | },
489 | {
490 | "name": "poolTempLpTokenAccount",
491 | "isMut": true,
492 | "isSigner": false
493 | },
494 | {
495 | "name": "serumProgram",
496 | "isMut": false,
497 | "isSigner": false
498 | },
499 | {
500 | "name": "serumMarket",
501 | "isMut": true,
502 | "isSigner": false
503 | },
504 | {
505 | "name": "serumCoinVaultAccount",
506 | "isMut": true,
507 | "isSigner": false
508 | },
509 | {
510 | "name": "serumPcVaultAccount",
511 | "isMut": true,
512 | "isSigner": false
513 | },
514 | {
515 | "name": "serumVaultSigner",
516 | "isMut": false,
517 | "isSigner": false
518 | },
519 | {
520 | "name": "userLpTokenAccount",
521 | "isMut": true,
522 | "isSigner": false
523 | },
524 | {
525 | "name": "uerCoinTokenAccount",
526 | "isMut": true,
527 | "isSigner": false
528 | },
529 | {
530 | "name": "uerPcTokenAccount",
531 | "isMut": true,
532 | "isSigner": false
533 | },
534 | {
535 | "name": "userOwner",
536 | "isMut": false,
537 | "isSigner": true
538 | },
539 | {
540 | "name": "serumEventQ",
541 | "isMut": true,
542 | "isSigner": false
543 | },
544 | {
545 | "name": "serumBids",
546 | "isMut": true,
547 | "isSigner": false
548 | },
549 | {
550 | "name": "serumAsks",
551 | "isMut": true,
552 | "isSigner": false
553 | }
554 | ],
555 | "args": [
556 | {
557 | "name": "amount",
558 | "type": "u64"
559 | }
560 | ]
561 | },
562 | {
563 | "name": "migrateToOpenBook",
564 | "accounts": [
565 | {
566 | "name": "tokenProgram",
567 | "isMut": false,
568 | "isSigner": false
569 | },
570 | {
571 | "name": "systemProgram",
572 | "isMut": false,
573 | "isSigner": false
574 | },
575 | {
576 | "name": "rent",
577 | "isMut": false,
578 | "isSigner": false
579 | },
580 | {
581 | "name": "amm",
582 | "isMut": true,
583 | "isSigner": false
584 | },
585 | {
586 | "name": "ammAuthority",
587 | "isMut": false,
588 | "isSigner": false
589 | },
590 | {
591 | "name": "ammOpenOrders",
592 | "isMut": true,
593 | "isSigner": false
594 | },
595 | {
596 | "name": "ammTokenCoin",
597 | "isMut": true,
598 | "isSigner": false
599 | },
600 | {
601 | "name": "ammTokenPc",
602 | "isMut": true,
603 | "isSigner": false
604 | },
605 | {
606 | "name": "ammTargetOrders",
607 | "isMut": true,
608 | "isSigner": false
609 | },
610 | {
611 | "name": "serumProgram",
612 | "isMut": false,
613 | "isSigner": false
614 | },
615 | {
616 | "name": "serumMarket",
617 | "isMut": true,
618 | "isSigner": false
619 | },
620 | {
621 | "name": "serumBids",
622 | "isMut": true,
623 | "isSigner": false
624 | },
625 | {
626 | "name": "serumAsks",
627 | "isMut": true,
628 | "isSigner": false
629 | },
630 | {
631 | "name": "serumEventQueue",
632 | "isMut": true,
633 | "isSigner": false
634 | },
635 | {
636 | "name": "serumCoinVault",
637 | "isMut": true,
638 | "isSigner": false
639 | },
640 | {
641 | "name": "serumPcVault",
642 | "isMut": true,
643 | "isSigner": false
644 | },
645 | {
646 | "name": "serumVaultSigner",
647 | "isMut": false,
648 | "isSigner": false
649 | },
650 | {
651 | "name": "newAmmOpenOrders",
652 | "isMut": true,
653 | "isSigner": false
654 | },
655 | {
656 | "name": "newSerumProgram",
657 | "isMut": false,
658 | "isSigner": false
659 | },
660 | {
661 | "name": "newSerumMarket",
662 | "isMut": false,
663 | "isSigner": false
664 | },
665 | {
666 | "name": "admin",
667 | "isMut": true,
668 | "isSigner": true
669 | }
670 | ],
671 | "args": []
672 | },
673 | {
674 | "name": "setParams",
675 | "accounts": [
676 | {
677 | "name": "tokenProgram",
678 | "isMut": false,
679 | "isSigner": false
680 | },
681 | {
682 | "name": "amm",
683 | "isMut": true,
684 | "isSigner": false
685 | },
686 | {
687 | "name": "ammAuthority",
688 | "isMut": false,
689 | "isSigner": false
690 | },
691 | {
692 | "name": "ammOpenOrders",
693 | "isMut": true,
694 | "isSigner": false
695 | },
696 | {
697 | "name": "ammTargetOrders",
698 | "isMut": true,
699 | "isSigner": false
700 | },
701 | {
702 | "name": "ammCoinVault",
703 | "isMut": true,
704 | "isSigner": false
705 | },
706 | {
707 | "name": "ammPcVault",
708 | "isMut": true,
709 | "isSigner": false
710 | },
711 | {
712 | "name": "serumProgram",
713 | "isMut": false,
714 | "isSigner": false
715 | },
716 | {
717 | "name": "serumMarket",
718 | "isMut": true,
719 | "isSigner": false
720 | },
721 | {
722 | "name": "serumCoinVault",
723 | "isMut": true,
724 | "isSigner": false
725 | },
726 | {
727 | "name": "serumPcVault",
728 | "isMut": true,
729 | "isSigner": false
730 | },
731 | {
732 | "name": "serumVaultSigner",
733 | "isMut": false,
734 | "isSigner": false
735 | },
736 | {
737 | "name": "serumEventQueue",
738 | "isMut": true,
739 | "isSigner": false
740 | },
741 | {
742 | "name": "serumBids",
743 | "isMut": true,
744 | "isSigner": false
745 | },
746 | {
747 | "name": "serumAsks",
748 | "isMut": true,
749 | "isSigner": false
750 | },
751 | {
752 | "name": "ammAdminAccount",
753 | "isMut": false,
754 | "isSigner": true
755 | }
756 | ],
757 | "args": [
758 | {
759 | "name": "param",
760 | "type": "u8"
761 | },
762 | {
763 | "name": "value",
764 | "type": {
765 | "option": "u64"
766 | }
767 | },
768 | {
769 | "name": "newPubkey",
770 | "type": {
771 | "option": "publicKey"
772 | }
773 | },
774 | {
775 | "name": "fees",
776 | "type": {
777 | "option": {
778 | "defined": "Fees"
779 | }
780 | }
781 | },
782 | {
783 | "name": "lastOrderDistance",
784 | "type": {
785 | "option": {
786 | "defined": "LastOrderDistance"
787 | }
788 | }
789 | },
790 | {
791 | "name": "needTakeAmounts",
792 | "type": {
793 | "option": {
794 | "defined": "NeedTake"
795 | }
796 | }
797 | }
798 | ]
799 | },
800 | {
801 | "name": "withdrawPnl",
802 | "accounts": [
803 | {
804 | "name": "tokenProgram",
805 | "isMut": false,
806 | "isSigner": false
807 | },
808 | {
809 | "name": "amm",
810 | "isMut": true,
811 | "isSigner": false
812 | },
813 | {
814 | "name": "ammConfig",
815 | "isMut": false,
816 | "isSigner": false
817 | },
818 | {
819 | "name": "ammAuthority",
820 | "isMut": false,
821 | "isSigner": false
822 | },
823 | {
824 | "name": "ammOpenOrders",
825 | "isMut": true,
826 | "isSigner": false
827 | },
828 | {
829 | "name": "poolCoinTokenAccount",
830 | "isMut": true,
831 | "isSigner": false
832 | },
833 | {
834 | "name": "poolPcTokenAccount",
835 | "isMut": true,
836 | "isSigner": false
837 | },
838 | {
839 | "name": "coinPnlTokenAccount",
840 | "isMut": true,
841 | "isSigner": false
842 | },
843 | {
844 | "name": "pcPnlTokenAccount",
845 | "isMut": true,
846 | "isSigner": false
847 | },
848 | {
849 | "name": "pnlOwnerAccount",
850 | "isMut": false,
851 | "isSigner": true
852 | },
853 | {
854 | "name": "ammTargetOrders",
855 | "isMut": true,
856 | "isSigner": false
857 | },
858 | {
859 | "name": "serumProgram",
860 | "isMut": false,
861 | "isSigner": false
862 | },
863 | {
864 | "name": "serumMarket",
865 | "isMut": true,
866 | "isSigner": false
867 | },
868 | {
869 | "name": "serumEventQueue",
870 | "isMut": false,
871 | "isSigner": false
872 | },
873 | {
874 | "name": "serumCoinVaultAccount",
875 | "isMut": true,
876 | "isSigner": false
877 | },
878 | {
879 | "name": "serumPcVaultAccount",
880 | "isMut": true,
881 | "isSigner": false
882 | },
883 | {
884 | "name": "serumVaultSigner",
885 | "isMut": false,
886 | "isSigner": false
887 | }
888 | ],
889 | "args": []
890 | },
891 | {
892 | "name": "withdrawSrm",
893 | "accounts": [
894 | {
895 | "name": "tokenProgram",
896 | "isMut": false,
897 | "isSigner": false
898 | },
899 | {
900 | "name": "amm",
901 | "isMut": false,
902 | "isSigner": false
903 | },
904 | {
905 | "name": "ammOwnerAccount",
906 | "isMut": false,
907 | "isSigner": true
908 | },
909 | {
910 | "name": "ammAuthority",
911 | "isMut": false,
912 | "isSigner": false
913 | },
914 | {
915 | "name": "srmToken",
916 | "isMut": true,
917 | "isSigner": false
918 | },
919 | {
920 | "name": "destSrmToken",
921 | "isMut": true,
922 | "isSigner": false
923 | }
924 | ],
925 | "args": [
926 | {
927 | "name": "amount",
928 | "type": "u64"
929 | }
930 | ]
931 | },
932 | {
933 | "name": "swapBaseIn",
934 | "accounts": [
935 | {
936 | "name": "tokenProgram",
937 | "isMut": false,
938 | "isSigner": false
939 | },
940 | {
941 | "name": "amm",
942 | "isMut": true,
943 | "isSigner": false
944 | },
945 | {
946 | "name": "ammAuthority",
947 | "isMut": false,
948 | "isSigner": false
949 | },
950 | {
951 | "name": "ammOpenOrders",
952 | "isMut": true,
953 | "isSigner": false
954 | },
955 | {
956 | "name": "ammTargetOrders",
957 | "isMut": true,
958 | "isSigner": false
959 | },
960 | {
961 | "name": "poolCoinTokenAccount",
962 | "isMut": true,
963 | "isSigner": false
964 | },
965 | {
966 | "name": "poolPcTokenAccount",
967 | "isMut": true,
968 | "isSigner": false
969 | },
970 | {
971 | "name": "serumProgram",
972 | "isMut": false,
973 | "isSigner": false
974 | },
975 | {
976 | "name": "serumMarket",
977 | "isMut": true,
978 | "isSigner": false
979 | },
980 | {
981 | "name": "serumBids",
982 | "isMut": true,
983 | "isSigner": false
984 | },
985 | {
986 | "name": "serumAsks",
987 | "isMut": true,
988 | "isSigner": false
989 | },
990 | {
991 | "name": "serumEventQueue",
992 | "isMut": true,
993 | "isSigner": false
994 | },
995 | {
996 | "name": "serumCoinVaultAccount",
997 | "isMut": true,
998 | "isSigner": false
999 | },
1000 | {
1001 | "name": "serumPcVaultAccount",
1002 | "isMut": true,
1003 | "isSigner": false
1004 | },
1005 | {
1006 | "name": "serumVaultSigner",
1007 | "isMut": false,
1008 | "isSigner": false
1009 | },
1010 | {
1011 | "name": "uerSourceTokenAccount",
1012 | "isMut": true,
1013 | "isSigner": false
1014 | },
1015 | {
1016 | "name": "uerDestinationTokenAccount",
1017 | "isMut": true,
1018 | "isSigner": false
1019 | },
1020 | {
1021 | "name": "userSourceOwner",
1022 | "isMut": false,
1023 | "isSigner": true
1024 | }
1025 | ],
1026 | "args": [
1027 | {
1028 | "name": "amountIn",
1029 | "type": "u64"
1030 | },
1031 | {
1032 | "name": "minimumAmountOut",
1033 | "type": "u64"
1034 | }
1035 | ]
1036 | },
1037 | {
1038 | "name": "preInitialize",
1039 | "accounts": [
1040 | {
1041 | "name": "tokenProgram",
1042 | "isMut": false,
1043 | "isSigner": false
1044 | },
1045 | {
1046 | "name": "systemProgram",
1047 | "isMut": false,
1048 | "isSigner": false
1049 | },
1050 | {
1051 | "name": "rent",
1052 | "isMut": false,
1053 | "isSigner": false
1054 | },
1055 | {
1056 | "name": "ammTargetOrders",
1057 | "isMut": true,
1058 | "isSigner": false
1059 | },
1060 | {
1061 | "name": "poolWithdrawQueue",
1062 | "isMut": true,
1063 | "isSigner": false
1064 | },
1065 | {
1066 | "name": "ammAuthority",
1067 | "isMut": false,
1068 | "isSigner": false
1069 | },
1070 | {
1071 | "name": "lpMintAddress",
1072 | "isMut": true,
1073 | "isSigner": false
1074 | },
1075 | {
1076 | "name": "coinMintAddress",
1077 | "isMut": false,
1078 | "isSigner": false
1079 | },
1080 | {
1081 | "name": "pcMintAddress",
1082 | "isMut": false,
1083 | "isSigner": false
1084 | },
1085 | {
1086 | "name": "poolCoinTokenAccount",
1087 | "isMut": true,
1088 | "isSigner": false
1089 | },
1090 | {
1091 | "name": "poolPcTokenAccount",
1092 | "isMut": true,
1093 | "isSigner": false
1094 | },
1095 | {
1096 | "name": "poolTempLpTokenAccount",
1097 | "isMut": true,
1098 | "isSigner": false
1099 | },
1100 | {
1101 | "name": "serumMarket",
1102 | "isMut": false,
1103 | "isSigner": false
1104 | },
1105 | {
1106 | "name": "userWallet",
1107 | "isMut": true,
1108 | "isSigner": true
1109 | }
1110 | ],
1111 | "args": [
1112 | {
1113 | "name": "nonce",
1114 | "type": "u8"
1115 | }
1116 | ]
1117 | },
1118 | {
1119 | "name": "swapBaseOut",
1120 | "accounts": [
1121 | {
1122 | "name": "tokenProgram",
1123 | "isMut": false,
1124 | "isSigner": false
1125 | },
1126 | {
1127 | "name": "amm",
1128 | "isMut": true,
1129 | "isSigner": false
1130 | },
1131 | {
1132 | "name": "ammAuthority",
1133 | "isMut": false,
1134 | "isSigner": false
1135 | },
1136 | {
1137 | "name": "ammOpenOrders",
1138 | "isMut": true,
1139 | "isSigner": false
1140 | },
1141 | {
1142 | "name": "ammTargetOrders",
1143 | "isMut": true,
1144 | "isSigner": false
1145 | },
1146 | {
1147 | "name": "poolCoinTokenAccount",
1148 | "isMut": true,
1149 | "isSigner": false
1150 | },
1151 | {
1152 | "name": "poolPcTokenAccount",
1153 | "isMut": true,
1154 | "isSigner": false
1155 | },
1156 | {
1157 | "name": "serumProgram",
1158 | "isMut": false,
1159 | "isSigner": false
1160 | },
1161 | {
1162 | "name": "serumMarket",
1163 | "isMut": true,
1164 | "isSigner": false
1165 | },
1166 | {
1167 | "name": "serumBids",
1168 | "isMut": true,
1169 | "isSigner": false
1170 | },
1171 | {
1172 | "name": "serumAsks",
1173 | "isMut": true,
1174 | "isSigner": false
1175 | },
1176 | {
1177 | "name": "serumEventQueue",
1178 | "isMut": true,
1179 | "isSigner": false
1180 | },
1181 | {
1182 | "name": "serumCoinVaultAccount",
1183 | "isMut": true,
1184 | "isSigner": false
1185 | },
1186 | {
1187 | "name": "serumPcVaultAccount",
1188 | "isMut": true,
1189 | "isSigner": false
1190 | },
1191 | {
1192 | "name": "serumVaultSigner",
1193 | "isMut": false,
1194 | "isSigner": false
1195 | },
1196 | {
1197 | "name": "uerSourceTokenAccount",
1198 | "isMut": true,
1199 | "isSigner": false
1200 | },
1201 | {
1202 | "name": "uerDestinationTokenAccount",
1203 | "isMut": true,
1204 | "isSigner": false
1205 | },
1206 | {
1207 | "name": "userSourceOwner",
1208 | "isMut": false,
1209 | "isSigner": true
1210 | }
1211 | ],
1212 | "args": [
1213 | {
1214 | "name": "maxAmountIn",
1215 | "type": "u64"
1216 | },
1217 | {
1218 | "name": "amountOut",
1219 | "type": "u64"
1220 | }
1221 | ]
1222 | },
1223 | {
1224 | "name": "simulateInfo",
1225 | "accounts": [
1226 | {
1227 | "name": "amm",
1228 | "isMut": false,
1229 | "isSigner": false
1230 | },
1231 | {
1232 | "name": "ammAuthority",
1233 | "isMut": false,
1234 | "isSigner": false
1235 | },
1236 | {
1237 | "name": "ammOpenOrders",
1238 | "isMut": false,
1239 | "isSigner": false
1240 | },
1241 | {
1242 | "name": "poolCoinTokenAccount",
1243 | "isMut": false,
1244 | "isSigner": false
1245 | },
1246 | {
1247 | "name": "poolPcTokenAccount",
1248 | "isMut": false,
1249 | "isSigner": false
1250 | },
1251 | {
1252 | "name": "lpMintAddress",
1253 | "isMut": false,
1254 | "isSigner": false
1255 | },
1256 | {
1257 | "name": "serumMarket",
1258 | "isMut": false,
1259 | "isSigner": false
1260 | },
1261 | {
1262 | "name": "serumEventQueue",
1263 | "isMut": false,
1264 | "isSigner": false
1265 | }
1266 | ],
1267 | "args": [
1268 | {
1269 | "name": "param",
1270 | "type": "u8"
1271 | },
1272 | {
1273 | "name": "swapBaseInValue",
1274 | "type": {
1275 | "option": {
1276 | "defined": "SwapInstructionBaseIn"
1277 | }
1278 | }
1279 | },
1280 | {
1281 | "name": "swapBaseOutValue",
1282 | "type": {
1283 | "option": {
1284 | "defined": "SwapInstructionBaseOut"
1285 | }
1286 | }
1287 | }
1288 | ]
1289 | },
1290 | {
1291 | "name": "adminCancelOrders",
1292 | "accounts": [
1293 | {
1294 | "name": "tokenProgram",
1295 | "isMut": false,
1296 | "isSigner": false
1297 | },
1298 | {
1299 | "name": "amm",
1300 | "isMut": false,
1301 | "isSigner": false
1302 | },
1303 | {
1304 | "name": "ammAuthority",
1305 | "isMut": false,
1306 | "isSigner": false
1307 | },
1308 | {
1309 | "name": "ammOpenOrders",
1310 | "isMut": true,
1311 | "isSigner": false
1312 | },
1313 | {
1314 | "name": "ammTargetOrders",
1315 | "isMut": true,
1316 | "isSigner": false
1317 | },
1318 | {
1319 | "name": "poolCoinTokenAccount",
1320 | "isMut": true,
1321 | "isSigner": false
1322 | },
1323 | {
1324 | "name": "poolPcTokenAccount",
1325 | "isMut": true,
1326 | "isSigner": false
1327 | },
1328 | {
1329 | "name": "ammOwnerAccount",
1330 | "isMut": false,
1331 | "isSigner": true
1332 | },
1333 | {
1334 | "name": "ammConfig",
1335 | "isMut": true,
1336 | "isSigner": false
1337 | },
1338 | {
1339 | "name": "serumProgram",
1340 | "isMut": false,
1341 | "isSigner": false
1342 | },
1343 | {
1344 | "name": "serumMarket",
1345 | "isMut": true,
1346 | "isSigner": false
1347 | },
1348 | {
1349 | "name": "serumCoinVaultAccount",
1350 | "isMut": true,
1351 | "isSigner": false
1352 | },
1353 | {
1354 | "name": "serumPcVaultAccount",
1355 | "isMut": true,
1356 | "isSigner": false
1357 | },
1358 | {
1359 | "name": "serumVaultSigner",
1360 | "isMut": false,
1361 | "isSigner": false
1362 | },
1363 | {
1364 | "name": "serumEventQ",
1365 | "isMut": true,
1366 | "isSigner": false
1367 | },
1368 | {
1369 | "name": "serumBids",
1370 | "isMut": true,
1371 | "isSigner": false
1372 | },
1373 | {
1374 | "name": "serumAsks",
1375 | "isMut": true,
1376 | "isSigner": false
1377 | }
1378 | ],
1379 | "args": [
1380 | {
1381 | "name": "limit",
1382 | "type": "u16"
1383 | }
1384 | ]
1385 | },
1386 | {
1387 | "name": "createConfigAccount",
1388 | "accounts": [
1389 | {
1390 | "name": "admin",
1391 | "isMut": true,
1392 | "isSigner": true
1393 | },
1394 | {
1395 | "name": "ammConfig",
1396 | "isMut": true,
1397 | "isSigner": false
1398 | },
1399 | {
1400 | "name": "owner",
1401 | "isMut": false,
1402 | "isSigner": false
1403 | },
1404 | {
1405 | "name": "systemProgram",
1406 | "isMut": false,
1407 | "isSigner": false
1408 | },
1409 | {
1410 | "name": "rent",
1411 | "isMut": false,
1412 | "isSigner": false
1413 | }
1414 | ],
1415 | "args": []
1416 | },
1417 | {
1418 | "name": "updateConfigAccount",
1419 | "accounts": [
1420 | {
1421 | "name": "admin",
1422 | "isMut": false,
1423 | "isSigner": true
1424 | },
1425 | {
1426 | "name": "ammConfig",
1427 | "isMut": true,
1428 | "isSigner": false
1429 | }
1430 | ],
1431 | "args": [
1432 | {
1433 | "name": "param",
1434 | "type": "u8"
1435 | },
1436 | {
1437 | "name": "owner",
1438 | "type": "publicKey"
1439 | }
1440 | ]
1441 | }
1442 | ],
1443 | "accounts": [
1444 | {
1445 | "name": "TargetOrders",
1446 | "type": {
1447 | "kind": "struct",
1448 | "fields": [
1449 | {
1450 | "name": "owner",
1451 | "type": {
1452 | "array": [
1453 | "u64",
1454 | 4
1455 | ]
1456 | }
1457 | },
1458 | {
1459 | "name": "buyOrders",
1460 | "type": {
1461 | "array": [
1462 | {
1463 | "defined": "TargetOrder"
1464 | },
1465 | 50
1466 | ]
1467 | }
1468 | },
1469 | {
1470 | "name": "padding1",
1471 | "type": {
1472 | "array": [
1473 | "u64",
1474 | 8
1475 | ]
1476 | }
1477 | },
1478 | {
1479 | "name": "targetX",
1480 | "type": "u128"
1481 | },
1482 | {
1483 | "name": "targetY",
1484 | "type": "u128"
1485 | },
1486 | {
1487 | "name": "planXBuy",
1488 | "type": "u128"
1489 | },
1490 | {
1491 | "name": "planYBuy",
1492 | "type": "u128"
1493 | },
1494 | {
1495 | "name": "planXSell",
1496 | "type": "u128"
1497 | },
1498 | {
1499 | "name": "planYSell",
1500 | "type": "u128"
1501 | },
1502 | {
1503 | "name": "placedX",
1504 | "type": "u128"
1505 | },
1506 | {
1507 | "name": "placedY",
1508 | "type": "u128"
1509 | },
1510 | {
1511 | "name": "calcPnlX",
1512 | "type": "u128"
1513 | },
1514 | {
1515 | "name": "calcPnlY",
1516 | "type": "u128"
1517 | },
1518 | {
1519 | "name": "sellOrders",
1520 | "type": {
1521 | "array": [
1522 | {
1523 | "defined": "TargetOrder"
1524 | },
1525 | 50
1526 | ]
1527 | }
1528 | },
1529 | {
1530 | "name": "padding2",
1531 | "type": {
1532 | "array": [
1533 | "u64",
1534 | 6
1535 | ]
1536 | }
1537 | },
1538 | {
1539 | "name": "replaceBuyClientId",
1540 | "type": {
1541 | "array": [
1542 | "u64",
1543 | 10
1544 | ]
1545 | }
1546 | },
1547 | {
1548 | "name": "replaceSellClientId",
1549 | "type": {
1550 | "array": [
1551 | "u64",
1552 | 10
1553 | ]
1554 | }
1555 | },
1556 | {
1557 | "name": "lastOrderNumerator",
1558 | "type": "u64"
1559 | },
1560 | {
1561 | "name": "lastOrderDenominator",
1562 | "type": "u64"
1563 | },
1564 | {
1565 | "name": "planOrdersCur",
1566 | "type": "u64"
1567 | },
1568 | {
1569 | "name": "placeOrdersCur",
1570 | "type": "u64"
1571 | },
1572 | {
1573 | "name": "validBuyOrderNum",
1574 | "type": "u64"
1575 | },
1576 | {
1577 | "name": "validSellOrderNum",
1578 | "type": "u64"
1579 | },
1580 | {
1581 | "name": "padding3",
1582 | "type": {
1583 | "array": [
1584 | "u64",
1585 | 10
1586 | ]
1587 | }
1588 | },
1589 | {
1590 | "name": "freeSlotBits",
1591 | "type": "u128"
1592 | }
1593 | ]
1594 | }
1595 | },
1596 | {
1597 | "name": "Fees",
1598 | "type": {
1599 | "kind": "struct",
1600 | "fields": [
1601 | {
1602 | "name": "minSeparateNumerator",
1603 | "type": "u64"
1604 | },
1605 | {
1606 | "name": "minSeparateDenominator",
1607 | "type": "u64"
1608 | },
1609 | {
1610 | "name": "tradeFeeNumerator",
1611 | "type": "u64"
1612 | },
1613 | {
1614 | "name": "tradeFeeDenominator",
1615 | "type": "u64"
1616 | },
1617 | {
1618 | "name": "pnlNumerator",
1619 | "type": "u64"
1620 | },
1621 | {
1622 | "name": "pnlDenominator",
1623 | "type": "u64"
1624 | },
1625 | {
1626 | "name": "swapFeeNumerator",
1627 | "type": "u64"
1628 | },
1629 | {
1630 | "name": "swapFeeDenominator",
1631 | "type": "u64"
1632 | }
1633 | ]
1634 | }
1635 | },
1636 | {
1637 | "name": "AmmInfo",
1638 | "type": {
1639 | "kind": "struct",
1640 | "fields": [
1641 | {
1642 | "name": "status",
1643 | "type": "u64"
1644 | },
1645 | {
1646 | "name": "nonce",
1647 | "type": "u64"
1648 | },
1649 | {
1650 | "name": "orderNum",
1651 | "type": "u64"
1652 | },
1653 | {
1654 | "name": "depth",
1655 | "type": "u64"
1656 | },
1657 | {
1658 | "name": "coinDecimals",
1659 | "type": "u64"
1660 | },
1661 | {
1662 | "name": "pcDecimals",
1663 | "type": "u64"
1664 | },
1665 | {
1666 | "name": "state",
1667 | "type": "u64"
1668 | },
1669 | {
1670 | "name": "resetFlag",
1671 | "type": "u64"
1672 | },
1673 | {
1674 | "name": "minSize",
1675 | "type": "u64"
1676 | },
1677 | {
1678 | "name": "volMaxCutRatio",
1679 | "type": "u64"
1680 | },
1681 | {
1682 | "name": "amountWave",
1683 | "type": "u64"
1684 | },
1685 | {
1686 | "name": "coinLotSize",
1687 | "type": "u64"
1688 | },
1689 | {
1690 | "name": "pcLotSize",
1691 | "type": "u64"
1692 | },
1693 | {
1694 | "name": "minPriceMultiplier",
1695 | "type": "u64"
1696 | },
1697 | {
1698 | "name": "maxPriceMultiplier",
1699 | "type": "u64"
1700 | },
1701 | {
1702 | "name": "sysDecimalValue",
1703 | "type": "u64"
1704 | },
1705 | {
1706 | "name": "fees",
1707 | "type": {
1708 | "defined": "Fees"
1709 | }
1710 | },
1711 | {
1712 | "name": "outPut",
1713 | "type": {
1714 | "defined": "OutPutData"
1715 | }
1716 | },
1717 | {
1718 | "name": "tokenCoin",
1719 | "type": "publicKey"
1720 | },
1721 | {
1722 | "name": "tokenPc",
1723 | "type": "publicKey"
1724 | },
1725 | {
1726 | "name": "coinMint",
1727 | "type": "publicKey"
1728 | },
1729 | {
1730 | "name": "pcMint",
1731 | "type": "publicKey"
1732 | },
1733 | {
1734 | "name": "lpMint",
1735 | "type": "publicKey"
1736 | },
1737 | {
1738 | "name": "openOrders",
1739 | "type": "publicKey"
1740 | },
1741 | {
1742 | "name": "market",
1743 | "type": "publicKey"
1744 | },
1745 | {
1746 | "name": "serumDex",
1747 | "type": "publicKey"
1748 | },
1749 | {
1750 | "name": "targetOrders",
1751 | "type": "publicKey"
1752 | },
1753 | {
1754 | "name": "withdrawQueue",
1755 | "type": "publicKey"
1756 | },
1757 | {
1758 | "name": "tokenTempLp",
1759 | "type": "publicKey"
1760 | },
1761 | {
1762 | "name": "ammOwner",
1763 | "type": "publicKey"
1764 | },
1765 | {
1766 | "name": "lpAmount",
1767 | "type": "u64"
1768 | },
1769 | {
1770 | "name": "clientOrderId",
1771 | "type": "u64"
1772 | },
1773 | {
1774 | "name": "padding",
1775 | "type": {
1776 | "array": [
1777 | "u64",
1778 | 2
1779 | ]
1780 | }
1781 | }
1782 | ]
1783 | }
1784 | }
1785 | ],
1786 | "types": [
1787 | {
1788 | "name": "WithdrawDestToken",
1789 | "type": {
1790 | "kind": "struct",
1791 | "fields": [
1792 | {
1793 | "name": "withdrawAmount",
1794 | "type": "u64"
1795 | },
1796 | {
1797 | "name": "coinAmount",
1798 | "type": "u64"
1799 | },
1800 | {
1801 | "name": "pcAmount",
1802 | "type": "u64"
1803 | },
1804 | {
1805 | "name": "destTokenCoin",
1806 | "type": "publicKey"
1807 | },
1808 | {
1809 | "name": "destTokenPc",
1810 | "type": "publicKey"
1811 | }
1812 | ]
1813 | }
1814 | },
1815 | {
1816 | "name": "WithdrawQueue",
1817 | "type": {
1818 | "kind": "struct",
1819 | "fields": [
1820 | {
1821 | "name": "owner",
1822 | "type": {
1823 | "array": [
1824 | "u64",
1825 | 4
1826 | ]
1827 | }
1828 | },
1829 | {
1830 | "name": "head",
1831 | "type": "u64"
1832 | },
1833 | {
1834 | "name": "count",
1835 | "type": "u64"
1836 | },
1837 | {
1838 | "name": "buf",
1839 | "type": {
1840 | "array": [
1841 | {
1842 | "defined": "WithdrawDestToken"
1843 | },
1844 | 64
1845 | ]
1846 | }
1847 | }
1848 | ]
1849 | }
1850 | },
1851 | {
1852 | "name": "TargetOrder",
1853 | "type": {
1854 | "kind": "struct",
1855 | "fields": [
1856 | {
1857 | "name": "price",
1858 | "type": "u64"
1859 | },
1860 | {
1861 | "name": "vol",
1862 | "type": "u64"
1863 | }
1864 | ]
1865 | }
1866 | },
1867 | {
1868 | "name": "OutPutData",
1869 | "type": {
1870 | "kind": "struct",
1871 | "fields": [
1872 | {
1873 | "name": "needTakePnlCoin",
1874 | "type": "u64"
1875 | },
1876 | {
1877 | "name": "needTakePnlPc",
1878 | "type": "u64"
1879 | },
1880 | {
1881 | "name": "totalPnlPc",
1882 | "type": "u64"
1883 | },
1884 | {
1885 | "name": "totalPnlCoin",
1886 | "type": "u64"
1887 | },
1888 | {
1889 | "name": "poolOpenTime",
1890 | "type": "u64"
1891 | },
1892 | {
1893 | "name": "punishPcAmount",
1894 | "type": "u64"
1895 | },
1896 | {
1897 | "name": "punishCoinAmount",
1898 | "type": "u64"
1899 | },
1900 | {
1901 | "name": "orderbookToInitTime",
1902 | "type": "u64"
1903 | },
1904 | {
1905 | "name": "swapCoinInAmount",
1906 | "type": "u128"
1907 | },
1908 | {
1909 | "name": "swapPcOutAmount",
1910 | "type": "u128"
1911 | },
1912 | {
1913 | "name": "swapTakePcFee",
1914 | "type": "u64"
1915 | },
1916 | {
1917 | "name": "swapPcInAmount",
1918 | "type": "u128"
1919 | },
1920 | {
1921 | "name": "swapCoinOutAmount",
1922 | "type": "u128"
1923 | },
1924 | {
1925 | "name": "swapTakeCoinFee",
1926 | "type": "u64"
1927 | }
1928 | ]
1929 | }
1930 | },
1931 | {
1932 | "name": "AmmConfig",
1933 | "type": {
1934 | "kind": "struct",
1935 | "fields": [
1936 | {
1937 | "name": "pnlOwner",
1938 | "type": "publicKey"
1939 | },
1940 | {
1941 | "name": "cancelOwner",
1942 | "type": "publicKey"
1943 | },
1944 | {
1945 | "name": "pending1",
1946 | "type": {
1947 | "array": [
1948 | "u64",
1949 | 28
1950 | ]
1951 | }
1952 | },
1953 | {
1954 | "name": "pending2",
1955 | "type": {
1956 | "array": [
1957 | "u64",
1958 | 32
1959 | ]
1960 | }
1961 | }
1962 | ]
1963 | }
1964 | },
1965 | {
1966 | "name": "LastOrderDistance",
1967 | "type": {
1968 | "kind": "struct",
1969 | "fields": [
1970 | {
1971 | "name": "lastOrderNumerator",
1972 | "type": "u64"
1973 | },
1974 | {
1975 | "name": "lastOrderDenominator",
1976 | "type": "u64"
1977 | }
1978 | ]
1979 | }
1980 | },
1981 | {
1982 | "name": "NeedTake",
1983 | "type": {
1984 | "kind": "struct",
1985 | "fields": [
1986 | {
1987 | "name": "needTakePc",
1988 | "type": "u64"
1989 | },
1990 | {
1991 | "name": "needTakeCoin",
1992 | "type": "u64"
1993 | }
1994 | ]
1995 | }
1996 | },
1997 | {
1998 | "name": "SwapInstructionBaseIn",
1999 | "type": {
2000 | "kind": "struct",
2001 | "fields": [
2002 | {
2003 | "name": "amountIn",
2004 | "type": "u64"
2005 | },
2006 | {
2007 | "name": "minimumAmountOut",
2008 | "type": "u64"
2009 | }
2010 | ]
2011 | }
2012 | },
2013 | {
2014 | "name": "SwapInstructionBaseOut",
2015 | "type": {
2016 | "kind": "struct",
2017 | "fields": [
2018 | {
2019 | "name": "maxAmountIn",
2020 | "type": "u64"
2021 | },
2022 | {
2023 | "name": "amountOut",
2024 | "type": "u64"
2025 | }
2026 | ]
2027 | }
2028 | }
2029 | ],
2030 | "errors": [
2031 | {
2032 | "code": 0,
2033 | "name": "AlreadyInUse",
2034 | "msg": "AlreadyInUse"
2035 | },
2036 | {
2037 | "code": 1,
2038 | "name": "InvalidProgramAddress",
2039 | "msg": "InvalidProgramAddress"
2040 | },
2041 | {
2042 | "code": 2,
2043 | "name": "ExpectedMint",
2044 | "msg": "ExpectedMint"
2045 | },
2046 | {
2047 | "code": 3,
2048 | "name": "ExpectedAccount",
2049 | "msg": "ExpectedAccount"
2050 | },
2051 | {
2052 | "code": 4,
2053 | "name": "InvalidCoinVault",
2054 | "msg": "InvalidCoinVault"
2055 | },
2056 | {
2057 | "code": 5,
2058 | "name": "InvalidPCVault",
2059 | "msg": "InvalidPCVault"
2060 | },
2061 | {
2062 | "code": 6,
2063 | "name": "InvalidTokenLP",
2064 | "msg": "InvalidTokenLP"
2065 | },
2066 | {
2067 | "code": 7,
2068 | "name": "InvalidDestTokenCoin",
2069 | "msg": "InvalidDestTokenCoin"
2070 | },
2071 | {
2072 | "code": 8,
2073 | "name": "InvalidDestTokenPC",
2074 | "msg": "InvalidDestTokenPC"
2075 | },
2076 | {
2077 | "code": 9,
2078 | "name": "InvalidPoolMint",
2079 | "msg": "InvalidPoolMint"
2080 | },
2081 | {
2082 | "code": 10,
2083 | "name": "InvalidOpenOrders",
2084 | "msg": "InvalidOpenOrders"
2085 | },
2086 | {
2087 | "code": 11,
2088 | "name": "InvalidSerumMarket",
2089 | "msg": "InvalidSerumMarket"
2090 | },
2091 | {
2092 | "code": 12,
2093 | "name": "InvalidSerumProgram",
2094 | "msg": "InvalidSerumProgram"
2095 | },
2096 | {
2097 | "code": 13,
2098 | "name": "InvalidTargetOrders",
2099 | "msg": "InvalidTargetOrders"
2100 | },
2101 | {
2102 | "code": 14,
2103 | "name": "InvalidWithdrawQueue",
2104 | "msg": "InvalidWithdrawQueue"
2105 | },
2106 | {
2107 | "code": 15,
2108 | "name": "InvalidTempLp",
2109 | "msg": "InvalidTempLp"
2110 | },
2111 | {
2112 | "code": 16,
2113 | "name": "InvalidCoinMint",
2114 | "msg": "InvalidCoinMint"
2115 | },
2116 | {
2117 | "code": 17,
2118 | "name": "InvalidPCMint",
2119 | "msg": "InvalidPCMint"
2120 | },
2121 | {
2122 | "code": 18,
2123 | "name": "InvalidOwner",
2124 | "msg": "InvalidOwner"
2125 | },
2126 | {
2127 | "code": 19,
2128 | "name": "InvalidSupply",
2129 | "msg": "InvalidSupply"
2130 | },
2131 | {
2132 | "code": 20,
2133 | "name": "InvalidDelegate",
2134 | "msg": "InvalidDelegate"
2135 | },
2136 | {
2137 | "code": 21,
2138 | "name": "InvalidSignAccount",
2139 | "msg": "Invalid Sign Account"
2140 | },
2141 | {
2142 | "code": 22,
2143 | "name": "InvalidStatus",
2144 | "msg": "InvalidStatus"
2145 | },
2146 | {
2147 | "code": 23,
2148 | "name": "InvalidInstruction",
2149 | "msg": "Invalid instruction"
2150 | },
2151 | {
2152 | "code": 24,
2153 | "name": "WrongAccountsNumber",
2154 | "msg": "Wrong accounts number"
2155 | },
2156 | {
2157 | "code": 25,
2158 | "name": "WithdrawTransferBusy",
2159 | "msg": "Withdraw_transfer is busy"
2160 | },
2161 | {
2162 | "code": 26,
2163 | "name": "WithdrawQueueFull",
2164 | "msg": "WithdrawQueue is full"
2165 | },
2166 | {
2167 | "code": 27,
2168 | "name": "WithdrawQueueEmpty",
2169 | "msg": "WithdrawQueue is empty"
2170 | },
2171 | {
2172 | "code": 28,
2173 | "name": "InvalidParamsSet",
2174 | "msg": "Params Set is invalid"
2175 | },
2176 | {
2177 | "code": 29,
2178 | "name": "InvalidInput",
2179 | "msg": "InvalidInput"
2180 | },
2181 | {
2182 | "code": 30,
2183 | "name": "ExceededSlippage",
2184 | "msg": "instruction exceeds desired slippage limit"
2185 | },
2186 | {
2187 | "code": 31,
2188 | "name": "CalculationExRateFailure",
2189 | "msg": "CalculationExRateFailure"
2190 | },
2191 | {
2192 | "code": 32,
2193 | "name": "CheckedSubOverflow",
2194 | "msg": "Checked_Sub Overflow"
2195 | },
2196 | {
2197 | "code": 33,
2198 | "name": "CheckedAddOverflow",
2199 | "msg": "Checked_Add Overflow"
2200 | },
2201 | {
2202 | "code": 34,
2203 | "name": "CheckedMulOverflow",
2204 | "msg": "Checked_Mul Overflow"
2205 | },
2206 | {
2207 | "code": 35,
2208 | "name": "CheckedDivOverflow",
2209 | "msg": "Checked_Div Overflow"
2210 | },
2211 | {
2212 | "code": 36,
2213 | "name": "CheckedEmptyFunds",
2214 | "msg": "Empty Funds"
2215 | },
2216 | {
2217 | "code": 37,
2218 | "name": "CalcPnlError",
2219 | "msg": "Calc pnl error"
2220 | },
2221 | {
2222 | "code": 38,
2223 | "name": "InvalidSplTokenProgram",
2224 | "msg": "InvalidSplTokenProgram"
2225 | },
2226 | {
2227 | "code": 39,
2228 | "name": "TakePnlError",
2229 | "msg": "Take Pnl error"
2230 | },
2231 | {
2232 | "code": 40,
2233 | "name": "InsufficientFunds",
2234 | "msg": "Insufficient funds"
2235 | },
2236 | {
2237 | "code": 41,
2238 | "name": "ConversionFailure",
2239 | "msg": "Conversion to u64 failed with an overflow or underflow"
2240 | },
2241 | {
2242 | "code": 42,
2243 | "name": "InvalidUserToken",
2244 | "msg": "user token input does not match amm"
2245 | },
2246 | {
2247 | "code": 43,
2248 | "name": "InvalidSrmMint",
2249 | "msg": "InvalidSrmMint"
2250 | },
2251 | {
2252 | "code": 44,
2253 | "name": "InvalidSrmToken",
2254 | "msg": "InvalidSrmToken"
2255 | },
2256 | {
2257 | "code": 45,
2258 | "name": "TooManyOpenOrders",
2259 | "msg": "TooManyOpenOrders"
2260 | },
2261 | {
2262 | "code": 46,
2263 | "name": "OrderAtSlotIsPlaced",
2264 | "msg": "OrderAtSlotIsPlaced"
2265 | },
2266 | {
2267 | "code": 47,
2268 | "name": "InvalidSysProgramAddress",
2269 | "msg": "InvalidSysProgramAddress"
2270 | },
2271 | {
2272 | "code": 48,
2273 | "name": "InvalidFee",
2274 | "msg": "The provided fee does not match the program owner's constraints"
2275 | },
2276 | {
2277 | "code": 49,
2278 | "name": "RepeatCreateAmm",
2279 | "msg": "Repeat create amm about market"
2280 | },
2281 | {
2282 | "code": 50,
2283 | "name": "NotAllowZeroLP",
2284 | "msg": "Not allow Zero LP"
2285 | },
2286 | {
2287 | "code": 51,
2288 | "name": "InvalidCloseAuthority",
2289 | "msg": "Token account has a close authority"
2290 | },
2291 | {
2292 | "code": 52,
2293 | "name": "InvalidFreezeAuthority",
2294 | "msg": "Pool token mint has a freeze authority"
2295 | },
2296 | {
2297 | "code": 53,
2298 | "name": "InvalidReferPCMint",
2299 | "msg": "InvalidReferPCMint"
2300 | },
2301 | {
2302 | "code": 54,
2303 | "name": "InvalidConfigAccount",
2304 | "msg": "InvalidConfigAccount"
2305 | },
2306 | {
2307 | "code": 55,
2308 | "name": "RepeatCreateConfigAccount",
2309 | "msg": "Repeat create staking config account"
2310 | },
2311 | {
2312 | "code": 56,
2313 | "name": "UnknownAmmError",
2314 | "msg": "Unknown Amm Error"
2315 | }
2316 | ]
2317 | }
--------------------------------------------------------------------------------