Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

## [1.11.0] - 2026-AUG-28

### Added

#### New API Endpoints

**Financing Service**
- **`get_conversion_fees()`**: Get organization stablecoin conversion fee tiers and month-to-date net conversion volume (`GET /v1/conversion/fees`)

**Futures Service**
- **`get_derivatives_currency_summary()`**: Get per-currency international derivatives balances for a portfolio (`GET /v1/portfolios/{portfolio_id}/derivatives/currency_summary`)
- **`get_derivative_positions()`**: List active derivative positions for a portfolio (`GET /v1/portfolios/{portfolio_id}/derivatives/positions`)

#### New & Updated Models
- **`ConversionFee`**, **`ConversionFeeTier`**: Stablecoin conversion fee rows and progressive tiers
- **`DerivativePosition`**, **`DerivativesCurrencyBalance`**, **`OptionsDetails`**: International derivatives positions, per-currency balances, and option greeks/strike metadata
- **`Product`**: `product_type` now includes `OPTION`; list products accepts `product_type`, `contract_expiry_type`, and `expiring_contract_status` query filters

#### New Enums
- **`ProductType`** (includes `OPTION`)
- **`DerivativeProductType`**
- **`OptionType`**
- **`FcmMarginHealthState`**

### Changed

- **`list_products()`**: Forwards `product_type`, `contract_expiry_type`, and `expiring_contract_status` query parameters to the API.


## [1.10.0] - 2026-AUG-07

### Breaking Changes
Expand Down
14,213 changes: 13,942 additions & 271 deletions apiSpec/prime-public-api-spec.yaml

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions prime_sdk/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,35 @@ class TransactionType(Enum):
PORTFOLIO_STAKE = "PORTFOLIO_STAKE"
PORTFOLIO_UNSTAKE = "PORTFOLIO_UNSTAKE"
MERGE_STAKE = "MERGE_STAKE"


class ProductType(Enum):
SPOT = "SPOT"
FUTURE = "FUTURE"
OPTION = "OPTION"


class DerivativeProductType(Enum):
DERIVATIVE_PRODUCT_TYPE_SPOT = "DERIVATIVE_PRODUCT_TYPE_SPOT"
DERIVATIVE_PRODUCT_TYPE_FUTURE = "DERIVATIVE_PRODUCT_TYPE_FUTURE"
DERIVATIVE_PRODUCT_TYPE_EQUITY = "DERIVATIVE_PRODUCT_TYPE_EQUITY"
DERIVATIVE_PRODUCT_TYPE_PREDICTION_MARKET = (
"DERIVATIVE_PRODUCT_TYPE_PREDICTION_MARKET"
)
DERIVATIVE_PRODUCT_TYPE_OPTION = "DERIVATIVE_PRODUCT_TYPE_OPTION"
DERIVATIVE_PRODUCT_TYPE_BASIS = "DERIVATIVE_PRODUCT_TYPE_BASIS"
DERIVATIVE_PRODUCT_TYPE_EQUITY_OPTION = "DERIVATIVE_PRODUCT_TYPE_EQUITY_OPTION"
DERIVATIVE_PRODUCT_TYPE_FUTURE_COMBO = "DERIVATIVE_PRODUCT_TYPE_FUTURE_COMBO"
DERIVATIVE_PRODUCT_TYPE_OPTION_COMBO = "DERIVATIVE_PRODUCT_TYPE_OPTION_COMBO"


class OptionType(Enum):
OPTION_TYPE_CALL = "OPTION_TYPE_CALL"
OPTION_TYPE_PUT = "OPTION_TYPE_PUT"


class FcmMarginHealthState(Enum):
FCM_MARGIN_HEALTH_STATE_HEALTHY = "FCM_MARGIN_HEALTH_STATE_HEALTHY"
FCM_MARGIN_HEALTH_STATE_RESTRICTED = "FCM_MARGIN_HEALTH_STATE_RESTRICTED"
FCM_MARGIN_HEALTH_STATE_PRE_LIQUIDATION = "FCM_MARGIN_HEALTH_STATE_PRE_LIQUIDATION"
FCM_MARGIN_HEALTH_STATE_LIQUIDATION = "FCM_MARGIN_HEALTH_STATE_LIQUIDATION"
4 changes: 4 additions & 0 deletions prime_sdk/examples/COMMANDS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ python prime_sdk/examples/commission/get_portfolio_commission.py

# Financing
python prime_sdk/examples/financing/create_new_locate.py --symbol BTC --amount 100 --locate-date "2025-01-01"
python prime_sdk/examples/financing/get_conversion_fees.py
python prime_sdk/examples/financing/get_cross_margin_overview.py
python prime_sdk/examples/financing/get_entity_locate_availabilities.py --locate-date "2025-01-01"
python prime_sdk/examples/financing/get_margin_information.py
Expand All @@ -53,6 +54,8 @@ python prime_sdk/examples/financing/list_trade_finance_obligations.py

# Futures
python prime_sdk/examples/futures/cancel_entity_futures_sweep.py
python prime_sdk/examples/futures/get_derivative_positions.py
python prime_sdk/examples/futures/get_derivatives_currency_summary.py
python prime_sdk/examples/futures/get_entity_fcm_balance.py
python prime_sdk/examples/futures/get_entity_positions.py
python prime_sdk/examples/futures/get_fcm_margin_call_details.py
Expand Down Expand Up @@ -100,6 +103,7 @@ python prime_sdk/examples/positions/list_entity_positions.py
# Products
python prime_sdk/examples/products/get_product_candles.py --product-id BTC-USD --granularity ONE_HOUR --start "2025-01-01T00:00:00Z" --end "2025-01-02T00:00:00Z"
python prime_sdk/examples/products/list_products.py
python prime_sdk/examples/products/list_products.py --product-type OPTION

# Staking
python prime_sdk/examples/staking/claim_wallet_staking_rewards.py --wallet-id abc123
Expand Down
35 changes: 35 additions & 0 deletions prime_sdk/examples/financing/get_conversion_fees.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2026-present Coinbase Global, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# #docs operationId: PrimeRESTAPI_GetConversionFees
# #docs operationName: Get Conversion Fees

from prime_sdk.client_services import PrimeServicesClient
from prime_sdk.services.financing import GetConversionFeesRequest


def main():
client = PrimeServicesClient.from_env()

request = GetConversionFeesRequest()

try:
response = client.financing.get_conversion_fees(request)
print(response)
except Exception as e:
print(f"failed to get conversion fees: {e}")


if __name__ == "__main__":
main()
54 changes: 54 additions & 0 deletions prime_sdk/examples/futures/get_derivative_positions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2026-present Coinbase Global, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# #docs operationId: PrimeRESTAPI_GetDerivativePositions
# #docs operationName: List Portfolio Derivative Positions

import argparse
import os

from prime_sdk.client_services import PrimeServicesClient
from prime_sdk.services.futures import GetDerivativePositionsRequest


def main():
parser = argparse.ArgumentParser(description="List portfolio derivative positions")
parser.add_argument(
"--portfolio-id", help="Portfolio ID (overrides PRIME_PORTFOLIO_ID env var)"
)
parser.add_argument("--product-id", help="Optional product ID filter")
args = parser.parse_args()

client = PrimeServicesClient.from_env()
portfolio_id = args.portfolio_id or os.getenv("PRIME_PORTFOLIO_ID")

if not portfolio_id:
print(
"Error: Portfolio ID is required. Set PRIME_PORTFOLIO_ID env var or use --portfolio-id"
)
return

request = GetDerivativePositionsRequest(
portfolio_id=portfolio_id, product_id=args.product_id
)

try:
response = client.futures.get_derivative_positions(request)
print(response)
except Exception as e:
print(f"failed to get derivative positions: {e}")


if __name__ == "__main__":
main()
53 changes: 53 additions & 0 deletions prime_sdk/examples/futures/get_derivatives_currency_summary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright 2026-present Coinbase Global, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# #docs operationId: PrimeRESTAPI_GetDerivativesCurrencySummary
# #docs operationName: Get Portfolio Derivatives Currency Summary

import argparse
import os

from prime_sdk.client_services import PrimeServicesClient
from prime_sdk.services.futures import GetDerivativesCurrencySummaryRequest


def main():
parser = argparse.ArgumentParser(
description="Get portfolio derivatives currency summary"
)
parser.add_argument(
"--portfolio-id", help="Portfolio ID (overrides PRIME_PORTFOLIO_ID env var)"
)
args = parser.parse_args()

client = PrimeServicesClient.from_env()
portfolio_id = args.portfolio_id or os.getenv("PRIME_PORTFOLIO_ID")

if not portfolio_id:
print(
"Error: Portfolio ID is required. Set PRIME_PORTFOLIO_ID env var or use --portfolio-id"
)
return

request = GetDerivativesCurrencySummaryRequest(portfolio_id=portfolio_id)

try:
response = client.futures.get_derivatives_currency_summary(request)
print(response)
except Exception as e:
print(f"failed to get derivatives currency summary: {e}")


if __name__ == "__main__":
main()
10 changes: 9 additions & 1 deletion prime_sdk/examples/products/list_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def main():
)
parser.add_argument("--limit", type=int, help="Number of results to return")
parser.add_argument("--cursor", help="Pagination cursor")
parser.add_argument(
"--product-type",
help="Filter by product type (SPOT, FUTURE, OPTION)",
)
args = parser.parse_args()

client = PrimeServicesClient.from_env()
Expand All @@ -46,7 +50,11 @@ def main():
if args.limit or args.cursor:
pagination = PaginationParams(limit=args.limit, cursor=args.cursor)

request = ListProductsRequest(portfolio_id=portfolio_id, pagination=pagination)
request = ListProductsRequest(
portfolio_id=portfolio_id,
product_type=args.product_type,
pagination=pagination,
)

try:
response = client.products.list_products(request)
Expand Down
Loading
Loading