Different Models In GamaX Algorithm
1. Two Point Arbitrage
Make a trade when there is a price difference between two coins and two exchanges.
To trade, you also need a large enough amount of money. For example, if you see an opportunity to trade BTC-USDT between two exchanges A and B, you will buy (x) BTC on exchange A and simultaneously execute a sell order (x) BTC on exchange B. So you must have available assets, including BTC and USDT, on both exchanges A and B.
In the current cryptocurrency market, we have two different types of exchanges called CEX (Centralized Exchange) and DEX (Decentralized Exchange). Thus we have the following arbitrage types:
- Arbitrage between two CEX exchanges: For example, let's arbitrage the BTC-USDT pair between Binance and Huobi.
- A relative amount of capital is needed because we need to have assets available for two currencies on both exchanges.
- It takes a long time to balance the accounts between the two parties.
- There is a considerable risk because API exchanges often have problems when the market fluctuates wildly.
- Arbitrage between CEX and DEX: For example, let's arbitrage the BAKE-USDT pair between Binance and BakerySwap.
- A relative amount of capital is needed because we need to have assets available for two currencies on both exchanges.
- It takes a long time to balance the account between the two parties (But lower than between the two CEX exchanges)
- Considerable risk because API exchanges often have problems when the market fluctuates strongly (But lower than between the two CEX exchanges)
- Arbitrage between two DEX: For example, let's arbitrage the BNB-BUSD pair between Pancake and BakerySwap.
- Less capital is required and the lowest risk
- More complicated and must be done via Smart Contract.
- Competition is high as a lot of bots do this.
- Bunnybot implements this algorithm but on liquidity pools, reading validator when blocks have just been generated makes orders execute faster, avoiding liquidity loss due to order delay or wallet confirmation time.
2. Three Points Arbitrage / Triangular Arbitrage
This arbitrage is more complicated, so it usually has the following types:
- Arbitrage 3 points on 1 CEX exchange: Example arbitrage 3 BTC-BNB-ETH currency pairs with the base currency BTC on Binance exchange.
- Binance Triangle Arbitrage => Runs quite okay but has almost no chance => There may be many bots running now with virtually no chance.
- Triangular-arbitrage
- Crypto Arbitrage – Triangular or Exchange Arbitrages
- Just have the property of 1 type available.
- Arbitrage 3 points between one or more DEX
- This is a complex algorithm that bunnybot frequently uses
- Direct arbitrage on liquidity pools is more secure than CEX exchanges
- Multipoint Arbitrage between one or more DEX
- Multi-point arbitrage requires a routing algorithm and calculates with the fastest speed to ensure transaction execution.
- Asynchronous processing and tax in pools, requests run on metanodes and super fast server response speed and bandwidth
- The number of different orders is much, but the small transaction amount does not lose liquidity. Therefore, it requires a relatively large number of bots to run. The downside is that the profit is not high but stable.
3. Crosschain Arbitrage
- Crosschain or Bridge is a bridge that connects two different networks. ETH network A-B pair and BNB chain network A-B pair
- Claim assets on two networks and a relatively large amount
- Affected by cross-chain fees and gas fees
- Relatively large profit
4. Flash Loan
- Flash Loan is a feature that allows investors to borrow money without collateral, but they have to pay back the borrowed amount in the same transaction. That is, investors will borrow a certain amount of money and repay them in a sufficient time to complete a block of transactions.
- How it works: Use instant loans and arbitrage across pools to get the difference after deducting interest.
- In quick loans, money is borrowed and paid back within seconds in a single transaction. The smart contract will set the terms and execute instant transactions on behalf of the borrower. If the quick loan is profitable for the borrower, this loan will be charged interest (about 0.09%).
Example: How fast loans on Aave work:
- Borrowers apply for quick loans on Aave.
- Borrowers will create an exchange logic, i.e., they will use that loan to make a profit.
- Borrowers repay the loan if they make a profit on it and then pay an additional fee of 0.09% of the borrowed amount.
- If the user does not repay the borrowed amount, the loan will be disabled.
Flash Loan Arbitrage
Flash Loans can generate profits for investors in case of arbitrage. Suppose, in the DAI/USDC pool, there is a price difference between Uniswap and Curve. In this case, users can trade 1 DAI for 1 USDC on Curve, but if trading on Uniswap, then 0.99 DAI can be used to buy 1 USDC. Now you can try arbitrage like this:
- Borrow 100,000 DAI from Aave through a quick loan
- Exchange 100,000 DAI for USDC on Uniswap and get 101,010 USDC
- Exchange 101,010 USDC for 101,010 DAI on Curve
- Initial 100,000 DAI refund + 0.09