Portfolio

Portfolio, equity, funding history, and order management. Require Privy JWT authentication.

Get portfolio

get

Returns the user's current portfolio: account value, withdrawable balance, and all open positions with PnL, liquidation distance, funding rate, and cumulative funding earned.

Returns an empty positions array (not an error) if the user has no linked agent wallet or if the database is unavailable.

Authorizations
AuthorizationstringRequired

Privy-issued JWT. Obtain by connecting your wallet at https://app.zirodelta.com.

Responses
chevron-right
200

Current portfolio state.

application/json
get
/api/portfolio

Get equity history

get

Returns the user's equity curve as a series of time/value data points, bucketed by the requested period.

Bucket durations by period:

  • 24h: 1-hour buckets

  • 1w (default): 1-day buckets

  • 1m: 7-day buckets

  • all: 30-day buckets

Returns a single current-value point if no historical data is available.

Authorizations
AuthorizationstringRequired

Privy-issued JWT. Obtain by connecting your wallet at https://app.zirodelta.com.

Query parameters
periodstring · enumOptional

Time period for the equity history.

Default: 1wPossible values:
Responses
chevron-right
200

Equity history data points.

application/json
get
/api/portfolio/equity-history

Get funding payment history

get

Returns the user's funding payment history as bucketed time/value data points. Each point represents net funding received (positive) or paid (negative) in USDC during that bucket.

Same bucket durations as equity-history.

Authorizations
AuthorizationstringRequired

Privy-issued JWT. Obtain by connecting your wallet at https://app.zirodelta.com.

Query parameters
periodstring · enumOptional

Time period for the funding history.

Default: 1wPossible values:
Responses
chevron-right
200

Funding payment history data points.

application/json
get
/api/portfolio/funding-history

Get trade fill history

get

Returns the user's trade fill history for the requested period. Each record represents one fill with side, size, price, fee, and closed PnL.

Authorizations
AuthorizationstringRequired

Privy-issued JWT. Obtain by connecting your wallet at https://app.zirodelta.com.

Query parameters
periodstring · enumOptional

Time period for the trade history.

Default: 1wPossible values:
Responses
chevron-right
200

Trade fill history.

application/json
get
/api/portfolio/trade-history

Get open orders

get

Returns all open limit, take-profit, and stop-loss orders for the authenticated user. Orders are fetched directly from Hyperliquid's openOrders info endpoint.

Authorizations
AuthorizationstringRequired

Privy-issued JWT. Obtain by connecting your wallet at https://app.zirodelta.com.

Responses
chevron-right
200

List of open orders.

application/json
get
/api/orders

Cancel all open orders

delete

Cancels all open orders for the authenticated user in a single batch request. Returns the count of cancelled orders.

Authorizations
AuthorizationstringRequired

Privy-issued JWT. Obtain by connecting your wallet at https://app.zirodelta.com.

Responses
chevron-right
200

All orders cancelled.

application/json
delete
/api/orders

Cancel a single order

delete

Cancels a single order by order ID. The coin query parameter is required because Hyperliquid's cancel action requires both the order ID and the asset index.

Authorizations
AuthorizationstringRequired

Privy-issued JWT. Obtain by connecting your wallet at https://app.zirodelta.com.

Path parameters
oidinteger · int64Required

Hyperliquid order ID (integer).

Example: 7895634521
Query parameters
coinstringRequired

Asset symbol for the order (uppercase). Required to resolve the HL asset index.

Example: BTC
Responses
chevron-right
200

Order cancelled.

application/json
delete
/api/orders/{oid}

Last updated

Was this helpful?