RUNE ARB BOT COMPETITION

Overview

THORChain will provide a 17,500 RUNE bounty for the best open-source arbitrage bot that can arbitrage between the following three pairs on Binance DEX:

  1. RUNE:BNB
  2. BNB:BUSD
  3. BUSD:RUNE.

Competition End Date: 13 May 2020

  • First Prize: 10,000 RUNE
  • Second Prize: 5,000 RUNE
  • Third Prize: 2,500 RUNE

Competition Purpose: To promote community development of open-source arbitrage platforms on RUNE markets.

Recommended Frameworks:

The bot should be able to:

  1. Import wallet keys locally
  2. Compare markets, log trade opportunities
  3. Open and close orders to take trade opportunities
  4. Log a running PNL

Judging Criteria:

  • Open-source
  • No compilation errors, clean, readable code.
  • Can import wallet and execute trades

Bonus Points:

  • Tests, Logging, PNL statement
  • LocalHost UI dashboard (simple)
  • Actually makes a profit

Point Of Contact: Admins in THORChain telegram community.

Competition Take-away: The community should take the chance to learn and build a simple bot that can find and take action on arbitrage opportunities. This will enable more users to become sophisticated market participants and will enable ASGARDEX to be supported by more entities who can maintain liquidity.

Arbitrage on THORChain

There are three user-types in THORChain:

  1. Users who need liquidity (swappers)
  2. Users who can provide liquidity (stakers)
  3. Users who can maintain liquidity (traders)

Maintenance of ASGARDEX pool liquidity is done by profit-seeking entities who simply try to buy low and sell high between two markets. They contribute to the system by transferring information from one market to another.

Importantly: the system does not care which market is correct, or what is actually the correct price. Once all profit-seeking entities have finished pushing and pulling on the market, then the final price must be the correct one. In reality, the market continually receives new information about an asset, and is perpetually converging to the correct price.

This raises an important question — how often should an asset price change? In an illiquid market, an asset price can change rapidly, however, has new information about that asset actually been published to warrant that price change — or is the price change “incorrect” and instead market participants should wait for it to “correct” back?

An example of this is 12 March 2020, when Bitmex order books imploded and the price of Bitcoin on that market theoretically could have gone to $0, if it were not for Bitmex’s “circuit-breaker”. Had information about Bitcoin been published that warranted Bitcoin to be valued at $0 — or was it just simply an inefficient, illiquid market?

THORChain seeks to return “price inertia” to assets. That is, asset prices in its pools cannot rapidly change price. The more impatient traders become, the more they have to pay in slip-based fees to liquidity providers. This transfers assets from the impatient to the patient, deepening liquidity and slowing price changes down. THORChain uses its own pools to provide both price information but also as liquidation mechanisms. This means it only cares about the information in its own system, and everything else is just “noise”. Over time, THORChain’s pools will become so deep they will instead force the entire market to slow down and inherit price inertia.

Arbitrage Basics

As an example, if the price of the asset in a THORChain pool (primary market) is $1.20, but the same asset on a different (secondary) market is $1.00, then someone can buy off the secondary market and sell into the THORChain pool profit.

How much profit is simply a question of liquidity.

Infinitely deep liquidity

If both markets are infinitely deep, then the following will occur:

  1. Secondary Market, Buy: $1.00, no price slip.
  2. Primary Market, Sell: $1.20, no price slip.
  3. Total Profit: 20%

The trader can then continue to arbitrage for a profit of 20% continuously.

Finite, but mismatched liquidity

If both markets have finite liquidity, but one is much deeper than the other, then the one of the markets will slip in price after the trade. However, the trader will experience a price that is roughly the average of the price before and after the trade:

  1. Secondary Market, Buy: $1.00, no price slip.
  2. Primary Market, Sell: $1.20, realised price of $1.10, price slip to $1.00.
  3. Total Profit: 10%

After the trade, there is no more price differential, but the trader made 10% in profit. The trader has made the pool price equal to the secondary market. They have transferred price information from one market to another.

Low liquidity

If both markets have low liquidity, then the trader is attempting to make trades that slip each market towards each other:

  1. Secondary Market, Buy: $1.00, realised price of $1.05, price slip to $1.10.
  2. Primary Market, Sell: $1.20, realised price of $1.15, price slip to $1.10.
  3. Total Profit: >10%

The market now has no more price differential. The trader has made each market equal to each other.

THORChain Community

To keep up to date with the project, please monitor community channels, particularly Telegram, Discord and Twitter:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store