Welcome to another blockchain and another land of arbitrage opportunities!
Along with other blockchain protocols, version 0.34 gave Hummingbot users a way to connect with the Terra blockchain, opening up many new arbitrage opportunities for our community.
In this post, we'll introduce how to arbitrage between Terra and other exchanges. You can also check out the demo video here.
The Terra Protocol is the creator of the Luna Token, Terra Core creator, and the blockchain payment solution CHAI. The design of the Terra Protocol is based on two things: stability and adoption by e-commerce platforms. It runs on a Tendermint Delegated Proof of Stake algorithm and Cosmos SDK. It is aimed at becoming a new worldwide financial infrastructure on which different DApps can be created. (Source)
Terra protocol aims to be a blockchain focused on stablecoins, with the LUNA token as the system’s centerpiece. If you are curious about how it works, check their introduction video.
Besides the LUNA token, the Terra protocol already has the following stable coins issued on its blockchain:
UST (US Dollar)
KRT (South Korea Won)
SDT (Singapore Dollar)
MNT (Mongolian Tugrik)
This opens a lot of opportunities with different fiat currencies.
amm-arb strategy, you are able to connect to the Terra blockchain and execute arbitrage trades using the Terra Swap and other exchanges (centralized or decentralized)
To begin taking advantage of these opportunities, we first need to find out where the Terra tokens are available to be traded.
With that information at hand, just cross-check with the current exchanges and protocols supported by Hummingbot, and pick which one you want to run the bot.
As an example for this guide, we will use the LUNA-UST pair on the Terra blockchain and the LUNA-USDT on the Bittrex Exchange.
Along with the Exchange of your choosing, you will also need a terra wallet.
To create a Terra wallet, you will need to download the Terra Station app from the Terra official page.
Terra station allows you to manage your wallet, swapping tokens, and delegating LUNA to validators on the Terra blockchain. The Terra wallet, which we will be using to connect to Hummingbot for the AMM strategy.
How to create a Terra blockchain wallet:
Download and install Terra Station wallet from their site;
Launch Terra Station and click the Connect button at the top;
Select New wallet to create a new wallet;
Fill out all forms and make sure to store your seed phrase in a secure place;
Confirm your seed to complete;
Add funds to your new Terra Wallet;
The Terra wallet address can be found at the top of the Terra Station window.
Note: We will use the Terra wallet address and the seeds for connecting the wallet in Hummingbot later
Note 2: If your Terra wallet doesn’t have any of the tokens you are trading, Hummingbot will show a warning message that the
markets are not ready.
Important: For Hummingbot to communicate with the Terra blockchain, you must have the Gateway installed and running. If you haven’t installed the gateway already, follow this guide.
Check if your gateway is properly connected by connecting to your Terra wallet on the Hummingbot client.
Run the command
Enter your Terra wallet address;
Enter your Terra wallet seed,
including the spaces in between each word.
After installing and starting Hummingbot (if you haven’t done that already), it’s time to connect to the exchange you will be arbitraging.
You can check here for an updated list of connectors available on Hummingbot and their status, along with instructions on connecting with each of them.
With both markets connected, all you need to do is create the arbitrage strategy. On Hummingbot, execute the
create command, and answer the following questions:
What is your market making strategy? Enter
Enter your first connector (exchange/AMM) You might enter any of them, but my recommendation is to choose the AMM protocol as the first connector due to the order execution being slower than centralized exchanges.
Enter the token trading pair you would like to trade on terra example:
Important: The position of each token ticker must be the same on both connectors, or the bot might not execute the correct calculations
Enter your second connector (exchange/AMM) Type what will be the second exchange the bot will be connecting to. For example,
Enter the token trading pair you would like to trade on bittrex In our example, we will use
LUNA-USDT. Note that you can pick different symbols from the trading pair in the first connector.
What is the amount of LUNA per order? Ensure that this value is bigger than the minimum required on both exchanges, or you risk not executing the strategy correctly.
What is the minimum profitability for you to make a trade? Hummingbot already accounts for the transaction cost on the profitability calculation, so the value you will enter here is the minimum profit margin you desire.
How much buffer do you want to add to the price account for slippage for orders on the first (and second) market? Since markets are dynamic, the time between the bot detecting an arbitrage opportunity and creating the orders, asset prices might change. The slippage buffer will make the bot send the orders adding (or subtracting) the % indicated here to the orders price to ensure they will be executed.
Do you want to submit both arb orders concurrently? If
Yes, the bot will send orders to both markets at the same time. If
No, the bot will wait to complete the order on the first market before sending the order to the second market.
Enter a new file name for your configuration Choose the configuration file’s name so you can load it up again with the
import command the next time you start the bot. And there you go! Just hit
start, and the bot will start to look for arbitrage opportunities!
Blockchain and cryptocurrencies are nascent technologies, and there is a lot of space to create new systems and iterate improvements on existing ones.
Each new project presents new opportunities for traders, especially for arbitrageurs, due to the discrepancies that arise with each new market.
Stable coins also add another layer to this market dynamic because the arbitrageurs end up filling an essential role in these systems, helping the price across different stable coins become, well, stable.
What to discuss more about this idea, and share your thoughts and strategies?
Our community is full of market makers and arbitrageurs who are willing to help each other make the best use of Hummingbot. You can join our Discord channel to talk about the hummingbot, strategies, liquidity mining, and anything else related to the cryptocurrency world, and receive direct support from our team.
On our Youtube Channel, you can find a lot of content about market making, including interviews with professional traders and cryptocurrency related events.