> For the complete documentation index, see [llms.txt](https://docs.atract.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.atract.app/readme.md).

# Atract - Decentralized Trader Funding Platform

**Non-Custodial** | **Contract-Free V3** | **Production-Ready**

***

## Overview

Atract is a decentralized platform connecting cryptocurrency traders with capital providers. Traders access institutional-scale capital while investors gain exposure to professional trading strategies with programmable risk controls.

**How It Works:**

1. Investors create funding proposals with capital and risk parameters
2. Traders review and accept proposals (EIP-712 signature)
3. A dedicated vault wallet is created for the deal
4. Traders execute on Hyperliquid through our terminal
5. Backend services monitor risk limits in real-time
6. Profits automatically split according to the agreement

## Core Features

* **Trading Terminal** - Professional interface on Hyperliquid L1
* **Funding Platform** - Custom deals with programmable risk limits
* **Copy Trading** - Automatic trade replication to vaults
* **Analytics** - Atract Score and performance metrics
* **Leaderboard** - Discover traders for funding
* **Risk Management** - Real-time monitoring (50-100ms latency)

## Architecture

**V3 Contract-Free:**

* No smart contracts required
* Vaults are EOA wallets derived via Turnkey
* Database-driven state (PostgreSQL)
* Backend services enforce risk limits
* EIP-712 signatures for deal acceptance

**Tech Stack:**

* **Frontend:** Next.js 15 + React 19
* **Backend:** Node.js with TypeScript
* **Database:** PostgreSQL via Prisma
* **Trading:** Hyperliquid L1
* **Custody:** Arbitrum (USDC storage)
* **Wallet Derivation:** Turnkey

## Repository Structure

```
atractv2/
├── web/                    # Next.js application
│   ├── src/
│   │   ├── app/            # Pages and API routes
│   │   ├── components/     # React components
│   │   ├── lib/            # Core utilities
│   │   ├── services/       # Backend services
│   │   └── scripts/        # Service runners
│   └── prisma/             # Database schema
│
├── docs/                   # Documentation
│   ├── documentation/      # GitBook user docs
│   ├── progress/           # Implementation history
│   └── deprecated/         # V2 docs (obsolete)
│
└── CLAUDE.md               # Development guidelines
```

## Quick Start

### Development

```bash
cd web
npm install
npm run dev
```

### Backend Services

```bash
npm run vault-monitor:start    # Vault activation
npm run risk-monitor:start     # Risk enforcement
npm run settlement:start       # Settlement processing
npm run midnight-reset:start   # Daily reset
```

### Database

```bash
npx prisma migrate dev
npx prisma studio
```

## Documentation

* **User Docs:** [`docs/documentation/`](/docs/documentation.md)
* **Architecture:** [`docs/CURRENT_ARCHITECTURE.md`](https://github.com/Atractapp/atractv2/blob/main/docs/CURRENT_ARCHITECTURE.md)
* **Services:** [`docs/SERVICES_ARCHITECTURE.md`](https://github.com/Atractapp/atractv2/blob/main/docs/SERVICES_ARCHITECTURE.md)
* **Development:** [`CLAUDE.md`](/claude.md)

## Environment Variables

See [`docs/ENV_SECRETS_GUIDE.md`](https://github.com/Atractapp/atractv2/blob/main/docs/ENV_SECRETS_GUIDE.md) for complete configuration.

**Key Variables:**

```bash
# Hyperliquid
NEXT_PUBLIC_HL_API_BASE_URL=https://api.hyperliquid.xyz

# Turnkey (Wallet Derivation)
TURNKEY_API_PUBLIC_KEY=...
TURNKEY_API_PRIVATE_KEY=...
TURNKEY_ORGANIZATION_ID=...

# Database
DATABASE_URL=postgresql://...

# Auth
SESSION_SECRET=...
```

## Security

* Non-custodial architecture
* Agent-based signing (no wallet popups)
* Server-side key management via Turnkey
* SIWE authentication
* Rate limiting and CSRF protection
* Complete audit trail

## Status

**Production-Ready Features:**

* Trading terminal (personal + vault mode)
* Funding proposals and vault lifecycle
* Risk monitoring with auto-pause
* Copy trading with reconciliation
* Analytics and Atract Score
* Public leaderboard

**Networks:**

* Mainnet: Hyperliquid Mainnet + Arbitrum One
* Testnet: Hyperliquid Testnet + Arbitrum Sepolia

## Resources

* **Hyperliquid:** <https://hyperliquid.gitbook.io>
* **Turnkey:** <https://docs.turnkey.com>
* **Prisma:** <https://www.prisma.io/docs>

***

**Non-custodial trader funding on Hyperliquid**
