TRusT-AI is a complete orchestration and execution ecosystem for autonomous agents on DeFi platforms and DEXs (Uniswap v4 / Unichain). It combines the performance and memory safety of Rust for high-frequency on-chain monitoring, a TypeScript orchestrator for flexible LLM integration (multi-AI provider), and a modern React dashboard focused on decision transparency, multi-provider AI support, and end-user risk management.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ USER DASHBOARD (React / TS) โ
โ โข Wallet Connection & Agent Status โ
โ โข AI Provider & API Key Configuration โ
โ โข Risk Parameters (Slippage / Stop-Loss) โ
โ โข Pair Selector & AI Throttle Control โ
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โ WebSocket / REST
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SERVER & AI ORCHESTRATOR (Node / TS) โ
โ โข Multi-AI Gateway (OpenAI/Claude/DeepSeek/ โ
โ Local Ollama / Mock Engine Fallback) โ
โ โข Strategic Reasoning & Risk Analysis โ
โ โข Pair Filter & Rate Limiter (Throttle) โ
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP Triggers / IPC
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ EXECUTION ENGINE (Rust / Tokio) โ
โ โข Real-time Block / Pool Listening โ
โ โข Swap Simulation (eth_call) & Gas โ
โ โข Execution on Unichain / EVM Networks โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Note: The Rust engine emits synthetic block triggers for high-frequency market analysis, while the Node/TS orchestrator performs live on-chain price resolution directly from the Uniswap v4
slot0pool state over the user's RPC (with fallback to CoinGecko and synthetic data, stamped with a liveโ LIVE POOLorโ MARKETbadge in the dashboard). See docs/ROADMAP.md.
crates/engine(Rust Worker): Rust 2021 withtokioasync runtime,ethers-rs/alloyready. Listens to high-frequency EVM / Unichain events, computes liquidity metrics, and executes simulation calls.apps/server(TypeScript Orchestrator): Express server and WebSocket gateway in Node.js/TS. It is the decision brain of the agent, connecting user prompts to multiple LLM providers. Includes a trading-pair filter and an AI-call rate limiter.apps/web(React Dashboard): React + Vite + Vanilla CSS. Real-time log visualization, transaction history, dynamic AI selector, trading-pair selector, analysis interval control, and an emergency pause button.
- Node.js: v20+
- Rust: v1.80+ (
x86_64-pc-windows-msvctoolchain recommended on Windows)
cd apps/server
npm install
npm run devcd crates/engine
cargo runcd apps/web
npm install
npm run devOpen http://localhost:5173 in your browser. The dashboard shows โWS LIVEโ
once it connects to the server; the server console shows the engine triggers
once both are running.
Wallet connections run through Reown AppKit + wagmi (2.x) as one shared
store (apps/web/src/wallet/):
- Browser: click Connect Wallet โ MetaMask/Rabby connect via the wagmi
injectedconnector (or pick them inside the AppKit modal). - Desktop .exe / no extension: the AppKit modal opens a WalletConnect
QR code / mobile deep link; the session is bridged into the same wagmi store
(
@reown/appkit-adapter-wagmi), so the header pill, the network selector and the swap card all update instantly โ no desync between the modal and the header. - The header pill shows the connected address + active chain; the network dropdown switches the chain inside the wallet; the โ button disconnects.
- Swaps are executed from the user's own wallet on Uniswap v4 (the
primary route, via the Universal Router โ live and validated on Unichain
Sepolia): ERC-20 inputs are pulled through Permit2 (token โ Permit2
approve, then Permit2 โ router approve), and the router sends the output
straight back to
msg.sender, so no calldata patching is needed. The legacy v3 route was removed (2026-09-15) โ the codebase is v4-only. Non-custodial end to end โ the agent only proposes; the wallet signs.
Version pin: Reown AppKit is only compatible with wagmi 2.x โ do not bump
wagmito 3.x without checking@reown/appkit-adapter-wagmisupport.
Copy .env.example to .env and adjust as needed:
# Multi-AI Provider Config (mock | openai | anthropic | deepseek | gemini | ollama_cloud | ollama)
# NOTE: the code reads LLM_PROVIDER, not AI_PROVIDER.
LLM_PROVIDER=mock
# Fallback key; the key typed in the dashboard (localStorage) takes precedence
AI_API_KEY=
# Local LLM (optional)
OLLAMA_BASE_URL=http://localhost:11434
# Real RPC link โ paste your provider URL (Alchemy / Infura / QuickNode / public)
# Validated at startup by the engine; used by the orchestrator for live Uniswap v4 slot0 pool price feeds and quoter calculations.
NETWORK_NAME=sepolia
RPC_HTTP_URL=
RPC_WEBSOCKET_URL=
# Default per-signal trade budget (ETH) โ the user-set cap the agent may
# propose per trade; the dashboard lets users override it (> 0, < balance).
MAX_TRADE_AMOUNT_ETH=0.25
# Ports
SERVER_PORT=3001Note: when
RPC_HTTP_URL/RPC_WEBSOCKET_URLare configured (or set via the UI RPC Plug-in), the Rust Engine validates the RPC connection at startup (eth_chainId+eth_blockNumber) and the Orchestrator uses it to fetch real-time Uniswap v4slot0pool prices and liveV4Quoterswap rates (price_source: pool).PRIVATE_KEYandENGINE_PORTstay reserved/unused (the platform is non-custodial and zero-storage).The RPC plug-in (dashboard โ ๐ API Keys โ RPC Provider Plug-in) lets users paste an Alchemy/Infura/QuickNode link from the UI instead of editing
.env: the orchestrator keeps it in memory and the engine pulls it from/api/rpc-configon its next start. Seedocs/ROADMAP.md,AGENTS.mdยง4/ยง7 anddocs/SECURITY.md.
TRusT-AI ships as a standalone Windows desktop application built with Tauri v2: a native (WebView2) window hosts the React dashboard while the Tauri shell spawns the TS orchestrator and Rust engine as bundled sidecar executables โ the end user never installs Node.js or Rust.
- The orchestrator is compiled into a single
.exevia esbuild + Node SEA (Node's Single Executable Application,postjectinjection). - The Rust engine is built with
cargo build --releaseand bundled as a sidecar with its target-triple name. - The desktop shell binds the orchestrator to
127.0.0.1(no LAN exposure) and kills both sidecars when the window closes (no orphan processes on port 3001). - The installer (NSIS wizard, Start Menu shortcut, uninstaller) is produced by
Tauri and published with a
SHA256SUMS.txtso users can verify integrity.
npm install # root (concurrently)
cd apps/server && npm install
cd apps/web && npm install
cd apps/desktop && npm install
npm run build:desktop # from repo rootbuild:desktop chains: build:web โ server SEA exe (esbuild + Node SEA) โ
build:engine (cargo build --release) โ stage:engine (copies the engine
into the Tauri sidecar dir) โ build:desktop:shell (icons + tauri build).
The server SEA exe embeds the running node.exe and must therefore be built
on Windows (or in the windows-latest CI job). The engine is a normal Rust
binary; if you develop via WSL you can cross-build it with
npm run build:engine:windows (x86_64-pc-windows-gnu, needs mingw-w64 in
WSL) and npm run stage:engine picks it up automatically โ but the full
installer still needs the SEA server exe from Windows.
If a local Tauri dev/build fails with resource path 'binaries/trust-ai-engine-x86_64-pc-windows-msvc.exe' doesn't exist, build the
engine and copy the binary into the Tauri sidecar directory with the expected
platform-specific name:
npm run build:engine
cp "E:/rust_target/release/trust-ai-engine.exe" \
"apps/desktop/src-tauri/binaries/trust-ai-engine-x86_64-pc-windows-msvc.exe"PowerShell equivalent:
npm run build:engine
Copy-Item "E:\rust_target\release\trust-ai-engine.exe" \
"apps\desktop\src-tauri\binaries\trust-ai-engine-x86_64-pc-windows-msvc.exe" -Force(The exact source path depends on whether CARGO_TARGET_DIR is set; the
repo's active Windows config uses E:\rust_target.)
Artifacts:
apps/desktop/src-tauri/target/release/trust-ai-desktop.exeโ the appapps/desktop/src-tauri/target/release/bundle/nsis/*-setup.exeโ installer
# Compare against SHA256SUMS.txt from the GitHub Release
Get-FileHash .\TRusT-AI_0.1.0_x64-setup.exe -Algorithm SHA256.github/workflows/release-desktop.yml builds everything on a clean
windows-latest runner when a v* tag is pushed (or manually via
workflow_dispatch), and publishes the installer + SHA256SUMS.txt as a
GitHub Release.
SmartScreen note: the executables are not code-signed (open-source route). Windows will show an Unknown publisher warning on first run โ that is expected; verify the SHA-256 against the release. Code signing via Azure Trusted Signing is a documented roadmap item (
docs/SECURITY.md).
The full structured product & engineering roadmap (phases, session keys ERC-4337, Uniswap v4 hooks engine, backlog) lives in docs/ROADMAP.md.
Quick summary:
| Feature | Status |
|---|---|
| Session Keys (ERC-4337) | ๐ Planned |
| Multi-Chain Support | ๐ Planned |
| Multiple DEXs / Aggregators | ๐ Planned |
| WalletConnect / AppKit (incl. desktop WebView) | โ Implemented |
| Wallet state sync (single wagmi 2.x store) | โ Implemented |
| Uniswap v4 Custom Hooks Engine | ๐ฎ Future module |
| Backtesting Engine | ๐ก Backlog |
| Telegram/Discord Alerts | ๐ก Backlog |
| Multi-User Dashboard | ๐ก Backlog |
| Docker / Cloud Deploy | ๐ In progress (Phase 4) |
| Dynamic Pair Monitoring (DEX-style picker) | โ Implemented |
| Real Market Data in UI (CoinGecko prices + 24h change, top-100 picker) | โ Implemented |
| Live On-Chain Price Feed (Uniswap v4 slot0 + CoinGecko ratio) | โ Implemented |
| Per-Trade Budget + Signal Cancel | โ Implemented |
| RPC Plug-in (UI RPC config) | โ Implemented |
| Desktop Distribution (.exe) | โ Implemented |
Pull Requests are welcome! If you want to implement any of these features, open an issue or send a PR.
Distributed under the MIT license. See the LICENSE file for details.

