📝0.3.x Bot configurations
The bot uses config.yaml
file to load all the configurations.
Different configuration can greatly impact your profitability using the bot. Tweak it based on your own setup. Join our discord to learn more.
You can also refer the config examples as a starting point to tweak for your own config.
📚Config examplesIf a config does not exist in your config.yaml file, just refer to config.yaml.example and add the ones you are missing.
Example config.yaml
KEYS
This section contains configurations like private keys, api keys.
PRIVATE_KEY
Private key for your wallet. All formats are supported, you can export from Phantom/Solflare or just use a json file path. The wallet needs to hold enough SOL/WSOL/USDC for your configuration.
BIRDEYE_API_KEY
The API key used to pull top mints from Birdeye. By default a shared key is used for all users, but that can run out of credit very soon. If you restart a lot and fetch a lot of tokens from birdeye, you should set your own here. Follow this instruction to do it: https://docs.birdeye.so/docs/birdeye-data-services-bds
HELIUS_API_KEY
This is used for fetching lated priority fee. You can get one for free by register an account on https://www.helius.dev/.
YELLOWSTONE
Yellowstone is optional, but having it can greatly reduce your RPC calls and increase the number of mints you can have with Jupiter.
YELLOWSTONE_URL
If present, JupV6 API will use it, otherwise JupV6 will be running in pull mode, which is very heavy on the read RPC.
YELLOWSTONE_XTOKEN
If your yellowstone provider also provides you an x token set it here.
JUPITER
When running the bot with JUPITER_URL=http://0.0.0.0:18080
, the bot will first pull the latest popular token mints from Birdeye, based on last 24h volume. Then spin up a JupV6 API with FILTER_MARKETS_WITH_MINTS
set to the token mints pulled from Birdeye. INTERMEDIUM_MINT_COUNT_FROM_BIRDEYE
configures how many tokens to use from Birdeye. The higher you set for INTERMEDIUM_MINT_COUNT_FROM_BIRDEYE
, the more oppotunity you may see as there are more potential routes from different token pairs. Though higher number also means longer time to get a quote from JupV6 API, and it will also uses more resources from your machine. If YELLOWSTONE_URL
is not set, it is not recommended to set
If YELLOWSTONE_URL
is set, it will be used to start JupV6 API with it, otherwise the JupV6 API will run in pull mode, which is heavy for your read RPC and it is not recommended when you have too many intermedium mints(>100).
If JUPITER_URL
is set to a different value, none of the params in the following form will apply. This can be used when you have a JupV6 API provider, or running it yourself separately.
More info about self-hosted JupV6 can be found here: https://station.jup.ag/docs/apis/self-hosted
DISABLE_LOCAL_JUPITER
Default: false
When set to true, it will not start the Jupiter API locally. This is useful when you want to run multiple bots on the same machine
EXCLUDED_DEXES
default: 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P,MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG
The full list is here. You can choose which Dex to exclude from your jup api when starting it. Using the address of the Dex not the name, separate by comma. Default exclude Moonshot and Pump.fun
JUPITER_RPC_URL
The RPC that is used to read data. When using default JUPITER_URL value, this RPC will also be used to spin up JupV6 API. If this is not set, the value of RPC_URL will be used.
JUPITER_URL
Default: http://0.0.0.0:18080
Endpoint for JupV6 API. When using default value, it will spin up a JupV6 using top popular mints from Birdeye. When set a value other than default, the rest of the parameters in this form will not be applied.
JUP_MAX_ACCOUNTS
Default: 24
the maxAccounts param that is used to call quote from JupV6. Recommended not setting this higher than 32. The higher this number is, the more routes you can find, though as there's a limit on the total accounts, a higher number here will also cause a higher chance to find an invalid route with too many accounts, and it also takes longer to search.
USE_LOCAL_MARKET_CACHE
Default: false
When this is set to true, it will load the market cache from the local file mainnet.json
. This is useful when you run jup and it's very slow to start, or even fail with error reading a body from connection
. You can update the local file with wget https://cache.jup.ag/markets?v=4 -O mainnet.json
LOCAL_JUPITER_PORT
Default: 18080
The port jupiter api uses. Note if you change this, you should also change your JUPITER_URL with the same port.
MARKET_MODE
Default: remote
Supported value: europa
, remote
The default behavior(remote) here will fetch a snapshot of all the markets given your intermedium mints, and will only update them on a restart. Europa mode will stream new markets for your mint list to Jupiter, but it can be very heavy for some RPC to handle.
TOTAL_THREAD_COUNT
Jup uses thread for 3 things: webserver, update, router. You can config thread count for webserver and update, the rest of the cores will be used for router.
Router thread is handling the workload to find the best route for each quote request. This can be heavy especially when you have USE_DIRECT_ROUTE_ONLY
false.
Make sure you leave some cores beside WEBSERVER_THREAD_COUNT and UPDATE_THREAD_COUNT for routing calculation.
Default: the number of CPU cores on your machine
Routing engine thread = TOTAL_THREAD_COUNT
- WEBSERVER_THREAD_COUNT
- UPDATE_THREAD_COUNT
.
Most of the time you shouldn't need to set this and can just let jupiter use all your cores to enhance performance.
WEBSERVER_THREAD_COUNT
Jup uses thread for 3 things: webserver, update, router. You can config thread count for webserver and update, the rest of the cores will be used for router.
Router thread is handling the workload to find the best route for each quote request. This can be heavy especially when you have USE_DIRECT_ROUTE_ONLY
false.
Make sure you leave some cores beside WEBSERVER_THREAD_COUNT and UPDATE_THREAD_COUNT for routing calculation.
Default: 2
This is how many thread to handle the http requests. The bot is heavily using this so you should consider setting this to a high number if your jupiter quote per second is high.
UPDATE_THREAD_COUNT
Jup uses thread for 3 things: webserver, update, router. You can config thread count for webserver and update, the rest of the cores will be used for router.
Router thread is handling the workload to find the best route for each quote request. This can be heavy especially when you have USE_DIRECT_ROUTE_ONLY
false.
Make sure you leave some cores beside WEBSERVER_THREAD_COUNT and UPDATE_THREAD_COUNT for routing calculation.
Default: 4
This is the number of threads used to handle markets update using the data pulled from yellowstone/rpc. If you are using a lot of mints you should consider setting a higher number for this to speed up your price update.
USE_DIRECT_ROUTE_ONLY
Default: true
When set to true, the bot will only look for 2hop(A -> B -> A) trade. Setting to true will lead to shorter quote time to Jup, with faster landing. Setting to false will lead to more opportunity, but taking more time to quote.
INTERMEDIUM_MINTS
The Bot tries to find profitable route by getting a quote from BASE_MINT to an INTERMEDIUM_MINT for a given trade size, then get another quote from INTERMEDIUM_MINT to BASE_MINT, and combine them together for a potential profitable route. Basically a route from A -> B -> A.
When USE_DIRECT_ROUTE_ONLY
is set to true, the bot will only return route in the form of A -> B -> A like above. For potentially more opportunity, you can set it to false, which can lead to routes like A -> B -> C -> A. The downside of setting this to false is it will slow down the time to get a quote, end up sending out the transaction a bit slower.
You can set as many tokens as possible as the INTERMEDIUM_MINT, though the more you have, the heavier your RPC load is, so you may want to adjust this accordingly.
There are multiple ways for you to define which mints you use as intermedium. The bot will merge all the mints fetched through different ways into one list and use it as intermedium mints.
INTERMEDIUM_MINT_COUNT_FROM_BIRDEYE
Default: 0
This param configs how many top tokens to use as intermedium mint that pulled from Birdeye's 24h volume list. This list has high volume but usually low velocity.
https://docs.birdeye.so/reference/get_defi-tokenlist
INTERMEDIUM_MINT_COUNT_FROM_BIRDEYE_TRENDING
Default: 0
This param configs how many top tokens to use as intermedium mint that pulled from Birdeye's trending list. Maximum 200. Update every 20min. This list has high velocity new mints, and usually works better with SOL as base mint.
You do not need birdeye api for this.
https://docs.birdeye.so/reference/get_defi-token-trending
INTERMEDIUM_MINT_COUNT_FROM_GECKO
Default: 0
Fetch new pools opened through gecko terminal and extract the mints used in the pool. API used here: https://www.geckoterminal.com/dex-api.
Note INTERMEDIUM_MINT_COUNT_FROM_GECKO
can only return ~20-30 mints at maximum due to their limitation on the api.
INTERMEDIUM_MINT_FROM_FILE
This provides a way to load intermedium mints for the bots to use. This is useful if you have a set of mints in mind that you want to use, or you write your own script to fetch intermedium tokens for the bot to use.
Example file:
INTERMEDIUM_MINT_EXCLUDE_FROM_FILE
This provides a way to exclude certain mints from intermedium mints.
This is useful when you want to exclude certain mints from birdeye/gecko. Especially if you only want to do SOL arbs and don't want to include USDC/USDT in the route, as it can be heavy for your RPC to load all.
The following example is to exclude USDC/USDT from your intermedium mints.
INTERMEDIUM_MINT_FROM_ADDRESSES
This allows you to copy trade top players and use whatever intermedium mints they use.
For example, if you want to copy ben/bob's most recent 100 tx:
MAX_MINT_COUNT
You can define an overall MAX_MINT_COUNT, and a MAX_MINT_COUNT for every address you are tracking. The bot will rank all the mints by number of times it appears and keep at most MAX_MINT_COUNT
mints. If you have INTERMEDIUM_MINT_EXCLUDE_FROM_FILE
defined, the mints will be excluded first then cut off the top rank.
BOT
This section contains configurations for the bot itself.
AUTO_RESTART
Default: 60
Unit in minutes. By default, the bot will auto restart every 60min. This will also restart JupV6 if hosted together, to allow fetching the lasted high volume tokens from birdeye. If set to 0, the bot will not auto restart.
ENABLE_SIMULATION
Default: true
Whether to run simulateTransaction before sending the transaction. This can help to reduce the number of failed transactions landed on chain if spam mode is enabled.
ENABLE_JITO_RPC
Default: false
DO NOT SET THIS TO TRUE if you don't know what is a Jito RPC. You have to use a Jito RPC when you enable this. When this is enabled, the bot will use simulateBundle
to run simulation, which can give you the actual profit with the simulation. This value is more accurate than then one calculated from Jupiter quote. This is especially useful when you set spamFeeBps
in your base-mint.json
Note: Most providers don't provide Jito RPC. Right now the only options to get one is to either host a RPC node yourself, or rent a dedicated RPC node from a provider like Helius/Triton.
FIXED_COMPUTE_UNIT_LIMIT
Default: 0
You can use a fixed COMPUTE_UNIT_LIMIT to avoid the additional computation needed. When this is set to 0, the bot will call jup to get an estimation of the COMPUTE_UNIT_LIMIT and use that instead. Which is more accurate but a bit slower, and will make 2 additional rpc calls getRecentPrioritizationFees and simulateTransaction for each quote.
A suggested value is 250000 for USE_DIRECT_ROUTE_ONLY=true
and 350000 for USE_DIRECT_ROUTE_ONLY=false
The suggested value should work for 90% of the cases.
Note: when using flashloan, the bot will add 100000 to the value to account for the additional instructions needed.
You should not set this to be less than 200000, it may result in not landing anything successfully.
Read more about what is compute unit limit here.
MAX_COMPUTE_TIME
Default: 400
The maximum compute time to send tx for an opportunity. If you are trying to catch an opportunity right after it appears, you usually don't want to send anything when it takes too long to calculate in the first place. If the time took to compute is greater than MAX_COMPUTE_TIME
, the bot won't send any tx for it.
MEMO
Text that will be added as the last instruction in the transaction. You can use this to distinguish which server you are running the bot from by setting a different value for each server.
When not set a MEMO will NOT be added to your tx.
PULL_BLOCKHASH_WITH_YELLOWSTONE
Default: false
when enabled, will use your Yellowstone to pull blockhash instead of RPC. This can save you a lot of RPC credits. You must also set YELLOWSTONE_URL
to use this.
MIN_SOL_BALANCE
Default: 0
Units in lamports. Does nothing by default. When set to a none 0 value, the bot will periodically check the wallet's SOL balance, and when it drops below the value, it will unwrap all the WSOL and wrap only the amount needed back, to rebalance the SOL account to avoid running out of SOL. e.g. set this to 1000000000 will auto balance your wsol/sol accounts when your sol drops below 1.
PROCESS_DELAY
Default: 1000
Unit in ms. The default value means the bot will wait for 1000ms then try again for the same token-trade size pair. Reducing this number will increase the chance to catch price change right away, but increase the read RPC load.
RPC_URL
The RPC that is used to read data. When using default JUPITER_URL value, this RPC will also be used to spin up JupV6 API.
SKIP_SAME_OPPORTUNITY
Default: false
When enabled and you are using fixed trade size(either using tradeSize or tradeRange with linear strategy), the bot will check if it's the same as last time and not generate a new opportunity for it if it's the same.
PAY_FEE_WITH_PROFIT
Default: false
This will only affect SOL as base mint. When enabled, the bot will unwrap your profit before sending the jito tip/bot fee, which can be very useful if you don't leave much SOL balance in your wallet, or if you are targeting larget opportunities and afraid to not have enough SOL to pay for a big hit.
DOWNLOAD_RPC_URL
Default: ''
When set, ths RPC url will be used when loading INTERMEDIUM_MINT_FROM_ADDRESSES
. This is useful when your main RPC does not support transaction history.
Tested you can use a helius free RPC plan with DOWNLOAD_RPC_RATE_LIMIT_PER_SECOND
set to 5 to download all the intermedium mint from addresses.
DOWNLOAD_RPC_RATE_LIMIT_PER_SECOND
Default: 0
When set to a none 0 value, it will apply a rate limit when doing RPC calls. This is helpful when using the free plan for some RPC.
JITO
Jito provides a way to send transactions through bundles. Bundles will only land when it succeeds, which is perfect for making arbitrage trade!
You can enable jito by setting ENABLE_JITO=true
in your .env
file. The bot will then send all transactions to all jito regions defined in BLOCK_ENGINES
through Jito's http endpoint.
Following is the Jito related configs you can set in your .env
file
ENABLE_JITO
Default: true
Whether to use Jito bundle to send transaction. The good part about Jito is, it will never land if the transaction fails. So everything lands is profit. Thought you will need to pay a tip from your profit. See the JITO_TIP_BP param.
BLOCK_ENGINES
Default: ny,amsterdam,frankfurt,tokyo,slc
You should not change this value unless you really know what you are doing. Config which block engines to send to for jito transactions.
TIP_STRATEGIES
Default value: ['dynamic']
Supported values: dynamic, static, fixed
Define which strategy to use when paying for jito's tip.
dynamic: The onchain program will calculate your real profit and use a percentage defined with DYNAMIC_TIP_BP
to pay for the jito tip. This always send through the sendBundle endpoint of jito.
static: This will use a percentage defined with STATIC_TIP_BP
based on the projected profit(the one you see in your opportunity) to pay for the jito tip. This means the actual percentage of the profit when the tx land may not be the same as the projected profit. This will use the sendTransaction endpoint by default, and sendBundle when USE_SEPARATE_TIP_ACCOUNT
is enabled.
fixed: This will use a fixed number(SOL lamports) as your jito profit with FIXED_TIP
. This will use the sendTransaction endpoint by default, and sendBundle when USE_SEPARATE_TIP_ACCOUNT
is enabled.
Note: sendBundle and sendTransaction does not share the same rate limit. they both have 5/ip/wallet/region/s rate limit.
DYNAMIC_TIP_BP
Default: 0
Your TIP_STRATEGIES
need to has dynamic
in it for this to take effect.
Jito tip as part of your profit. 5000 means 50% of your profit will be used as Jito tip. The higher this number, the better chance you may land your transaction, but in return, less profit earned.
STATIC_TIP_BP
Default: 0
Your TIP_STRATEGIES
need to has static
in it for this to take effect.
Jito tip as part of your profit. 5000 means 50% of your projected profit will be used as Jito tip. The higher this number, the better chance you may land your transaction, but in return, less profit earned.
The tx landed with this may not have the same percentage as you defined, as the tip value is set before you send the tx, but the actual profit may vary when it actually landed.
FIXED_TIP
Default: 0
Your TIP_STRATEGIES
need to has fixed
in it for this to take effect.
Use a static jito tip when sending to Jito. Unit is SOL lamports. The bot will always use the same tip for all tx it sends, and still make sure the tx landed are all profitable.
When you set both JITO_TIP_BP
and FIXED_TIP
, bot will send both percentage based and fixed tip transactions.
Note: If you are using this without USE_SEPARATE_TIP_ACCOUNT
set to true, the bot will use sendTransaction
endpoint to sent it, which is using a different rate limit then sendBundle
which is used with JITO_TIP_BP
.
Example with a FIXED_TIP
of 20000 :
https://solscan.io/tx/ZokReqrVXkQgC3gjJoBRDr4sNXKNAuR3Fb4pwD5rFoMRjF4caGwacDEavDiD5CPZRkURgaeCaw73kwqTDSR4F32
MAX_TIP
Default: 0
Set the max tip the bot pays when using JITO_TIP_BP
. Unit is SOL lamports. The bot also has a max tip amount of 80% of your remaining SOL balance, to avoid missing big opportunities when not having enough SOL left. 0 means no no max tip.
JITO_UUID
By default, jito has a 5/s/ip rate limit. You can ask for a rate limit raise from jito, and they will give you an uuid that you can set with the bot.
NOTE: Currently the key has a bug and the rate limit for the key is universal not per ip.
SHOW_JITO_LOGS
Default: false
When this is enabled, response for sending jito bundles will be added to the output log. This is helpful if you are trying to figure out how often you are hitting jito's rate limit, or testing your UUID to see if it works.
USE_SEPARATE_TIP_ACCOUNT
Default: false
When this is enabled, a new solana address will be used to send tip in its own tx instead of sending to Jito directly for every Jito transaction. Jito currently is rate limiting bundles based on the accounts in the tx that does the tip, this feature can get around this rate limit by wallet issue to allow you using the same wallet in all locations. This is useful when you have machines in multiple locations but still trying to use the same wallet to run the bot. Example transaction: https://solscan.io/tx/41CBfg3cg1eKvxgJHJ7TqhmrGJ73BxikDVALV7SQYM4FmMqt22Cfpc18f5bErATSUoTDccKtFSVpGQe1WvMr1b9f
USE_DIFFERENT_TX_FOR_BLOCK_ENGINES
Default: false
This will send different TX for different block engines, in theory increase your chance to land, and can some time land multiple tx for the same opportunity.
USE_DIFFERENT_TIP_ACCOUNT_FOR_BLOCK_ENGINES
Default: false
This will use different tip account for different block engines, in theory increase your chance to land, and can some time land multiple tx for the same opportunity.
SPAM
Spam strategy means you will send many transactions and hope some of them get landed and landed successful. This is a more advanced strategy as you may lose money on gas fee if you didn't config it carefully.
You can enable spam by setting ENABLE_SPAM=true
in you .env
file. The bot will then use all the rpcs you defined for SEND_RPC_URLS
to send potential profitable transactions.
Jito and spam can be enabled together, the bot will just send 2 different transactions, one through jito and one through rpc.
ENABLE_SPAM
Default: false
Whether to send a normal transaction for every potential arbitrage oppotunity. Note most of the transactions will not even land on chain, for the ones that does, 90% of them will fail. Set ENABLE_SIMULATION=true can help reduce the number of failed transactions.
COMPUTE_UNIT_PRICE
Default: 0
The COMPUTE_UNIT_PRICE aka gas fee set for the transaction. Note: this is not SOL lamport. Generally the higher this is, the better chance your tx can actually land on chain. Learn more about what this is here: https://solana.com/docs/core/fees#prioritization-fee This only applies to spam, jito transactions set its own value as it's not needed.
MAX_RETRIES
Default: 0
This is a config for sendTransaction RPC method, Maximum number of times for the RPC node to retry sending the transaction to the leader. The higher this number, the more chance your tx can land, but also lead to high chance of failure, as retried tx is likely too late for the opportunity.
PRIORITY_FEE_UPDATE_INTERVAL
Default: 60
Unit in seconds. This controls how often the priority fee is updated. This only works when you set priorityFeePercentile in your base-mint.json
SEND_RPC_URLS
The RPCs used to send transactions. This can be the same as RPC_URL
You can also set multiple RPCs here, split by comma. Setting multiple ones can increase the rate of tx landing and success.
Example:
This is an example instruction when setting USE_DIFFERENT_TX_FOR_SENDERS
=true
This image shows that the second RPC in the SEND_RPC_URLS
list sent this tx(first RPC is RPC 0).
SKIP_PREFLIGHT
Default: true
This is a similar config to ENABLE_SIMULATION. The difference is ENABLE_SIMULATION will run the simulation with your RPC_URL before sending it, when you have SKIP_PREFLIGHT=false, the RPC received your transaction will run the simulation before it forward to the validator. This will also make landing slower as it's an additional call, but also it can reduce the failed transactions you land with ENABLE_SPAM.
You should only have at most one of SKIP_PREFLIGHT=false
and ENABLE_SIMULATION=true
. Setting both is not worth it.
SPAM_RESTRICT_LEVEL
Default: 0
Valid values are 0,1,2,3,4,5.
This config will try to limit how long a tx land compares to when you send it when using spam. 0 is no restriction, the same behavior as before. 5 is maximum restriction and will only allow the tx to land within ~1-2 slots. Note the exact restriction time for each level can be affected by your RPC's latency and performance. You may not land anything when you set this value to 4-5 if your RPC is not fast enough.
This config allows you to use a very high fee for spam strategy and also not losing too much money on failed ones.
USE_DIFFERENT_TX_FOR_SENDERS
Default: false
When setting multiple SEND_RPC_URLS
, this config will send a different tx for each of the RPCs. When this config is set to false, the same tx will be send to all RPCs.
You can also see which RPC send the tx in the last instruction of the tx. Index start from 0. See later section for example*.
BLOXROUTE
BloXRoute is a service provider that provides service to send transactions through their endpoint. Our bot has a special collaboration with them to provide you this service at a discounted rate.
ENABLE_BLOXROUTE
Default: false
You need to set ENABLE_SPAM
to true when enabling this. Make sure you set the right value for BLOXROUTE_REGION
when enabling this.
We have a collaboration with BloXroute, when this is set to true, your spam transaction will be sent through BloXroute's Trader API v2, in addition to all your SEND_RPC_URLS.
Note when a tx landed successfully with BloXroute, it charges an additional 0.0005 SOL as fee to use BloXroute's api and send through its staked connection. The bot already takes this into consideration and will fail the tx if your profit is not enough to pay for this fee + the bot fee. But do take this into consideration when you enable it.
This API has a 20tx/s rate limit. So it's highly recommended to enable simulation when using this.
BLOXROUTE_REGION
Default: ny
Only relevant when you have ENABLE_BLOXROUTE=true
. Valid values are ny
and uk
. Should only set it to be the closest one to your server.
LOGGING
DEBUG
Default: false
Enable debug mode for additional logging
ENABLE_LANDING_LOG
Default: false
When this is enabled, it will output an additional WIN
log when a transaction is landed. Though if you turn this on while having ENABLE_SIMULATION=false, it may consume a lot of your RPC credits.
HIDE_ERROR
Default: false
If you don't want to see the error messages, you can turn this to true which will hide them.
FLASHLOAN
Flashloan is a power tool when you have limited budget. You can set a higher trade size than what you have in your wallet, and get arbitrage opportunities that you usually won't be able to get.
Flashloan may not success 100% of the time. When the vault you are borrowing from does not have enough tokens, your transaction will fail due to insufficient fund. Though this should rarely happen.
When flashloan is enabled with the bot, and you are using SOL as one of your base mint, you should also set WRAP_SOL_AMOUNT
which is the amount of sol you want to wrap into WSOL. The bot will only use flashloan when the amount is larger than WRAP_SOL_AMOUNT
, for trade with less amount it will just use the amount in the wallet, to maximize the potential profit.
ENABLE_FLASHLOAN
Default: false
Whether to enable flashloan. Note you need to have at least 0.5 SOL in the wallet to enable flashloan.
FLASHLOAN_PROVIDER
Default: solend
Currently supported values are solend
.
solend
Soland flashloan charges a 0.04% fee based on the amount you borrow. So a trade that borrows 1000 USDC as shown above will need to find an opportunity that gives you at least 1000.4 USDC back for you to make a profit, compares to at least 1000 USDC when you are not using flashloan. This will results in more failed transactions if you send using spam, or less overall landing if use with Jito. The upside is you can get opportunities that is only possible with big amount. You can also use flash loan as a kick start option to minimize your risk of putting too much amount in your wallet.
Solend only adds 2 more instructions instead of 4. So you will run into less Generated transaction is too large
error compares to marginfi, but paying an additional fee as a trade off.
WRAP_SOL_AMOUNT
Default: 0
The amount of SOL to wrap into WSOL, only relevant when SOL is used as one of the base mint. By default the bot will wrap the largest amount in your trade size, but when flashloan is enabled you have to define how much you wrap. For all the trade with trade size less than this number, the bot will use the balance in the wallet, for larger ones the bot will use flashloan.
BASE_MINTS
This is used to control what base mint you want to use for your trades and what trade size you want to use. Base mint means the token you are going to trade and profit with, currently only SOL/USDC/USDT is supported.
The following setup means the bot will run with SOL and USDC. Note the unit is lamports here. So 1 SOL = 1,000,000,000 lamports. 1 USDC = 1,000,000 lamports. 1 USDT = 1,000,000 lamports.
Using 1 SOL/2.5 SOL/5 SOL as trade size for SOL, and will only try to send the transaction when the opportunity provides at least 0.0005 SOL in profit.
You can use the same mints for different TRADE_SIZE/MIN_PROFIT pair to customize your strategy.
Example:
MIN_PROFIT
MIN_PROFIT is the threshold for when to send a transaction for the potential profit, it does not guarantee that the actual profit land on chain will be that. The actual profit landed on chain can vary, and the bot will fail all transactions that ends up with a negative profit, and land all the ones with a profit, even if the profit is smaller than MIN_PROFIT.
TRADE_SIZE
Set in lamports on what sizes you want to trade with. Bot will quote jupiter api with the exact trade size you defined here periodically trying to find the most profitable routes.
Example:
TRADE_RANGE
If you don't want to manually define every trade size, you can utilize the trade range parameters. To utilize this you need to define 3 params: TRADE_RANGE
, TRADE_RANGE_COUNT
, TRADE_RANGE_STRATEGY
TRADE_RANGE: This defines the lower bound and higher bound for the range(inclusive). Bot will generate trade sizes only within this range. So make sure you have enough balance of the token for the upper bound.
TRADE_RANGE_COUNT: This defines how many different trade size will be generated within the range.
TRADE_RANGE_STRATEGY: Two values are supported right now: linear
and random
. Linear will generate trade sizes evenly within the range, and random will generate a trade size randomly each time.
Note: quote using random is slightly slower than quote using linear or fixed trade size. As for random two quotes are sent out one by one while for fixed size two quotes are sent out together.
PRIORITY_FEE_PERCENTILE
Value from 0 to 100(you can set higher than 100 but not recommended). Automatically set COMPUTE_UNIT_PRICE based on current priority fee level. You need to set HELIUS_API_KEY
in order to use this. The bot utilize helius's priority fee api, to fetch the latest priority fee levels. The response is something like the following from the api, value map to the response, aka 0 means min, 25 means low, 50 means medium, 75 means high, 100 means veryHigh. If the current response looks like below, and you set 30 as the value for priorityFeePercentile
, the auto generated COMPUTE_UNIT_PRICE would be 10000 + (60082 - 10000) * ((30 - 25) / 25) = 20016. Note the value for each level will change all the time as market moves.
When this is set, it will override the COMPUTE_UNIT_PRICE
value in .env file.
This should be set together with MAX_PRIORITY_FEE
. The max COMPUTE_UNIT_PRICE
you are willing to set. This is helpful to prevent setting a huge priority fee as market moves.
Example usage of the config:
SPAM_FEE_BPS
This allows you to set your gas fee to be a fixed percentage of the projected gain. Note you can only set one of PRIORITY_FEE_PERCENTILE
and SPAM_FEE_BPS
, not both.
This will override the COMPUTE_UNIT_PRICE
you set in .env
Example usage of the config:
This config will use 5% of projected profit as the fee. Note this is not 5% of the final profit, it's 5% of the projected profit that bot calculated based on Jup API. If you set ENABLE_JITO_RPC
, this will be based on the simulated profit, which is more accurate than the projected one.
Config override
You can override JITO/SPAM configs for each base mint you define, this allows more complex strategy setups without the need to run a different instance of the bot.
Here's an example of overriding JITO_TIP_BP
for two base mints. The one without any override will use the global defined value, the one with override will use the override value.
Note: Only JITO/SPAM configs support config override.
Last updated