A trading platform for meme coins on the Solana blockchain.
- Real-time meme coin price tracking from multiple sources:
- DexScreener
- CoinGecko
- Jupiter
- Robust blockchain provider translation layer:
- Automatic fallback between providers
- Rate limiting and health monitoring
- Priority-based provider selection
- Thread-safe operations
- Price history tracking
- Secure wallet management with encrypted private keys
- Support for multiple DEX integrations:
- Raydium
- Orca
.
├── cmd/
│ └── api/ # API server entry point
├── internal/
│ ├── api/ # API handlers and middleware
│ ├── blockchain/ # Blockchain service and providers
│ │ ├── solana/ # Solana-specific implementation
│ │ └── types.go # Common blockchain interfaces
│ ├── repository/ # Database models and queries
│ └── services/ # Business logic
├── migrations/ # Database migrations
└── docker-compose.yml # Docker configuration
The application uses a robust provider translation layer that abstracts away differences between various blockchain providers. This ensures high availability and consistent behavior across different providers.
-
Provider Management
- Register multiple providers per network
- Configure provider priorities
- Automatic provider health monitoring
- Rate limit management per provider
-
Automatic Fallback
- Seamless switching between providers
- Handles rate limits and downtime
- Prioritizes providers based on health and configuration
-
Health Monitoring
- Tracks provider status (Healthy/Degraded/Unhealthy)
- Monitors consecutive errors
- Automatic recovery after failures
-
Rate Limiting
- Configurable requests per time window
- Automatic rate limit detection
- Graceful fallback when limits are reached
// Initialize the blockchain service
service := blockchain.NewService()
// Register primary provider
service.RegisterProvider(primaryProvider)
// Register backup provider with custom configuration
service.RegisterProviderWithConfig(backupProvider, blockchain.ProviderConfig{
Priority: 2,
RequestsPerWindow: 1000,
WindowDuration: time.Minute,
HealthCheckPeriod: time.Minute,
MaxConsecutiveErrs: 3,
})
// Use the service - fallback is automatic
wallet, err := service.CreateWallet(ctx, blockchain.NetworkSolana)
-
GET /api/v1/memecoins
- Get list of top meme coins- Query parameters:
limit
(optional) - Number of coins to return (default: 50)
- Response includes:
- Basic coin information (symbol, name)
- Current price and market data
- Logo URL and description
- 24h price changes
- Query parameters:
-
GET /api/v1/memecoins/{id}
- Get detailed information about a specific coin- Response includes:
- All coin information
- Price history data
- Response includes:
-
POST /api/v1/memecoins/update
- Trigger update of meme coin data- Fetches latest data from all providers
- Updates database with new information
- Install dependencies:
make install
- Start the backend services:
make start-backend
- Start the mobile app:
make start-mobile
- Update meme coin data:
make update-memecoins
# Run all backend tests
make test-backend
# Run blockchain provider tests only
make test-blockchain
# Run specific provider tests (e.g., Solana)
make test-providers
# Run tests with coverage report
make test-coverage
# Run mobile app tests
make test-mobile
The project maintains comprehensive test coverage for the blockchain provider layer:
- Provider manager tests (registration, fallback, rate limiting)
- Health check and recovery tests
- Priority-based selection tests
- Thread safety tests
- Individual provider implementation tests
To view the test coverage report:
- Run
make test-coverage
- Open
coverage.html
in your browser
The project uses SQL migrations for database schema management. Migrations are automatically applied when starting the backend services.
To manually run migrations:
migrate -path migrations -database "postgres://user:password@localhost:5432/memetrader?sslmode=disable" up
To revert migrations:
migrate -path migrations -database "postgres://user:password@localhost:5432/memetrader?sslmode=disable" down
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.