Back to App

Tetrac Documentation

Comprehensive guide to understanding, using, and contributing to Tetrac

Meet TTC

TTC (Tetrac) builds trading tools based on a decade of trading experience. We're here to make innovative trading tools to increase your productivity and make you more money in your trading journey.

What is Tetrac

Tetrac is a comprehensive trading terminal designed for cryptocurrency traders. It provides real-time market data, advanced charting capabilities, and streamlined trading interfaces to help traders make informed decisions. Built with modern web technologies, Tetrac offers a responsive and feature-rich experience for both novice and professional traders. TTC.BOX is also the first to integrate a multi exchange Crypto Bridge to MetaTrader5 for charting, trading, and a unified robot framework.

Why We Built This

We built Tetrac to address the lack of intuitive, feature-rich trading platforms specifically designed for cryptocurrency markets. Traditional trading platforms often lack the specialized tools needed for crypto trading, while existing crypto platforms can be overwhelming or lack professional-grade features.

Tetrac bridges this gap by combining the best aspects of professional trading platforms with the accessibility and flexibility needed for cryptocurrency markets. We needed to take the headache out of trading across several exchanges. Therefore, we streamlined the process to manage accounts easily across the ever expanding crypto derivatives markets.

Who This Is For

  • Professional cryptocurrency traders
  • Day traders looking for real-time data visualization
  • Investors who want to monitor multiple assets
  • Developers building trading applications who need a reference implementation

Features

Real-time tracking for all perpetual contracts
Simple and Pro Trading interfaces
Portfolio tracking and performance analytics
Customizable dashboards
Dark/light theme support
Responsive design for desktop, tablet, and mobile use
WebSocket integration for live data feeds
Multi-exchange Futures Trading (CEX | DEX)

Getting Started

Prerequisites

  • Node.js (version 16 or higher)
  • npm or yarn package manager
  • Git (for version control)

Installation

# Clone the repository
git clone https://github.com/your-username/ttc-box.git
# Navigate to the project directory
cd ttc-box
# Install dependencies
npm install
# or
yarn install

Running the Application

# Development server
npm run dev
# Production build
npm run build
# Start production server
npm start

API Documentation

Tetrac provides a comprehensive API for accessing market data, executing trades, and managing user accounts.

For detailed API documentation, please refer to the API Documentation page.

MT5 Documentation

Tetrac provides enhanced MetaTrader 5 integration with additional features and capabilities.

For detailed MT5 documentation, please refer to the MT5 Documentation page.

Debug Tooling

For detailed error codes, please refer to the Debugging utility. page.

Trading Functionality

Advanced Order Management

Our trading panel provides comprehensive order management capabilities:

  • Multiple order types: Market, Limit, Stop, and Reduce orders
  • One-Click trading with instant order execution
  • Real-time order status updates and notifications
  • Batch order operations: Cancel all orders or close all positions
  • Order book integration with best bid/ask functionality

Position Management

Comprehensive position tracking and management tools:

  • Real-time position monitoring with PnL calculations
  • One-click position closing
  • Position scaling with breakeven and lock-in features
  • Margin mode selection (Isolated/Cross)
  • Hedge mode support for two-way positions

Risk Management Tools

Advanced risk management features to protect your capital:

  • Dynamic leverage adjustment (1.5x to 50x)
  • Stop-loss and take-profit order placement
  • Position liquidation price monitoring
  • Auto-detection of hedge/one-way mode based on existing positions
  • "Save Me" feature to place protective orders near liquidation price

Exchange Integration

Seamless integration with multiple cryptocurrency exchanges:

  • Secure API key management with encrypted storage
  • Support for major exchanges including Binance, Bybit, OKX, and Perp DEX platforms such as Aevo, AsterDex, Orderly, and Quanto.
  • Automatic market data fetching and symbol search
  • Real-time balance and position synchronization

Trading Analytics

Overview

Tetrac provides comprehensive trading analytics tools to help you analyze your trading performance across multiple exchanges. Our analytics dashboard includes position history tracking, PnL analysis, win/loss statistics, and advanced charting capabilities.

Exporting Trade History

Export your complete position history to CSV or PDF format for offline analysis, backup, or sharing.

How to Export

  1. Navigate to the Trading Analytics page
  2. Select your exchange from the dropdown
  3. View your position history and analytics
  4. Click the CSV or PDF export buttons in the Position History section
  5. The file will download automatically

CSV Export Format

Filename: EXCH_WALL_YYYY-MM-DD.csv

Where:

  • EXCH - Exchange name (first 4 letters, uppercase)
  • WALL - Wallet identifier (4 characters, uppercase)
  • YYYY-MM-DD - Export date

CSV Columns:

Symbol,Side,Qty,Open Price,Close Price,Duration,Closed At,Realized PnL

PDF Export Features

  • Professional landscape layout
  • Includes all position history data
  • Color-coded PnL (green for profit, red for loss)
  • Side badges (green for LONG, red for SHORT)
  • Export summary with total positions and total PnL

Importing Trade History

Import previously exported CSV files to analyze your trading history without connecting to exchanges. Perfect for:

  • • Historical analysis of trades from closed accounts
  • • Combining data from multiple time periods and accounts
  • • Offline analysis without API dependencies

How to Import

  1. Navigate to the Trading Analytics page
  2. Click the Import CSV button (green button with upload icon)
  3. Select your CSV file from the file picker
  4. The system validates the filename and imports the data
  5. Imported exchange appears in dropdown with 📊 (Imported) label
  6. All analytics charts update automatically

CSV File Requirements

  • • Must follow filename format: exchange_wallet_date.csv
  • • Must include all required columns (see CSV Export Format above)
  • • Duration format supports: 2h, 30m, 1.5d, 1w
  • • Exchange name must be at least 2 characters
  • • Date must follow format: YYYY-MM-DD

Merging Data

When you import a CSV for an exchange that already has imported data:

  • • System automatically detects existing data
  • • Merges new positions with existing data
  • • Deduplicates by: symbol + close timestamp + side
  • • Shows how many new positions were added
  • • Example: "Merged 45 new positions with existing PHEM data. Total: 105"

Tip: You can import multiple CSV files for the same exchange to build a complete historical dataset over time.

Virtual Exchanges

Imported exchanges are "virtual" - they exist only for analytics:

  • • No API keys required
  • • Only analytics and visualization
  • • Marked with 📊 (Imported) in dropdown
  • • Data stored in memory (not persistent across page refresh)

Analytics Features

Our Trading Analytics dashboard provides comprehensive tools to analyze your trading performance:

Statistics Cards

  • • Total PnL with color coding
  • • Win rate percentage
  • • Max drawdown calculation
  • • Average position duration
  • • Largest profit and loss
  • • Win/loss streaks

Charts

  • • Cumulative PnL line chart
  • • Drawdown visualization
  • • Win/loss streak chart
  • • Position duration chart
  • • Volume by symbol pie chart
  • • Daily PnL calendar heatmap

Period Filtering

  • • 30-day period slices
  • • Navigate between periods
  • • Each period has independent statistics
  • • Period labels show date ranges

Position History Table

  • • Pagination (30 positions per page)
  • • Sortable by close timestamp
  • • Color-coded PnL display
  • • Side badges (LONG/SHORT)
  • • Export buttons (CSV/PDF)

Best Practices

Regular Exports

Export your trade history regularly to maintain backups of your trading data, especially before making significant changes to your strategy or exchange accounts.

Consistent File Naming

Use consistent wallet identifiers in your filenames to easily organize and identify your exports (e.g., ABCD for main trading wallet).

Validate Imports

After importing, verify that the number of positions and statistics match your expectations. Check the charts and table for accuracy.

Period Review

Use the 30-day period filtering to analyze specific time ranges and identify patterns or trends in your trading performance.

Privacy Mode

Use the "Blur USD Values" toggle when sharing your screen or streaming to hide sensitive financial information while still showing relative performance.

Real-time Data

Comprehensive Market Data

Tetrac aggregates real-time market data from multiple leading cryptocurrency exchanges to provide you with the most accurate and up-to-date information:

  • Price updates for all supported cryptocurrencies across SPOT and FUTURES markets
  • Order book depth and real-time changes
  • Trade execution notifications and volume data
  • Open interest and funding rate information for futures markets
  • Market sentiment indicators and trending assets

Supported Exchanges

Our platform aggregates data from multiple leading cryptocurrency exchanges:

Aevo
Apex
Ascendex
Asterdex
Binance
Bingx
Bitget
Bitmex
Blofin
Bybit
Deso
Dydx
Extended
Grvt
Hyperliquid
Kucoin
Lighter
Mexc
Okx
Orderly
Pacifica
Paradex
Phemex
Propr
Reya
Variational
Vest
Woox

Data is refreshed every 60 seconds and cached for optimal performance while maintaining accuracy.

Advanced Data Filtering

Customize your market view with powerful filtering options:

  • Volume-based filtering to focus on high-liquidity markets
  • SPOT vs FUTURES market toggle
  • Search functionality to quickly find specific assets
  • Real-time sorting by price, volume, or change percentage

Customization

Multi-Device Support

Tetrac is designed to work seamlessly across all your devices:

  • Desktop: Full-featured trading terminal with advanced charting
  • Tablet: Optimized touch interface with essential trading tools
  • Mobile: Streamlined interface for on-the-go market monitoring

Advanced Charting & Data Views

  • Full screen tick charts for detailed price action analysis
  • Heat-map visualization for market overview and trending assets
  • Crypto screener with customizable filters and sorting options

Personalized Dashboard

Create your perfect trading environment with our customizable dashboard:

  • Favorite markets dashboard with integrated charts
  • Real-time tick-charts for quick price movements
  • Orderbook depth visualization for market insight

Dual Trading Interfaces

Choose the interface that matches your trading style:

Perp DEX Terminal

Simple UI designed for perpetual futures trading with essential tools

Multi-Terminal

Connect to multiple CEX | DEX to take control of several trading accounts. An advanced interface with comprehensive scanning tools for professional traders.

Visual Themes

Personalize your trading experience with our theme options:

  • Light Theme: Clean, bright interface for daytime trading
  • Dark Theme: Eye-friendly interface for extended trading sessions

Email Signin

Web3 Wallet Alternative

Tetrac offers a seamless email signin option for users who prefer not to use a Web3 wallet. This feature provides a simplified onboarding process while maintaining security and control over your assets.

  • No gas fees required for signin
  • No need for wallet setup or seedphrase management
  • No bridging or Dapp connections needed
  • No signature signing required for basic access

Security Features

Our email signin system maintains the highest security standards:

  • 100% Non-custodial - You retain full control of your assets
  • 100% On-chain trading - All transactions are recorded transparently
  • Enhanced Private Key Security - Keys are never stored unencrypted
  • Main Wallet Control - Your main wallet controls all asset actions

Getting Started

To get started with email signin, simply visit our login page and enter your email address. You'll receive a verification code to complete the signin process. All you need is an email address to access the platform and start trading.

dYdX v4 Integration

Overview

dYdX v4 is a fully decentralized perpetuals exchange built on a custom Cosmos appchain. Trade 290+ markets with deep liquidity, no KYC, and full self-custody via your dYdX chain address.

ℹ️

dYdX v4 uses Cosmos-based addresses (dydx1...) and the indexer API for reading data. Order placement requires signing transactions on the dYdX chain.

Key Features

290+ Perpetual Markets

BTC, ETH, SOL, and hundreds of altcoin perpetuals

Hourly Funding Rates

Funding settles every hour (vs 8h on most CEXs)

No KYC Required

Fully decentralized — connect and trade

Deep Orderbook Liquidity

On-chain CLOB with tight spreads on major pairs

Account Setup

To start trading on dYdX v4, you need a dYdX chain account with USDC deposited and an API Trading Key for signing orders.

  1. 1.Create or import a dYdX chain wallet (Cosmos-based dydx1... address)
  2. 2.Deposit USDC to your dYdX subaccount (bridge from Ethereum, Arbitrum, or other supported chains)
  3. 3.Generate an API Trading Key from the dYdX web app (Settings → API Keys). This creates a separate wallet that can place/cancel orders on your behalf without withdrawal permissions.
  4. 4.Enter your dYdX address and API wallet private key in the Trading Panel to start trading

Trading Panel Credentials

When you select dydx in the Trading Panel, three fields are shown. dYdX v4 uses API Trading Keys — separate wallets that can place and cancel orders on behalf of your main account without withdrawal permissions.

1

API Key → Your dYdX Address

Your main dYdX account address (dydx1...) where your funds are deposited. Used by the indexer API to read your balance, positions, orders, and fill history.

2

API Secret → API Wallet Private Key

The private key (0x...) of your API Trading Key wallet. This wallet signs order and cancel transactions on behalf of your main account via dYdX's on-chain authenticator system. It cannot withdraw funds. Generate one from dYdX → Settings → API Keys. This key never leaves your browser.

3

Extra → Not used

Leave this field empty. It is not required for dYdX.

⚠️

Important: The API wallet address (derived from the private key in Field 2) must be registered as an authenticator on your main account. Generate your API Trading Key from the dYdX web app under Settings → API Keys to set this up automatically.

Quick Reference

DetailValue
ChaindYdX v4 (Cosmos appchain)
CollateralUSDC
Funding IntervalEvery hour
Symbol FormatBTC-USD, ETH-USD, SOL-USD
Indexer APIhttps://indexer.dydx.trade/v4
Docsdocs.dydx.exchange

EVM Wallets & VEST Integration

Overview

Tetrac integrates with VEST Markets, a decentralized perpetual exchange on Base network. To trade on VEST, you need EVM-compatible wallets. This section explains how to set up your wallets, register with VEST, and bridge funds from Solana.

💡

For Solana Users: You can bridge USDC from Solana to Base and trade on VEST Markets.

EVM Wallet Types

Tetrac uses two types of EVM wallets for secure trading on VEST Markets:

🔵

Main Wallet

This wallet holds your funds on VEST Markets. It's the primary account that controls your trading balance.

  • • Holds your USDC balance for trading
  • • Receives funds from bridge transfers
  • • Authorizes the signing wallet
🟣

Signing Wallet

This wallet is authorized to sign transactions on behalf of your main wallet. It provides an extra layer of security as it never handles funds.

  • • Signs all trading transactions

Security Considerations

  • Local Storage: Keys are stored locally in your browser, back them up.
  • Never Share: Never share your private keys with anyone
  • Separation: Main and signing wallets are separate for enhanced security

VEST Markets Registration

Before trading on VEST Markets, you need to register your wallets. The registration process links your main wallet to your signing wallet.

Registration Steps

  1. Generate or import your EVM wallets
  2. Click "Register with VEST" button
  3. Confirm the registration with your main wallet
  4. Receive your Account Group ID and API Key

What You'll Receive

  • Account Group: Your unique VEST account identifier
  • API Key: For accessing VEST trading API

Bridge from Solana to VEST

Tetrac supports seamless USDC bridging from Solana to Base network for VEST trading. We use industry-standard bridge protocols for secure cross-chain transfers.

Wormhole CCTP

  • • Circle's Cross-Chain Transfer Protocol
  • • Native USDC transfers
  • • ~60 second bridge time
  • • No ETH required on Base

Mayan Finance

  • • MCTP/SWIFT integration
  • • Optimized routing
  • • Competitive fees
  • • Mobile-friendly with QR codes

How to Deposit

  1. Navigate to VEST trading page
  2. Click "Deposit to VEST" button
  3. Enter amount (minimum $1 USDC)
  4. Choose your deposit method:
    • • Mobile: Scan QR code with Phantom
    • • Desktop: Copy address and send
  5. Wait for bridge completion (~60 seconds)
  6. VEST automatically credits your account

What This Means for Solana Users

If you're primarily a Solana user, here's what you need to know:

Keep Your Solana Wallet

You don't need to abandon your Solana wallet. Use Phantom or other Solana wallets to hold your funds, then bridge USDC when you want to trade on VEST.

No ETH Required

Wormhole's executor handles gas fees on Base. You don't need to buy ETH to trade on VEST Markets.

EVM Wallets Generated For You

Tetrac can generate EVM wallets automatically. These are stored locally and used only for VEST trading.

⚠️

Minimum Deposit

The minimum bridge amount is $1 USDC. Smaller amounts will not process correctly.

Trading Panel Credentials

To place orders on VEST Markets through the Trading Panel, three credentials are required. After registration, these are stored locally and auto-filled when you select the VEST exchange.

1

VEST API Key

Received after registration. A JWT token that authenticates your requests to the VEST API.

2

Signing Wallet Private Key

The private key of your signing wallet (not your main wallet). Used to sign every order and cancellation.

3

Account Group ID

Your VEST account group number. In most cases this is 0.

Auto-Fill

If you registered through Tetrac, these credentials are already saved in your browser. When you select VEST in the Trading Panel, they will be filled in automatically.

Getting Started

Ready to start trading on VEST Markets? Follow these steps:

  1. 1.Sign in with email or connect your Web3 wallet
  2. 2.Use the Generated EVM wallets or import your own EVM wallets in dashboard
  3. 3.Register with VEST Markets (no gas required)
  4. 4.Bridge USDC from Solana to BASE chain
  5. 5.Send USDC to VEST!
  6. 6.Start trading!

X402 Payments

Overview

Tetrac supports the x402 payment protocol for pay-per-request API access. If you don't have an API key, you can access any /api/v1/* endpoint by paying $0.05 USDC per request on Solana.

Price per Request

$0.05 USDC

Blockchain

Solana

Token

USDC

How It Works

The x402 protocol uses HTTP status code 402 (Payment Required) to enable machine-to-machine payments. When you call an API endpoint without an API key, the flow is:

1

Request the Endpoint

Call any /api/v1/* endpoint. If you don't have an API key, the server responds with 402 Payment Required and includes payment details (amount, wallet address, token).

2

Pay with USDC on Solana

Send 0.05 USDC to the treasury wallet address provided in the 402 response. Use any Solana wallet (Phantom, Solflare, etc.) or SDK.

3

Replay with Payment Proof

After the transaction confirms, resend your API request with the x-x402-payment header containing the transaction signature.

4

Receive Data

The server verifies the payment on-chain and returns the API data. Each payment is single-use.

Quick Example

Step 1: Call an endpoint without credentials:

curl -s https://ttc.box/api/v1/markets/news

Returns 402 with payment details including the treasury wallet address and price.

Step 2: After paying, replay with the payment header:

curl -s https://ttc.box/api/v1/markets/news \ -H "x-x402-payment: x402:<base64-encoded-payment>"

Payment Header Format

The x-x402-payment header contains x402: followed by a base64-encoded JSON object:

{
  "signature": "<solana-tx-signature>",
  "payer": "<your-wallet-address>",
  "amount": "50000",
  "timestamp": 1709827200000,
  "payTo": "6JhyWcRPwLcPna2HWsxxKy7V1Ujq4WMA34gjBCKivAMa"
}

Amount is in microUSDC (50000 = $0.05). The payTo address is returned in the 402 response.

Available Endpoints

All /api/v1/* endpoints accept x402 payment. Key endpoints include:

/api/v1/markets/hybrid-tickers- Aggregated Tickers
/api/v1/markets/funding-rates- Funding Rates
/api/v1/markets/open-interest- Open Interest
/api/v1/exchanges- Agent Trading
/api/v1/markets/ttc-scanner- TTC Scanner

Security

  • On-chain verification: Every payment is verified directly on the Solana blockchain
  • Replay protection: Each transaction can only be used once (24-hour cache)
  • No keys on server: The server never holds or manages your private keys
  • Time-limited: Payments expire after 5 minutes for safety

API Key vs. X402 Payment

Tetrac API endpoints support dual authentication. Either method grants full access to the same data:

API Key (Free Tier)

  • • Register for free on Tetrac
  • • Unlimited requests (rate limited)
  • • Send ttc-auth-token and ttc-public-key headers

X402 Payment (Pay-per-Request)

  • • No registration needed
  • • $0.05 USDC per request on Solana
  • • Send x-x402-payment header

Solana Wallet Sweeper

Overview

The Solana Wallet Sweeper consolidates funds from multiple Solana wallets into a single destination address. It transfers all SPL tokens, closes empty token accounts to reclaim rent, and sends remaining SOL — all in one workflow.

Security: Private keys are never stored or transmitted — all signing happens locally in your browser.

How It Works

1

Set Destination

Enter the Solana wallet address where all funds will be consolidated.

2

Add Source Wallets

Add one or more wallets by entering both the public address and private key (base58). The tool validates that the key matches the address.

3

Fetch Balances

Click "Fetch" on each wallet to load SOL balance, SPL token balances, and detect empty token accounts with reclaimable rent.

4

Sweep

Sweep individual wallets or all at once. The tool closes empty accounts, transfers SPL tokens (creating destination ATAs as needed), and sends remaining SOL.

Features

Multi-Wallet Support

Add unlimited source wallets and sweep them all in one session.

SPL Token Transfer

Automatically detects and transfers all SPL tokens, creating ATAs on the destination if needed.

Rent Reclamation

Detects empty token accounts and closes them to reclaim ~0.00204 SOL per account.

Key Validation

Validates that each private key matches its public address before signing any transactions.

Access

Navigate to /crypto/solana-wallet-sweeper to use the wallet sweeper tool.

Solana Ledger Sweeper

Overview

The Solana Ledger Sweeper works with your Ledger hardware wallet to sweep funds and burn unwanted SPL tokens. All transactions are signed on the device — no private keys ever leave the hardware wallet.

🔒

Hardware Wallet Security: Every transaction must be confirmed on your Ledger device. Private keys never leave the hardware wallet.

Ledger Sweeper

Sweep SPL tokens and SOL from Ledger-derived addresses to a destination wallet. Optionally mark tokens for burning instead of transferring.

1

Connect Ledger

Connect your Ledger via USB, unlock with your PIN, and open the Solana app. Click "Connect Ledger" to establish the connection via WebUSB or WebHID.

2

Derive Addresses

Derive up to 20 addresses using the standard Solana BIP-44 derivation path m/44'/501'/x'/0'. Fetch balances to see SOL, SPL tokens, and empty accounts.

3

Set Destination & Sweep

Enter a destination address, then sweep individual wallets or all at once. Each transaction requires confirmation on your Ledger.

SPL Token Burner

Permanently destroy unwanted SPL tokens and reclaim the ~0.00204 SOL rent locked in each token account. This is a separate section from the sweeper — no destination wallet needed.

Irreversible: Burned tokens are permanently destroyed and cannot be recovered. Only burn tokens you are certain you no longer need.

1

Select Wallet

Choose a derived Ledger wallet from the dropdown.

2

Fetch & Select Tokens

Click "Fetch Tokens" to load all SPL tokens. Select individual tokens or use "Select All" to mark them for burning.

3

Burn & Reclaim

Click the burn button to execute. Each token is burned and its account closed in a single transaction, reclaiming rent SOL back to your wallet. Empty token accounts are also batch-closed.

Technical Details

Derivation Path

Uses standard BIP-44 m/44'/501'/x'/0' compatible with Ledger Live and Phantom.

Connection

Connects via WebUSB (primary) or WebHID (fallback). Requires Chrome or Edge browser.

Burn + Close

Each burn combines burnInstruction + closeAccountInstruction in one tx to destroy tokens and reclaim ~0.00204 SOL rent.

Batch Processing

Empty accounts are closed in batches of 10 per transaction to stay within Solana's transaction size limits.

Access

Navigate to /crypto/solana-ledger-sweeper to use the Ledger sweeper and token burner.

Deployment

Tetrac can be deployed to various hosting platforms:

  • Vercel (recommended for Next.js applications)
  • Netlify
  • Docker container
  • Traditional Node.js server

Contributing

Development Setup

Fork the repository and create a new branch for your feature or bug fix.

Code Guidelines

  • Follow the existing code style and conventions
  • Write clear, descriptive commit messages
  • Add tests for new functionality
  • Ensure all tests pass before submitting a pull request

Reporting Issues

Use the GitHub issue tracker to report bugs or suggest new features. Please provide as much detail as possible, including steps to reproduce the issue.

License

Tetrac is licensed under the MIT License. See the LICENSE file in the repository for more information.