Skip to content

dewiz-xyz/tycho-simulation-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tycho Simulation Server

A WebSocket server implementation for TypeScript Tycho simulation, providing real-time price simulation services.

Description

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.

Features

  • Real-time WebSocket communication
  • Price simulation service
  • Built with Axum web framework
  • Async runtime with Tokio
  • Structured logging with tracing framework

Prerequisites

  • Rust (latest stable version)
  • Cargo (Rust's package manager)
  • PostgreSQL (for database functionality)

Installation

  1. Clone the repository:

    git clone https://github.com/dewiz-xyz/tycho-simulation-server.git
    cd tycho-simulation-server
  2. Copy the environment file and configure it:

    cp .env.example .env

    Update the .env file with your specific configuration.

  3. Build the project:

    cargo build --release

Configuration

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)

Usage

To run the server:

cargo run --release

The server will start on the configured host and port.

Dependencies

Key dependencies include:

  • tycho-simulation: Core simulation engine
  • tokio: Async runtime
  • axum: Web framework
  • serde: Serialization framework
  • anyhow: Error handling
  • tracing: Structured logging
  • tracing-subscriber: Configurable logging output

Project Structure

  • src/api: API router and endpoint definitions
  • src/config: Configuration management
  • src/handlers: Request handlers (WebSocket, stream)
  • src/models: Data models and state definitions
  • src/services: Business logic and core functionality
  • main.rs: Application entry point and initialization

License

This project is licensed under the MIT License.

Repository

https://github.com/dewiz-xyz/tycho-simulation-server

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

Tycho Simulation WS Server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages