A WebSocket server implementation for TypeScript Tycho simulation, providing real-time price simulation services.
Tycho Simulation Server is a Rust-based WebSocket server that interfaces with the Tycho simulation engine. It provides real-time price simulation services and is designed to be efficient and scalable.
- Real-time WebSocket communication
- Price simulation service
- Built with Axum web framework
- Async runtime with Tokio
- Structured logging with tracing framework
- Rust (latest stable version)
- Cargo (Rust's package manager)
- PostgreSQL (for database functionality)
-
Clone the repository:
git clone https://github.com/dewiz-xyz/tycho-simulation-server.git cd tycho-simulation-server
-
Copy the environment file and configure it:
cp .env.example .env
Update the
.env
file with your specific configuration. -
Build the project:
cargo build --release
The following environment variables can be configured in your .env
file:
TYCHO_URL
: Tycho API URL (default: "tycho-beta.propellerheads.xyz")TYCHO_API_KEY
: Your Tycho API key (required)TVL_THRESHOLD
: TVL threshold for filtering (default: 1000)PORT
: Server port (default: 3000)HOST
: Server host address (default: 127.0.0.1)RUST_LOG
: Logging level (default: info, options: error, warn, info, debug, trace)
To run the server:
cargo run --release
The server will start on the configured host and port.
Key dependencies include:
tycho-simulation
: Core simulation enginetokio
: Async runtimeaxum
: Web frameworkserde
: Serialization frameworkanyhow
: Error handlingtracing
: Structured loggingtracing-subscriber
: Configurable logging output
src/api
: API router and endpoint definitionssrc/config
: Configuration managementsrc/handlers
: Request handlers (WebSocket, stream)src/models
: Data models and state definitionssrc/services
: Business logic and core functionalitymain.rs
: Application entry point and initialization
This project is licensed under the MIT License.
https://github.com/dewiz-xyz/tycho-simulation-server
Contributions are welcome! Please feel free to submit a Pull Request.