Skip to main content

Portfolio

getBalances

Returns the user's current balances.

  • If agentId is omitted: retrieves balances across the currently active agents.
  • If agentId is provided: retrieves balances for the specified agent.

Requires wallet connection: Yes

getBalances(
agentId?: AgentId
): Promise<OwneyBalances | AgentBalance>

Parameters

  • agentId?: AgentId - The agent to retrieve balances for (See AgentId for details). If omitted, retrieves balances for the current active-agent set.

Returns

  • Promise<OwneyBalances> if agentId is omitted. Includes total balance and a breakdown by active agent.
  • Promise<AgentBalance> if agentId is provided.

totalBalanceAsset indicates the asset that every totalBalance (top-level and per-agent) is denominated in. It is currently always "usdc".

See OwneyBalances and AgentBalance for details.


getEarnings

Returns the user's on-chain earnings summary.

  • If agentId is omitted: retrieves earnings across the currently active agents.
  • If agentId is provided: retrieves earnings for the specified agent.

Requires wallet connection: Yes

getEarnings(
agentId?: AgentId
): Promise<OwneyEarnings | AgentEarnings>

Parameters

  • agentId?: AgentId - The agent to retrieve earnings for (See AgentId for details). If omitted, retrieves earnings for the current active-agent set.

Returns

  • Promise<OwneyEarnings> if agentId is omitted. Includes total earnings and a per-agent breakdown.
  • Promise<AgentEarnings> if agentId is provided.

See OwneyEarnings and AgentEarnings for details.


getAccountApy

Returns weighted account APY for a selected lookback period.

  • If agentId is omitted: returns the account's total APY plus per-agent APY across the currently active agents.
  • If agentId is provided: returns APY for the specified agent.

Requires wallet connection: Yes

getAccountApy(
options: AccountApyOptions
): Promise<OwneyAccountApy | AccountAgentApy>

Parameters

  • options: AccountApyOptions - Required options (See AccountApyOptions for details):
    • days: DailyApyDays - Lookback period (for example "7D", "14D", or "30D").
    • agentId?: AgentId - Optional agent to query. If omitted, returns weighted account APY across the current active-agent set.

Returns

  • Promise<OwneyAccountApy> if agentId is omitted.
  • Promise<AccountAgentApy> if agentId is provided.

weightedApyAfterFeeDetails and apyByChainAndAsset are optional on per-agent results. Aggregated OwneyAccountApy responses also include a top-level apyByChainAndAsset.

See OwneyAccountApy and AccountAgentApy for details.


getAllocationApy

Returns allocation-weighted APY from the user's current portfolio positions.

Each position's pool APY is weighted by the user's position value. If agentId is omitted, positions from all active agents are pooled before the total APY is calculated.

Requires wallet connection: Yes

getAllocationApy(
options?: { agentId?: AgentId }
): Promise<OwneyAllocationApy>

Parameters

  • options?: { agentId?: AgentId } - Optional agent scope. If omitted, returns allocation APY across the current active-agent set.

Returns

  • Promise<OwneyAllocationApy> - Position-weighted APY across all selected positions, including per-chain/per-asset and per-agent breakdowns.

See OwneyAllocationApy and AllocationAgentApy for details.


getHistory

Returns transaction history with optional filters.

  • If agentId is omitted: retrieves history for the currently active agents.
  • If agentId is provided: retrieves history for the specified agent.

Requires wallet connection: Yes

getHistory(
params?: HistoryOptions
): Promise<OwneyAgentHistory>

Parameters

  • params?: HistoryOptions - Optional filters (See HistoryOptions for details).
    • agentId?: AgentId - Optional agent filter.
    • filters?: HistoryFilters - Optional date filters:
      • limit?: number - Maximum entries returned per call. Defaults to 10.
      • cursor?: string - Opaque cursor returned by a previous getHistory() call.
      • fromDate?: string - Start date (inclusive), format YYYY-MM-DD.
      • toDate?: string - End date (inclusive), format YYYY-MM-DD.

Returns

  • Promise<OwneyAgentHistory> - Transaction history matching the provided filters, including hasMore and an optional nextCursor for pagination (See OwneyAgentHistory for details).

getUserProfile

Returns the authenticated user's profile details.

  • If agentId is omitted: retrieves the user profile for the currently active agents.
  • If agentId is provided: retrieves the user profile for the specified agent.

Requires wallet connection: Yes

getUserProfile(
agentId?: AgentId
): Promise<OwneyUserProfile | AgentUserProfile>

Parameters

  • agentId?: AgentId - The agent to retrieve the user profile for (See AgentId for details). If omitted, retrieves the user profile for the current active-agent set.

Returns

  • Promise<OwneyUserProfile> if agentId is omitted. Includes per-agent user profiles.
  • Promise<AgentUserProfile> if agentId is provided.

See OwneyUserProfile and AgentUserProfile for details.