generated from readthedocs/tutorial-template
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c74ef4c
commit 6316058
Showing
6 changed files
with
479 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
# Arbit Documentation | ||
|
||
[Arbit](https://github.com/ConnecMent/arbit) is a simple and intuitive arbitrage platform designed for decentralized trading on the Ergo and Cardano blockchains. It aims to simplify the arbitrage process, enabling users to identify and execute profitable swaps with minimal setup. | ||
|
||
/// details | WIP | ||
{type: warning, open: true} | ||
This project is a work in progress and is not yet ready for production use. | ||
/// | ||
|
||
|
||
--- | ||
|
||
## Overview | ||
|
||
**What is Arbit?** | ||
|
||
Arbit streamlines the process of arbitrage trading by providing a clean and simple interface. The platform identifies opportunities where a user can buy and sell tokens across different decentralized exchanges to make a profit. | ||
|
||
- **Supported Tokens:** ERG, ADA, and RSN. | ||
- **Supported Exchanges:** Ergo Dex and Splash. | ||
- **Core Features:** | ||
|
||
- Predefined arbitrage strategies (called "Arbits"). | ||
- Focus on simplicity and usability. | ||
- Execution of swaps with just a few clicks. | ||
|
||
**What is an Arbit?** | ||
|
||
An Arbit is a series of swaps that generate profit. For example: | ||
|
||
1. Sell 100 X tokens on Exchange A for $100. | ||
2. Buy 105 Y tokens on Exchange B for the same $100. | ||
3. Profit from the additional 5 Y tokens. | ||
|
||
--- | ||
|
||
## Key Features | ||
|
||
### Simplicity and Usability | ||
|
||
- Designed for users with basic blockchain knowledge. | ||
- Clear interface with no distractions or unnecessary complexity. | ||
- Profitability of swaps displayed prominently. | ||
|
||
### Fixed Arbitrage Strategies | ||
|
||
- Supports predefined arbitrage paths, such as: | ||
|
||
- ERG ↔ ADA | ||
- RSN ↔ ADA | ||
|
||
- Profit calculations are based on fixed USD values ($50 and $100). | ||
|
||
--- | ||
|
||
## How It Works | ||
|
||
1. **Arbitrage Strategy Execution:** | ||
|
||
- Predefined paths calculate profitability based on current market conditions. | ||
- Fixed token values ($50 and $100) are used for calculations to avoid complexity. | ||
|
||
2. **Supported Providers:** | ||
|
||
- **Ergo Dex:** Facilitates ERG and ADA swaps. | ||
- **Splash:** Enables swapping of RSN and ADA tokens. | ||
|
||
3. **Profit Calculation:** | ||
|
||
- Example for a $50 swap: | ||
- Sell $50 worth of rsADA on Ergo Dex for ERG. | ||
- Swap ERG for ADA on Splash. | ||
- Compare the ADA received with the initial $50 equivalent. | ||
|
||
--- | ||
|
||
## Deployment | ||
|
||
### Local Setup | ||
|
||
1. **Clone the Repository:** | ||
|
||
```bash | ||
git clone https://github.com/ConnecMent/arbit.git | ||
cd arbit | ||
``` | ||
|
||
2. **Set Up Environment Variables:** | ||
|
||
Create a `.env` file in the root directory with the following variables: | ||
|
||
- `SPLASH_API_URL`: API URL for Splash exchange. | ||
- `ERGO_EXPLORER_API_URL`: API URL for Ergo Explorer. | ||
|
||
Example: | ||
|
||
```env | ||
SPLASH_API_URL=https://api.splash.exchange | ||
ERGO_EXPLORER_API_URL=https://api.ergoplatform.com | ||
``` | ||
|
||
3. **Run the Development Server:** | ||
|
||
Install dependencies and start the development server: | ||
|
||
```bash | ||
pnpm install | ||
pnpm run dev | ||
``` | ||
|
||
The application will be available at `http://localhost:3000`. | ||
|
||
--- | ||
|
||
## Arbitrage Strategies | ||
|
||
The following strategies are implemented in Arbit: | ||
|
||
### ERG ↔ ADA Arbitrage | ||
|
||
- Leverages Ergo Dex and Splash to identify profitable swaps between ERG and ADA. | ||
- Calculations consider both direct and reverse swap paths for maximum opportunities. | ||
|
||
### RSN ↔ ADA Arbitrage | ||
|
||
- Utilizes Ergo Dex and Splash for swaps between RSN and ADA tokens. | ||
- Similar profit calculation methods as the ERG ↔ ADA strategy. | ||
|
||
--- | ||
|
||
## Technical Details | ||
|
||
### Core Arbitrage Logic | ||
|
||
The core logic for arbitrage is implemented in `src/arbitrategy.ts`. It defines a set of predefined strategies for swapping between supported tokens and providers. | ||
|
||
### Provider Integrations | ||
|
||
- **Ergo Dex (`src/providers/ergodex.ts`):** | ||
|
||
- Interacts with the Ergo Dex SDK for swapping tokens. | ||
- Supports `x2y` and `y2x` operations. | ||
|
||
- **Splash (`src/providers/splash.ts`):** | ||
|
||
- Uses the Splash API to fetch order book data. | ||
- Supports bid/ask matching for liquidity and price calculations. | ||
|
||
--- | ||
|
||
## Usage Guide | ||
|
||
1. **Prepare Tokens:** | ||
|
||
- Ensure you have supported tokens (ERG, ADA, RSN) on Ergo and Cardano chains. | ||
- Use [Rosen Bridge](https://app.rosen.tech) to bridge assets if necessary. | ||
|
||
2. **Visit the App:** | ||
|
||
- Open the application and review the displayed arbitrage opportunities. | ||
|
||
3. **Execute a Swap:** | ||
|
||
- If a profitable Arbit is available, execute the swap by following the on-screen instructions. | ||
|
||
--- | ||
|
||
## Contributing | ||
|
||
The project is maintained by [ConnecMent](https://github.com/ConnecMent). Contributions are welcome via pull requests. | ||
|
||
**Team:** | ||
|
||
- Mentors: [@mkermani144](https://github.com/mkermani144), [@fatemeh-ra](https://github.com/fatemeh-ra) | ||
- Mentee: [@SeyedMojtaba1](https://github.com/SeyedMojtaba1) | ||
|
||
Special thanks to [@zargarzadehm](https://github.com/zargarzadehm) for Ergo Dex SDK insights. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## Off the Grid | ||
|
||
Off the Grid is a decentralized application (dApp) that builds on the grid trading contract proposed by kushti. It includes an execution bot/batcher for automating order matching without user interaction. | ||
|
||
Explore the project [here](https://github.com/Telefragged/off-the-grid/) and check out our [Getting Started Guide](off_the_grid_tut.md). | ||
|
||
### Features | ||
|
||
Off the Grid provides the following features: | ||
|
||
- Utilizes a contract that permits spending only if orders are correctly filled or with the order owner's signature. This contract can manage multiple orders simultaneously. | ||
- Employs off-chain bots/batchers to monitor grid orders and match them against other liquidity sources. | ||
- Currently, it matches orders against Spectrum Automated Market Makers (AMMs). However, it can be extended to other sources like the SigUSD bank. | ||
- Supports trading of ERG against any token, with profits accumulated in ERGs. | ||
- Enables grid orders to profit from repeated execution of the same orders, while bot operators benefit from arbitraging the price difference between the liquidity source and grid orders. | ||
|
||
This concept was introduced by `@kushti` on [ergoforum](https://www.ergoforum.org/t/decentralized-grid-trading-on-ergo/). | ||
|
||
> "We can do decentralized grid trading on Ergo (which is automatically compatible with existing DEXes, such as Spectrum LP pools and babel fees). Grid trading is a good way to make profits from volatility, and many CEXes offer it." | ||
Check out the [first decentralized grid order transaction on Ergo](https://twitter.com/chepurnoy/status/1582657292834861057). |
Oops, something went wrong.