Skip to main content
GET
/
tools
/
coinbase
/
list_positions
[
  {
    "provider": "<string>",
    "symbol": "<string>",
    "qty": "<string>",
    "avg_entry_price": "<string>",
    "current_price": "<string>",
    "market_value": "<string>",
    "unrealized_pl": "<string>",
    "unrealized_plpc": "<string>",
    "side": "long",
    "provider_fields": {}
  }
]

coinbase_list_positions

import os
from opentools import trading

tools = trading.coinbase(
    api_key=os.environ["COINBASE_KEY"],
    api_secret=os.environ["COINBASE_SECRET"],
    model="openai",
    minimal=True,
    include=["coinbase_list_positions"],
)
Request
  • Optional portfolio_type: choose which Coinbase portfolio to derive positions from.
  • Optional currency: valuation currency (e.g. USD).
Options
  • include / exclude: filter which tools are exposed (use full names like coinbase_list_positions).
  • minimal: omit provider and provider_fields when True.

Body

application/json

This is a request to obtain information. Your API keys are required.

portfolio_type
string

Optional portfolio type selector (e.g. 'DEFAULT', 'UNDEFINED'). If omitted, DEFAULT is tried first.

currency
string

Optional currency code (e.g. 'USD') used for valuation fields.

Response

List of positions (OpenTools trading schema).

provider
string | null

Trading provider identifier. Omitted when minimal=True.

symbol
string

Instrument symbol (e.g. "AAPL", "BTCUSD").

qty
string | null

Position size.

avg_entry_price
string | null

Average entry price.

current_price
string | null

Latest price used for valuation.

market_value
string | null

Current position market value.

unrealized_pl
string | null

Unrealized profit/loss.

unrealized_plpc
string | null

Unrealized profit/loss percent (factor of 1, not 100).

side
enum<string> | null

Position direction.

Available options:
long,
short
provider_fields
object

Extra provider-specific fields (omitted when minimal=True).