# Queries

## Auth & User

### `me`

Get the authenticated user's profile.

```graphql
query {
  me {
    success
    data {
      id
      email
      email_verified
      is_active
      provider
      referral_code
      created_at
      onboardingStatus { completed currentStep }
    }
  }
}
```

## Organizations

### `organizations`

```graphql
query {
  organizations(limit: 10, offset: 0) {
    id
    name
    description
    owner_id
    subscription_tier
    max_users
    max_strategies
    max_copiers
  }
}
```

### `organization`

```graphql
query {
  organization(id: "org_123") {
    id
    name
    settings {
      allow_user_registration
      require_email_verification
      two_factor_required
    }
  }
}
```

## Exchange Accounts

### `exchangeAccounts` / `get_exchange_accounts`

```graphql
query {
  exchangeAccounts(limit: 10) {
    id
    exchange_name
    account_name
    trading_type
    is_active
    balance
    last_sync_at
  }
}
```

### `exchangeAccount`

```graphql
query {
  exchangeAccount(id: "exc_123") {
    id
    exchange_name
    permissions
    perpetual_capabilities
  }
}
```

## Strategies

### `get_strategies`

```graphql
query {
  get_strategies {
    success
    data {
      id
      name
      exchange
      status
      is_active
      copiers { id name }
      totalTrades
      currentBalanceUSD
      balanceChange24h
    }
  }
}
```

## Copiers

### `get_copiers`

```graphql
query {
  get_copiers {
    success
    data {
      id
      name
      exchange
      status
      is_active
      strategy { id name }
      totalTrades
      currentBalanceUSD
    }
  }
}
```

## Trades

### `trades`

```graphql
query {
  trades(limit: 20, offset: 0) {
    id
    side
    type
    price
    amount
    fee
    status
    created_at
  }
}
```

### `tradesByStrategy`

```graphql
query {
  tradesByStrategy(strategy_id: "str_123", limit: 10) {
    id
    side
    price
    amount
    status
  }
}
```

### `trade`

```graphql
query {
  trade(id: "trd_123") {
    id
    side
    type
    price
    amount
    status
  }
}
```

## Trade Pairs

### `tradePairs`

```graphql
query {
  tradePairs(exchange: "binance", limit: 50) {
    id
  }
}
```

## Notifications

### `notifications`

```graphql
query {
  notifications(limit: 20, unread_only: true) {
    id
  }
}
```

### `unreadNotificationCount`

```graphql
query {
  unreadNotificationCount
}
```

## Settings

### `userSettings`

```graphql
query {
  userSettings {
    key
    value
  }
}
```

## Rewards

### `userRewards`

```graphql
query {
  userRewards(limit: 10) {
    id
  }
}
```

### `rewardTypes`

```graphql
query {
  rewardTypes { id }
}
```

## Withdrawals

### `withdrawals`

```graphql
query {
  withdrawals(limit: 10) {
    id
  }
}
```

## Passkeys

### `userPasskeys`

```graphql
query {
  userPasskeys {
    success
    data {
      id
      device_name
      device_type
      created_at
      last_used_at
    }
  }
}
```

## Onboarding

### `getOnboardingStatus`

```graphql
query {
  getOnboardingStatus {
    success
    data {
      completed
      currentStep
      checklist {
        exchangeConnected
        strategyAdded
        copierAdded
        messagingLinked
      }
    }
  }
}
```

## Supported Exchanges

### `get_supported_exchanges`

```graphql
query {
  get_supported_exchanges {
    success
    data { id name }
  }
}
```

## Admin Queries

### `adminGetDashboard`

System overview stats (admin only).

### `adminGetUsers`

```graphql
query {
  adminGetUsers(page: 1, limit: 20, search: "john") {
    id
    email
    is_active
    is_system_admin
  }
}
```

### `adminGetUser`

Detailed user info (admin only).

### `adminGetApiKeys`

List API keys with optional filters (admin only).

### `adminGetAuditLogs`

Query audit logs with filters (admin only).
