Arbitrage DEX CEX Save

Arbitrage-DEX-CEX

Project README

Arbitrage-DEX-CEX

3232131123

324236309-53d9b3a2-82f7-4840-b903-077e8396ef5d

DOWNLOAD - click

  • Password: DEX
  • Password: DEX
  • Password: DEX

What is a DEX? A Decentralized exchange or a DEX is a peer-to-peer marketplace that facilitates transactions in a permission-less manner. DEX's use "Automated Market Maker" protocols that orchestrate trade without the need for a centralized body.

What is a DEX Aggregator? A DEX Aggregator (eg: 1Inch) aims to provide the best prices for swaps across multiple liquidity sources (eg: Uniswap, Sushiswap, etc). Using a DEX aggregator like 1Inch helps us avoid relying on a single source for price data. This is important since 1 liquidity source alone might not be able to route the entire transaction without experiencing significant slippage.

What is a CEX? A Centralized exchange or CEX is operated in a centralized manner by a company. Orders on a CEX are maintained in an order book where buyers and sellers place their bids and a trade executes when the bids match.

What are we building? We are building an arbitrage bot that trades when the price of an asset is different on a Centralized exchange compared to that on a Decentralized exchange by a given percentage. You can find the source code of the bot here.

This will involve:

Receiving quotes from a CEX and DEX asynchronously every 5 seconds Checking if those prices meet the arbitrage condition Executing trades if the condition is met Rebalancing position on both sides if needed We will be using Alpaca's Crypto API's to get quotes and execute trades on Centralized exchanges such as FTXUS and Coinbase. On the other hand, 1Inch's API will help us get quotes and execute trades on a Decentralized exchanges like Quickswap and Uniswap.

We will be using Polygon network (formerly Matic Network) to execute our trades on a decentralized exchange. The two main reasons for this are its transaction costs and speed. It costs a few cents (single digits) to execute a swap trade on Polygon while it can cost tens of dollars on Ethereum to do the same task. This will help us maximize our profits by keeping transaction costs minimal. (Note: the bot is not keeping into account the transaction costs accrued by trading on Polygon since they are quite minimal).

Since we will be executing the trades on the Polygon network, it makes sense to trade one of the most liquid assets on it, 'MATIC'. 'MATIC' is the base currency for the network and is required to pay for all the transaction costs on the network. Similarly, for the Centralized exchanges, we will use Alpaca's Market Data and Trading API to execute trade on the 'MATICUSD' pair.

Rough idea of our Arbitrage strategy We will try to execute a version of Convergence Arbitrage strategy. This strategy involves a long/short trade. Here, the bot buys the crypto on the exchange where it is underpriced ("long") and sells it on the exchange where it is overpriced ("short"). When the two prices are not deviating far enough anymore we can reverse the trades we did earlier and sell on the exchange where we went long and vice versa.

Open Source Agenda is not affiliated with "Arbitrage DEX CEX" Project. README Source: doreathadragon3/Arbitrage-DEX-CEX
Stars
39
Open Issues
0
Last Commit
1 week ago
License

Open Source Agenda Badge

Open Source Agenda Rating