An open-source arbitrage bot for Nyan

Nyan.finance
2 min readDec 13, 2020

A current focus in development is the creation of an arbitrage bot that any individual can run locally for the benefit of the Nyan Fund and themselves. The bot will run as a chrome extension and allow any user to watch 3 currencies, with ETH being a required pair.

The Nyan arbitrage bot network will be built to run in a decentralized manner, allowing each user to watch their own preferred pools while allowing the arbitrage factory contract to set up and execute opportunities found by the bot. The factory contract will allow the user to either use funds from AAVE, the Nyan Fund, or their own personal ETH.

Users will be strongly recommended to create new unique addresses due the necessity of a private key for transaction automation. This address should be considered temporary and not meant for holding funds. This address will be used to pay associated gas fees with the execution of the spotted arbitrage opportunity.

How does it find the opportunity?

The primary constraints that will be set up around the bot will be the requirement for 2 tokens that share a pool together and with ETH individually. These tokens are up to the user and different users will find more profitable pools to watch. Multiple bot processes can be run simultaneously, with each process requiring a unique free Infura API key.

After these constraints are set, the bot will attempt to find the most profitable path out of all paths using the Bellman Ford algorithm. The trio of tokens(WETH, Token A, and Token B) will act as 3 vertice points, and the current Uniswap rates are used as the weights in order to run a loop to determine if a profitable path exists. If a profitable path does exist, it must be the most profitable path amongst profitable paths.

An example of how the Bellman Ford algorithm can be visualized using price data.

How are users rewarded?

The users that run a local bot node will receive 60% of all profits from successful arb opportunities. The remainder of the profits will be split in the following manner:
-Dev Fund: 10%
-Nyan Fund(as Nyan): 10%
-Nyan LPers: 15%
-Nyan-2 Holders: 5%

This structure will allow any individual to be able to run the bot on their browser, locally, and in the background, earning ETH. The bot uses no servers.

As a byproduct of the running bot, regular Nyan-2 token holders will be able to claim ETH from simply having Nyan-2 held within an address for a minimum amount of time.

Feel free to ask any questions around what the bot will entail in the telegram!

--

--

Nyan.finance

Nyan.finance is a Decentralized hedge fund focused on introducing beginners to Defi.