Your users

Partner admin

Read your app's users, balances, positions, orders, deposits, withdrawals, and analytics from your backend.

Use these endpoints for reporting and reconciliation from your backend. Authenticate with x-app-api-key; x-app-id and a user token are not required. The {appId} in the path must match the key's app. A read key can access every user in that app. A trade key is rejected on these routes: it can trade as a signed-in user, and it cannot list users or orders.

First create a server API key. For a signed-in user's activity screen or the app leaderboard, follow Portfolio.

AggAdminClient provides methods for users, orders, analytics, and market-resolution holders. Use admin.request() for the per-user reads below. Manage app members and settings in the admin dashboard.

import { AggAdminClient } from "@agg-build/sdk/server";

const admin = new AggAdminClient({
  baseUrl: "https://api.t.sufwankhalid.com",
  apiKey: process.env.AGG_APP_API_KEY!,
});

Users

SDK
const users = await admin.listUsers(appId, { limit: 20 });

Full shape on List users.

SDK
const user = await admin.getUser(appId, userId);

Full shape on Get user.

Balances, positions, orders

SDK
const balances = await admin.request(`/apps/${appId}/users/${userId}/balances`);

Full shape on Get user balances.

SDK
const positions = await admin.request(`/apps/${appId}/users/${userId}/positions`);

Full shape on Get user positions.

SDK
const orders = await admin.request(`/apps/${appId}/users/${userId}/orders`);

Full shape on Get user orders.

SDK
const feed = await admin.listOrders(appId, { limit: 50 });

Full shape on List orders across your app. This feed is ordered by last update. Upsert by id.

Deposits and withdrawals

SDK
const deposits = await admin.request(`/apps/${appId}/users/${userId}/deposits`);

Full shape on Get user deposits. amountRaw is an integer string in the token's decimals.

SDK
const withdrawals = await admin.request(`/apps/${appId}/users/${userId}/withdrawals`);

Full shape on Get user withdrawals.

Analytics and resolution

SDK
const analytics = await admin.getAnalytics(appId);

Full shape on Get analytics. Cash and position values reflect current holdings; fees are cumulative. usersLast7Days, usersLast30Days, ordersLast7Days, and ordersLast30Days cover the named rolling windows.

SDK
const holders = await admin.listMarketResolutionUsers(appId, venueMarketId, {
  includeEmails: true,
});

Full shape on List users affected by market resolution.

On this page