Stablecoin Arbitrage on Jupiter DEX Aggregator

    Jupiter is the key liquidity aggregator for Solana, offering the widest range of tokens and best route discovery between any token pair. Jupiter aims to provide the most friendly UX for users and most powerful tools for developers to allow them to easily access the best-in-class swap in their application, interface, or on-chain programs.

    db_img

    Why JUPITER is Proper to Get Arbitrage?

    Because Jupiter is a dex aggregator, there are natural opportunities where one could take advantage of liquidity pairs across the ecosystem to create arbitrage.

    To prove this, we can consider the price difference between the two stable coins like USDT and USDC in a period of time (From February 1st to today). The number of successful transactions in Jupiter that started with USDC/USDT and ended with the same two stable coins is more than 135341 transactions (Until the presentation of this research), and there are about 7696 transactions (5.69% of total transactions), which show the price difference between the two coins is more than 1%; In accordance with the following condition:

    "and (swap_to_amount/swap_from_amount)*100>=101".

    Although the graph below says it all, you can refer to the SQL code of this graph for more details. In addition, the refresh rate is set daily.

    Loading...

    Patterns Behind the Most Common Sources of Arbitrage on JUPITER

    The price for a token can change quickly at any point in time. So the best priced trade is not always on one DEX and may involve a combination of trades across many DEXes. Here are some key features for how Jupiter discovers the best priced trades.

    Smart Routing

    Jupiter directly connects all DEX markets and AMM pools together no matter the provider and will find all direct and 2-hop routes between any two tokens on Solana.

    Multi-hop Routes
    db_img

    Not only does Jupiter compare the prices between markets on different DEXes but often the best priced routes are not direct markets. Instead, Jupiter may finds the best price by routing through an intermediary token, e.g. USDC-mSOL-SOL instead of USDC-SOL. This may be due to price inefficiencies and/or volatility in the various markets that Jupiter routes through.

    Trade Splitting

    Jupiter will split your trade into smaller trade sizes. For example, if you want to make a 100 USDC-SOL trade, it may distribute your trade into a 30 USDC-SOL trade on Raydium and a 70 USDC-SOL trade on Orca. The % distribution of the trades is dynamically determined to give you the best price. Trade splitting helps get better prices for large size trades and trades with tokens where there is shallow liquidity spread out across a number of DEXes.

    db_img

    The basic flow

    1- User enters in the tokens they want to trade.

    2- User enters in the amount of tokens they want to trade for.

    3- Jupiter calculates out all the possible routes for the token trade.

    4- Jupiter fetches the quotes for each of those routes and returns the amount of tokens you will receive per route. This includes all fees.

    5- Jupiter ranks each route by most tokens you will receive.

    6- Users can select any route but the first route offers the most tokens. 7- User clicks to trigger a swap.

    8- User approves the Jupiter transactions from their wallet

    9- Jupiter executes the trade.

    Note:

    1- After completing the swap, the purchased coins can be re-sold on Jupiter itself, based on the best route and the profit from the arbitrage. Therefore, you may need to perform multiple transactions in multiple protocols with different tokens in order to obtain the best arbitrage from the different protocols.

    2- JUPITER searches again for the best routes to choose the cheapest transaction and offers it to the trader every 20 seconds.

    db_img

    Top 10 Wallets in Arbitrage Gains (From February 1st)

    The below histogram shows the top 10 wallets of revenue from arbitrage in (USDC/USDT) transactions through the JUPITER Aggregator Protocol. Stacked bars include a single wallet.

    Loading...
    Loading...

    Insight Over Top 10 Wallet Strategy

    Max gain is about 935% which belongs to '5C96TM1fGA1vQdfs3SWde5dW1UjJjmTUHVBMgZQS7aG12tyTjRsn1gLSBiL4a3HsF7w7zoweT5yjVBU7urgfWmnV' transaction id. Let's take a look at the details of this transaction with '6hyuGqKQyhAEipjtaquiNHfd1dVjrNT3FzzanXurbK4W' wallet address:

    db_img

    This wallet initially swapped the amount of 460 USDC to 504M WAGMI token using the JUPITER Aggregator in the Aldrin AMM V2 program. Then It swapped the 504M WAGMI again in the protocol Serum DEX V3 to the amount of 4300 USDC.

    Conclusion

    In this article, we talked about how to find the best arbitrage routes using Jupiter Aggregator. We saw that using this protocol, the best path (best price) of a particular token can be found in the programs listed by Jupiter, bought them, and sold with the same protocol in a different way and in a different protocol, and gained profit from the price difference between the initial and the last transactions. Classic arbitrage strategy used across Wall Street and cryptocurrency markets every day.