|
| 1 | +# DEX Trade Performance Analyzer |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +This application is designed to analyze the trading performance of a crypto wallet, leveraging the capabilities of Syve's [DEX Price Data & Wallet Tracking APIs](https://marketplace.quicknode.com/add-on/syve-dex-price-data-and-wallet-tracking-api). The primary focus of this application is to provide users with detailed insights into wallet trading activities, including profit and loss metrics for each traded token. |
| 6 | + |
| 7 | +For an in-depth guide on how to fetch data and develop further functionalities, refer to [our comprehensive guide on QuickNode](https://www.quicknode.com/guides/quicknode-products/marketplace/how-to-track-dex-wallet-trading-performance). |
| 8 | + |
| 9 | +### Tech Stack |
| 10 | + |
| 11 | +- Frontend Framework/Library: React |
| 12 | +- Language: TypeScript |
| 13 | +- Build Tool/Development Server: Vite |
| 14 | +- Styling: Tailwind CSS |
| 15 | + |
| 16 | +## Features |
| 17 | + |
| 18 | +- **Overall Wallet Performance**: Displays total profit and loss, win rate, and other key metrics using Syve's Wallet Tracking API. |
| 19 | +- **Token-Specific Performance**: Provides detailed trading metrics for each token held in the wallet. |
| 20 | + |
| 21 | +## Getting Started |
| 22 | + |
| 23 | +### Prerequisites |
| 24 | + |
| 25 | +Before you begin, ensure you have the following: |
| 26 | + |
| 27 | +- [Node.js](https://nodejs.org/en/) installed on your system. |
| 28 | +- A QuickNode account with the [DEX Price Data & Wallet Tracking APIs](https://marketplace.quicknode.com/add-on/syve-dex-price-data-and-wallet-tracking-api) enabled. |
| 29 | +- A code editor or an IDE (e.g., [VS Code](https://code.visualstudio.com/)) |
| 30 | +- [TypeScript](https://www.typescriptlang.org/) and [ts-node](https://typestrong.org/ts-node/) |
| 31 | + |
| 32 | +> You can run the commands below to install TypeScript and ts-node globally to have TypeScript available across all projects. |
| 33 | +
|
| 34 | +```bash |
| 35 | +npm install -g typescript ts-node |
| 36 | +``` |
| 37 | + |
| 38 | +### Installation Dependencies |
| 39 | + |
| 40 | +1. Clone the repository to your local machine: |
| 41 | + |
| 42 | +```bash |
| 43 | +git clone https://github.com/quiknode-labs/qn-guide-examples.git |
| 44 | +``` |
| 45 | + |
| 46 | +2. Navigate to the project directory: |
| 47 | + |
| 48 | +```bash |
| 49 | +cd sample-dapps/ethereum-dex-trade-performance-analyzer |
| 50 | +``` |
| 51 | + |
| 52 | +3. Install the necessary dependencies: |
| 53 | + |
| 54 | +```bash |
| 55 | +npm install |
| 56 | +``` |
| 57 | + |
| 58 | +### Setting Environment Variables |
| 59 | + |
| 60 | +Rename `.env.example` to `.env` and replace the `YOUR_QUICKNODE_ENDPOINT_URL` placeholder with your QuickNode Ethereum Node Endpoint. Make sure that the [DEX Price Data & Wallet Tracking APIs](https://marketplace.quicknode.com/add-on/syve-dex-price-data-and-wallet-tracking-api) are enabled. |
| 61 | + |
| 62 | +```env |
| 63 | +VITE_QUICKNODE_ENDPOINT="YOUR_QUICKNODE_ENDPOINT_URL" |
| 64 | +``` |
| 65 | + |
| 66 | +> Please note that while we utilize `dotenv` for environment variable management, sensitive information like endpoints can still be visible on the frontend. This configuration is not recommended for production environments as-is. |
| 67 | +
|
| 68 | +### Running the Application |
| 69 | + |
| 70 | +Run the development server: |
| 71 | + |
| 72 | +```bash |
| 73 | +npm run dev |
| 74 | +``` |
| 75 | + |
| 76 | +Open [http://localhost:5173/](http://localhost:5173/) with your browser to see the application. |
| 77 | + |
| 78 | +## Using the App |
| 79 | + |
| 80 | +1. Input a wallet address. |
| 81 | +2. Press **Analyze Wallet**. |
| 82 | +3. View the overall and token-specific trading performance. |
| 83 | + |
| 84 | +The **Wallet Performance Analyzer** will fetch the data using Syve's Wallet Tracking APIs, and display the results. |
| 85 | + |
| 86 | +Overall Performance | Token Specific Performance |
| 87 | +:-------------------------:|:-------------------------: |
| 88 | + |  |
| 89 | + |
| 90 | +## Conclusion |
| 91 | + |
| 92 | +Syve's [DEX Price Data & Wallet Tracking APIs](https://marketplace.quicknode.com/add-on/syve-dex-price-data-and-wallet-tracking-api) provide developers with powerful tools for analyzing wallet trading activities. By leveraging these APIs, developers can create applications that deliver valuable insights into crypto trading performance. |
| 93 | + |
| 94 | +[QuickNode](https://quicknode.com/) offers many different marketplace add-ons, providing developers with the resources needed to create robust and feature-rich crypto applications. To learn more about how these APIs and other QuickNode add-ons can benefit your projects, please [contact us](https://www.quicknode.com/contact-us); we're eager to assist you! |
0 commit comments