diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ee030a..7fc85aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,9 +22,11 @@ - 添加外部参考库作为 Git 子模块:`noc` (notion-client) 与 `hype` (hyperliquid-rust-sdk)。 ### Changed +- 将项目与 Crate 命名从 `nosync` 统一重命名为 `tradesync`,并同步更新了所有 Rust 源码包导入和 Docker 镜像名称。 +- 更新 Docker Compose 配置,移除了 `tradesnap` 和 `tradesync` (原 `nosync`)多余的 volumes 目录挂载,并统一使用 `:latest` 镜像标签以替代固定版本。 - 移除 `Level` 字段的相关计算与 Notion 写入逻辑(交由用户后续手动设置)。 - 重构 `src/main.rs`,实现从 Hyperliquid WebSocket 捕获开仓事件并自动格式化写入 Notion Database 的闭环服务。 -- 将 `hyperliquid_rust_sdk` 与 `notion-client` 依赖方式更改为指向官方 Git 仓库的远程依赖,移除本地 Path 依赖。 +- 将 `hyperliquid_rust_sdk` 与 `notion-client` 依赖方式更改为指向官方 Git 仓库 of 远程依赖,移除本地 Path 依赖。 ### Removed - 移除初始化模版中未使用的占位模块 (`ModuleA`, `ModuleB`) 及其对应测试文件。 diff --git a/Cargo.lock b/Cargo.lock index 0bcc83b..a5cd260 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2963,25 +2963,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nosync" -version = "0.1.0" -dependencies = [ - "alloy 2.0.5", - "anyhow", - "chrono", - "dotenvy", - "hyperliquid_rust_sdk", - "notion-client", - "reqwest 0.13.4", - "serde", - "serde_json", - "thiserror 2.0.18", - "tokio", - "tracing", - "tracing-subscriber", -] - [[package]] name = "notion-client" version = "1.1.1" @@ -4770,6 +4751,25 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "tradesync" +version = "0.1.0" +dependencies = [ + "alloy 2.0.5", + "anyhow", + "chrono", + "dotenvy", + "hyperliquid_rust_sdk", + "notion-client", + "reqwest 0.13.4", + "serde", + "serde_json", + "thiserror 2.0.18", + "tokio", + "tracing", + "tracing-subscriber", +] + [[package]] name = "try-lock" version = "0.2.5" diff --git a/Cargo.toml b/Cargo.toml index 19fada3..76dc634 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nosync" +name = "tradesync" version = "0.1.0" edition = "2024" diff --git a/README.md b/README.md index 02a3bd2..65c0294 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# nosync +# tradesync An efficient, decoupled Hyperliquid wallet position monitor and Notion database logger. ## 1. Introduction -`nosync` is a real-time wallet position monitoring and analysis tool built with Rust. It subscribes to a specified Hyperliquid wallet address via WebSockets, captures position-opening trades in real-time, aggregates multi-tick partial fills of a single order (using a 500ms debounce aggregation mechanism), and automatically synchronizes the formatted trade data to a Notion database. +`tradesync` is a real-time wallet position monitoring and analysis tool built with Rust. It subscribes to a specified Hyperliquid wallet address via WebSockets, captures position-opening trades in real-time, aggregates multi-tick partial fills of a single order (using a 500ms debounce aggregation mechanism), and automatically synchronizes the formatted trade data to a Notion database. ## 2. Key Features * **Real-time Wallet Subscription**: Uses `hyperliquid-rust-sdk` to establish a persistent WebSocket connection to the wallet's `UserEvents`, sensing position changes at millisecond latency. @@ -17,7 +17,7 @@ An efficient, decoupled Hyperliquid wallet position monitor and Notion database The directory structure and modules are as follows: ``` -nosync/ +tradesync/ ├── src/ │ ├── lib.rs # Unified module exports │ ├── structs.rs # Data models and event definitions (e.g., NotionRowData) @@ -46,8 +46,8 @@ nosync/ ## 5. Getting Started ```bash # Clone the repository -git clone https://github.com/cathiefish/nosync.git -cd nosync +git clone https://github.com/cathiefish/tradesync.git +cd tradesync # Copy and configure environment variables cp .env.example .env @@ -64,10 +64,10 @@ cargo run --example demo ``` ## 6. Code Example -A minimal running example for the monitor is located at [examples/demo.rs](file:///home/cathiefish/App/nosync/examples/demo.rs): +A minimal running example for the monitor is located at [examples/demo.rs](file:///home/cathiefish/App/tradesync/examples/demo.rs): ```rust use alloy::primitives::address; -use nosync::HyperliquidMonitor; +use tradesync::HyperliquidMonitor; use tokio::sync::mpsc; #[tokio::main] @@ -123,4 +123,4 @@ cargo test ``` ## 9. Changelog -For a detailed log of project updates, please refer to [CHANGELOG.md](file:///home/cathiefish/App/nosync/CHANGELOG.md). +For a detailed log of project updates, please refer to [CHANGELOG.md](file:///home/cathiefish/App/tradesync/CHANGELOG.md). diff --git a/docker-compose.yml b/docker-compose.yml index 8c06506..84f2d6c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: - nosync: - image: ghcr.io/exchanges-lab/nosync:v1.0 - container_name: nosync + tradesync: + image: ghcr.io/exchanges-lab/tradesync:latest + container_name: tradesync env_file: - .env networks: diff --git a/examples/demo.rs b/examples/demo.rs index 9f70e8a..3e1ff39 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -1,6 +1,6 @@ use alloy::primitives::address; use anyhow::Result; -use nosync::HyperliquidMonitor; +use tradesync::HyperliquidMonitor; use tokio::sync::mpsc; use tracing::info; use tracing_subscriber::{EnvFilter, FmtSubscriber}; diff --git a/src/main.rs b/src/main.rs index 1b1b076..5be4d11 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ use anyhow::{Context, Result}; use chrono::{TimeZone, Utc}; use dotenvy::dotenv; -use nosync::{HyperliquidMonitor, NotionRowData, NotionWriter}; +use tradesync::{HyperliquidMonitor, NotionRowData, NotionWriter}; use std::env; use tokio::sync::mpsc; use tracing::{error, info}; diff --git a/tests/monitor_test.rs b/tests/monitor_test.rs index 96e1898..11af865 100644 --- a/tests/monitor_test.rs +++ b/tests/monitor_test.rs @@ -1,5 +1,5 @@ use alloy::primitives::address; -use nosync::HyperliquidMonitor; +use tradesync::HyperliquidMonitor; use tokio::sync::mpsc; use tokio::time::{Duration, timeout};