Development¶
Prerequisites¶
- Go 1.21+
- Git
Setup¶
git clone https://github.com/DefaultPerson/solana-dex-parser-go.git
cd solana-dex-parser-go
go mod download
Build¶
Testing¶
Run all tests¶
Run integration tests¶
Integration tests use real Solana transactions via Helius RPC:
# Set environment variable
export HELIUS_API_KEY=your-api-key
# Run tests
go test ./tests -v -run TestIntegration
Run benchmarks¶
Project Structure¶
solana-dex-parser-go/
├── dex_parser.go # Main DexParser
├── shred_parser.go # ShredParser for gRPC
├── types/
│ ├── trade.go # TradeInfo, TokenInfo
│ ├── pool.go # PoolEvent
│ ├── meme.go # MemeEvent
│ └── common.go # ParseResult, ClassifiedInstruction
├── constants/
│ ├── programs.go # DEX program IDs
│ ├── discriminators.go # Instruction discriminators
│ └── tokens.go # Token constants
├── adapter/
│ └── transaction.go # TransactionAdapter
├── classifier/
│ └── instruction.go # InstructionClassifier
├── utils/
│ ├── utils.go # Helper functions
│ ├── binary_reader.go # Binary data parsing
│ └── transaction_utils.go
├── parsers/
│ ├── jupiter/ # Jupiter parsers
│ ├── raydium/ # Raydium parsers
│ ├── meteora/ # Meteora parsers
│ ├── orca/ # Orca parsers
│ ├── pumpfun/ # Pumpfun parsers
│ └── meme/ # Meme platform parsers
└── tests/
├── integration_test.go
└── benchmark_test.go
Contributing¶
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Run tests:
go test ./... - Commit:
git commit -m "feat: add my feature" - Push:
git push origin feature/my-feature - Open a Pull Request
Code Style¶
- Follow standard Go conventions
- Use
gofmtfor formatting - Add tests for new functionality
- Keep functions focused and small