Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maseurodrigo/soltrack
Simple web interface for tracking Solana wallet balances and PnL's
https://github.com/maseurodrigo/soltrack
railway-app solana
Last synced: 24 days ago
JSON representation
Simple web interface for tracking Solana wallet balances and PnL's
- Host: GitHub
- URL: https://github.com/maseurodrigo/soltrack
- Owner: maseurodrigo
- License: mit
- Created: 2025-01-02T04:06:12.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-01-10T07:14:45.000Z (28 days ago)
- Last Synced: 2025-01-10T08:26:54.509Z (28 days ago)
- Topics: railway-app, solana
- Language: JavaScript
- Homepage: https://soltrack.up.railway.app/
- Size: 1.16 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SolTrack
**SolTrack** is a lightweight, real-time web application built with Next.js for tracking Solana wallet balances and calculating daily, weekly, and monthly profit and loss (PnL) statistics.
---
![SolTrack Dashboard](./soltrack.png)
---
## Features
- **Real-Time Balance Tracking**: Displays the current balance of any Solana wallet.
- **PnL Calculations**:
- Daily PnL
- Weekly PnL
- Monthly PnL
- **Database Integration**:
- Weekly and monthly start dates and balances are stored in a database.
- **Automatic Refresh**: The dashboard automatically refreshes every 5 seconds.---
## Prerequisites
To run this project, ensure you have the following installed:
- **Node.js 16+**
- **npm** (Node package manager)
- **PostgreSQL**---
## Installation
1. **Clone the Repository**:
```bash
git clone https://github.com/maseurodrigo/SolTrack.git
cd SolTrack
```2. **Install Dependencies**:
```bash
npm install
```3. **Set Up Environment Variables**:
Create a `.env` file in the project root and define the following variable:
```env
DATABASE_URL="postgresql://:@:/"
```Replace ``, ``, ``, ``, and `` with your PostgreSQL credentials.
4. **Initialize Prisma**:
Run the following commands to set up Prisma:
```bash
npx prisma db push
npx prisma generate
```5. **Run the Application**:
```bash
npm run start
```6. **Access the Dashboard**:
Open your browser and navigate to `http://localhost:8080`.
---
## Usage
### Querying a Wallet Address
To track a wallet, enter the wallet address in the input field on the dashboard and click "Track Wallet."
### Optional Features
- **Weekly PnL**: Enable the "Show Weekly PnL" toggle to display weekly profit and loss.
- **Monthly PnL**: Enable the "Show Monthly PnL" toggle to display monthly profit and loss.---
## Configuration
- **RPC URL**: The Solana RPC endpoint is set to the mainnet by default.
- **Refresh Interval**: The default data refresh interval is 5 seconds.
- **Database Storage**:
- Weekly and monthly start dates and balances are stored in a PostgreSQL database.### Prisma Schema
The database structure is managed using Prisma ORM with the following schema:
```prisma
model UserData {
wallet String @id
weekStartDate DateTime @map("week_start_date")
weekStartBalance Float @map("week_start_balance") @db.Real
monthStartDate DateTime @map("month_start_date")
monthStartBalance Float @map("month_start_balance") @db.Real
}
```---
## License
This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.