---
title: User Positions
description: Fetch all positions for a user with aggregates
url: https://docs.intuition.systems/docs/v1/graphql-api/examples/user-positions
markdown_url: https://docs.intuition.systems/docs/v1/graphql-api/examples/user-positions.md
version: V1
llms_index: https://docs.intuition.systems/docs/v1/llms.txt
---

Fetch user positions with aggregate statistics.

This example uses a live-verified account with populated positions; position counts and values change over time.

Account IDs are stored in EIP-55 checksummed form and `_eq` comparisons are case-sensitive — pass the address exactly as checksummed (as shown below), or the query silently returns empty results.

## Query

    id: 'user-positions',
    title: 'User Portfolio',
    query: `query GetUserPositions($accountId: String!, $limit: Int!) {
  stats: positions_aggregate(where: { account_id: { _eq: $accountId } }) {
    aggregate {
      count
      sum { shares }

  positions(
    where: { account_id: { _eq: $accountId } }
    order_by: { shares: desc }
    limit: $limit
  ) {
    id
    shares
    vault {
      term_id
      current_share_price
      market_cap
      term {
        atom { label image }

}`,
    variables: {
      accountId: '0x88D0aF73508452c1a453356b3Fac26525aEc23A2',
      limit: 20

];
