Portfolio
getBalances
Returns the user’s current balances across all active positions.
- If
agentIdis omitted: retrieves balances for all agents. - If
agentIdis provided: retrieves balances for the specified agent.
Requires wallet connection: Yes
- Signature
- Example
- Example Output
getBalances(
agentId?: AgentId
): Promise<OwneyBalances | AgentBalance>
const balances = await owney.getBalances();
{
"totalBalance": "1250.45",
"agentBalances": {
"zyfai": {
"smartWallet": "0x...",
"totalBalance": "700.20",
"tokens": [
{
"chain": "BASE",
"chainId": 8453,
"asset": "USDC",
"amount": "700.20"
}
]
},
"sail": {
"smartWallet": "0x...",
"totalBalance": "550.25",
"tokens": [
{
"chain": "ARBITRUM",
"chainId": 42161,
"asset": "USDC",
"amount": "250.25"
},
{
"chain": "BASE",
"chainId": 8453,
"asset": "USDC",
"amount": "300.00"
}
]
}
}
}
Parameters
agentId?: AgentId— The agent to retrieve balances for (SeeAgentIdfor details). If omitted, retrieves balances for all agents.
Returns
Promise<OwneyBalances>ifagentIdis omitted. Includes total balance and a breakdown of balances by agent.Promise<AgentBalance>ifagentIdis provided.
See OwneyBalances and AgentBalance for details.
getEarnings
Returns the user’s on-chain earnings summary.
- If
agentIdis omitted: retrieves earnings for all agents. - If
agentIdis provided: retrieves earnings for the specified agent.
Requires wallet connection: Yes
- Signature
- Example
- Example Output
getEarnings(
agentId?: AgentId
): Promise<OwneyEarnings | AgentEarnings>
const earnings = await owney.getEarnings();
{
"totalEarnings": "84.37",
"agentEarnings": {
"zyfai": {
"smartWallet": "0x...",
"lifetimeEarnings": 51.12
},
"sail": {
"smartWallet": "0x...",
"lifetimeEarnings": 33.25
}
}
}
Parameters
agentId?: AgentId— The agent to retrieve earnings for (SeeAgentIdfor details). If omitted, retrieves earnings for all agents.
Returns
Promise<OwneyEarnings>ifagentIdis omitted. Includes total earnings and a per-agent breakdown.Promise<AgentEarnings>ifagentIdis provided.
See OwneyEarnings and AgentEarnings for details.
getAccountApy
Returns weighted account APY for a selected lookback period.
- If
agentIdis omitted: returns the account's total APY plus per-agent APY. - If
agentIdis provided: returns APY for the specified agent.
Requires wallet connection: Yes
- Signature
- Example
- Example Output
getAccountApy(
options: AccountApyOptions
): Promise<OwneyAccountApy | AccountAgentApy>
const apy = await owney.getAccountApy({
days: "30D"
});
{
"totalApy": "5.6",
"agentApy": {
"zyfai": {
"walletAddress": "0x...",
"weightedApyAfterFee": 6.0
},
"sail": {
"walletAddress": "0x...",
"weightedApyAfterFee": 4.0,
"weightedApyAfterFeeDetails": {
"apyPerAsset": {
"8453": {
"USDC": 4.2
}
}
}
}
}
}
Parameters
options: AccountApyOptions— Required options (SeeAccountApyOptionsfor details):days: DailyApyDays— Lookback period (e.g."7D","14D", or"30D").agentId?: AgentId— Optional agent to query. If omitted, returns weighted account APY across all agents.
Returns
Promise<OwneyAccountApy>ifagentIdis omitted.Promise<AccountAgentApy>ifagentIdis provided.
weightedApyAfterFeeDetails is optional and may be included by some agents when a per-asset APY breakdown is available.
See OwneyAccountApy and AccountAgentApy for details.
getHistory
Returns transaction history with optional settings and date filters.
- If
agentIdis omitted: retrieves history for all agents. - If
agentIdis provided: retrieves history for the specified agent.
Requires wallet connection: Yes
- Signature
- Example
- Example Output
getHistory(
params?: HistoryOptions
): Promise<OwneyAgentHistory>
// History with optional date filters
const history = await owney.getHistory({
filters: {
fromDate: "2026-02-01",
toDate: "2026-03-05",
},
});
{
"data": [
{
"agent": "zyfai",
"action": "Rebalance",
"date": "2026-03-02T12:30:00.000Z",
"oldApy": "0.061",
"newApy": "0.068",
"transactions": [
{
"txHashes": ["0x..."],
"chainId": 8453,
"tokenSymbol": "USDC",
"amount": "100000000"
}
],
"rebalanceLog": [
{
"fromProtocol": "Aave V3",
"toProtocol": "Moonwell Blue",
"tokenSymbol": "USDC",
"amount": "100.00",
"status": "success"
}
]
}
],
"total": 1
}
Parameters
params?: HistoryOptions— Optional filters (SeeHistoryOptionsfor details).agentId?: AgentId— Optional agent filter.filters?: HistoryFilters— Optional date filters:fromDate?: string— Start date (inclusive), formatYYYY-MM-DD.toDate?: string— End date (inclusive), formatYYYY-MM-DD.
Returns
Promise<OwneyAgentHistory>— Transaction history matching the provided filters (SeeOwneyAgentHistoryfor details).
getUserProfile
Returns the authenticated user’s profile details.
- If
agentIdis omitted: retrieves the user profile for all agents. - If
agentIdis provided: retrieves the user profile for the specified agent.
Requires wallet connection: Yes
- Signature
- Example
- Example Output
getUserProfile(
agentId?: AgentId
): Promise<OwneyUserProfile | AgentUserProfile>
const profile = await owney.getUserProfile();
{
"agentUserProfile": {
"zyfai": {
"address": "0x...",
"smartWallet": "0x...",
"chains": [8453],
"strategy": "conservative",
"hasActiveSessionKey": true,
"protocols": ["Aave", "Moonwell"]
},
"sail": {
"address": "0x...",
"smartWallet": "0x...",
"chains": [8453],
"hasActiveSessionKey": true,
"protocols": ["Morpho"]
}
}
}
Parameters
agentId?: AgentId— The agent to retrieve the user profile for (SeeAgentIdfor details). If omitted, retrieves the user profile for all agents.
Returns
Promise<OwneyUserProfile>ifagentIdis omitted. Includes per-agent user profiles.Promise<AgentUserProfile>ifagentIdis provided.
See OwneyUserProfile and AgentUserProfile for details.
getAgentAllocation
Returns the current fund allocation percentages across active agents.
Requires wallet connection: Yes
- Signature
- Example
- Example Output
getAgentAllocation(): Promise<OwneyAgentAllocation>
const allocation = await owney.getAgentAllocation();
{
"agentAllocation": {
"zyfai": 75,
"sail": 25
}
}
Returns
Promise<OwneyAgentAllocation>— Allocation percentages keyed by agent ID.
See OwneyAgentAllocation for details.