Introducing the Glitter Arbitrage Bot
May 20, 2023
Launched in mid-April 2023, Glitter Finance's Arbitrage Bot gives stakeholders in the community a means to actively perform automated arbitrage over a variety of cryptocurrencies and a myriad of blockchain networks. As a core part of Glitter's mission, the Arbitrage Bot serves as a tool to empower token holders to unlock the full value of their digital tokens, while also serving as a means to help stabilize the Glitter Bridge SDK and those of its exchange partners.
The Arb Bot is an exciting project for Glitter Finance and is one that will serve the needs of all members of the Glitter community. Before we proceed further however, it is worth defining: what is Arbitrage?
What is Arbitrage?
Arbitrage is an economic process that can be defined as the act of leveraging the price differences between two or more markets in order to profit on this difference. For example, if you were to purchase a bushel of apples at a farmer's market in your hometown for a given price of $5 and then in the neighbouring town there was an appetite to pay $6 for the same bushel, you could exploit this difference in prices to generate a $1 profit per bushel without having to produce the apples yourself! Historically arbitrage was used to profit off of the difference in things like commodities, stocks, bonds, and even currencies across different jurisdictions and markets.
On the surface, arbitrage may seem like an exploitative process that takes advantage of misinformation or discrepancies in demands between isolated markets, but in reality it is actually a net benefit to markets at large. This follows as by the repeated process of performing arbitrage, prices in markets ultimately trend to a steady state. Going back to our previous example, let's assume you are performing arbitrage by buying and selling apples from your hometown and a neighboring town respectively. While this theoretically sounds like an amazing exploit on mismatches in your (relatively) local marketplaces, it really just means there is an inefficient market. Your neighboring town may not have a local farmer or the means to produce bushels of apples, so you are filling a need that that town needs. What will happen as a result of your exploitation however is that demand will either decrease in the neighboring town, or suppliers will take notice of your profits and ensure that they themselves are competing with you in this secondary market. Both actions will ultimately drive your prices down, and likely have it reach a steady price that is eventually identical to that of your hometown ($5/bushel).* Said another way, through the process of arbitrage, identical goods trend towards identical prices and this leads to what is called an efficient market.
*Note that this is also assuming a vast simplification of things like transportation costs, means of production, etc... but does facilitate how arbitrage tends to lead to price equality and/or a steady state of exchanges in various markets.
Looking at another example, let's consider arbitrage of currencies. As you've probably seen in your lifetime, when you attempt to exchange money in a given currency for another, you are subject to an exchange rate that determines the amount of a secondary currency you receive for your held one. For example, let's say you hold an amount X of currency Alpha and are trying to exchange it for currency Beta. You speak with a currency exchange broker and obtain a quote for an amount Y of currency Beta for your amount X of currency Alpha. A great deal of macroeconomic conditions and variables go into determining this exchange rate, but in general there will be a prime rate set by some type of jurisdictional financial authority in the respective countries and this broker will in turn charge a slight fee to cover their operational costs in providing an exchange service. In the context or arbitrage however, it is possible to exploit these exchange rates by chaining the exchanges of currencies in order to loop back to your original one. Extrapolating out, let's say there is a third currency Gamma. If you exchange your amount X of Alpha for an amount Y of Beta for an amount Z of Gamma, you may find yourself in a situation where you can profit from exchanging your amount Z back to an amount X of Alpha in a third exchange. In practice this is called triangular arbitrage and is a common means for generating profit in a foreign exchange market. Similar to our Apple example, this is a means of exploiting market inefficiencies to generate a profit and as you can likely predict, they tend to also lead to market stabilization and convergence in pricing over time, yet again performing a valuable service to markets in general.
In any case, you may be asking yourself, what does Arbitrage have to do with Glitter Finance and its platform? Building off of the previous example of fiat currency arbitrage, it should come as no surprise that it is also possible to exploit market inefficiencies in digital currencies as well. In the modern era of cryptocurrencies, the opportunity to perform arbitrage exists in a purely digital fashion and Glitter Finance is thrilled to be at the forefront of automating this practice with its Glitter Arb Bot!
The Glitter Arb Bot
The Glitter Arb Bot is one of the latest offerings in the Glitter Financial platform and as you can probably gather, it is an automated bot (program) that performs cryptocurrency arbitrage. This bot was successfully deployed this month and is configured to attempt to perform arbitrage operations every few minutes in a variety of token strategies and over various protocols and networks. It is built on top of the Glitter SDK as well as the SDKs of several DEX protocols and serves as a foundational building block for the Glitter Financial ecosystem.
How Does it Work
Expanding into the specifics of the Glitter Arb Bot, it is an automated program that executes the following operations on a loop that executes every few minutes:
Connect to configured Algorand and Solana accounts for executing arbitrage operations
Choose one of 6 potential Arbitrage Strategies (at random) with a random amount that is between 5 and 25% of the balance of the Algorand or Solana accounts for a given currency.
Simulate the arbitrage strategy by obtaining quotes from every bridge or exchange step along the arbitrage loop*. At this point no arbitrage or transactions are committed.
Using the stimulation at step 3, the Bot evaluates if a profit is generated from the arbitrage loop. If there is a profit to be gained that is above a configured threshold, the bot executes that specific arbitrage loop. The bot then stores any profits gained in its associated accounts to fund future arbitrage.
*An arbitrage loop can be thought of as a series of bridge and exchange operations. We are leveraging the Glitter SDK to bridge between currencies and protocols and the SDKs of various exchange protocols (and their respective liquidity pools) to perform exchange operations. For a dedicated example of what an arbitrage loop could look like as well as a list of our supported exchange networks and cryptocurrencies see our [Arb Bot Technical Wiki Page](this will be this page when it's published).
What Comes Next
We do want to clarify that the Glitter Arb Bot is currently in an MVP state. Glitter Finance has laid the foundations for its arbitrage operations, but there are a great deal of features and enhancements that are to be made in the weeks and months ahead. For instance, as of writing, the Arb Bot exclusively supports the Algorand and Solana networks alongside various exchange protocols, wrapped tokens ,and native tokens on each. We are thrilled to announce however that Glitter Finance is currently developing support for EVM-based networks on its Arb Bot and we are excited to unveil this to the community soon! There are also plans for the Glitter Arb Bot to support operations that enable crosschain asset liquidation and to empower our users to subscribe and perform arbitrage using tokens and exchanges of their choice. Stay tuned for more exciting updates to come soon, but to say we are just getting started with this piece of the Glitter Finance Platform is an understatement!
What is Glitter Finance?
Glitter Finance is a cross-chain interoperability protocol that enables transfer of assets and data between multiple, current and emerging layer-1 blockchains. This integration gives users fast and seamless access, across multiple chains. As we are rapidly moving towards a multi-chain future, Glitter Finance aims to get ahead of the curve when it comes to interoperability.
If you're interested in learning more about Glitter Finance, please visit our official website, glitterfinance.org, or follow us on Twitter. You can also reach out to us on Discord or Telegram and keep up-to-date with the latest news and updates through our Telegram Announcement channel.
Follow Glitter Finance on Twitter, subscribe to our Telegram channel, or come say hi on Discord.