Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

polyester-sdk

Latest version: v0.34.1.dev20261128113721

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
PyPI package Publisher: aiiven
4 Stars
1 Forks
89 Versions
11.5K Downloads
Python Repo language

Scan summary

polyester-sdk was last scanned on 28 Nov 2026 at version 0.34.1.dev20261128113721. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 89 versions; the latest 5 were published within 2 days (27 and 28 Nov 2026).
  • Findings: No rules fired in version 0.34.1.dev20261128113721.
  • Downloads: 11,542 downloads.

Versions

89 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.34.1.dev20261128113721 LATEST 28 Nov 2026 No rules fired
0.34.1.dev20261128112816 28 Nov 2026 No rules fired
0.34.1.dev20261127204857 27 Nov 2026 No rules fired
0.34.1.dev20261127180504 27 Nov 2026 Not shown
0.34.1.dev20261127130600 27 Nov 2026 Not shown

No rules fired in 0.34.1.dev20261128113721

Findings

Findings for v0.34.1.dev20261128113721. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.34.1.dev20261128113721; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Polyester Python SDK

Official Python SDK for Polyester APIs, built for trading bots, backend jobs, research notebooks, and automation.

Status: 0.34.0, pre-1.0: a minor release may include breaking changes (see CHANGELOG.md). Licensed under the Apache License 2.0; see also NOTICE. API-key only; no browser login or JWT flows.

Requires Python 3.11+.

Supported surface

Capability Supported
Public market data (spot config, trades, candles) Yes
Order book snapshot + realtime Yes
Market overview (list + subscribe) Yes
Order book heatmap Yes
API-key (Ed25519 signature) auth Yes
Wallet / browser login No
Session MFA enrollment and challenges No
Profile (identity subscribe) Yes
API keys (list/get/subscribe/local keypair generation) Yes
Subaccounts (list/get/members/invites/activity/subscribe) Yes
Address book (list/view/subscribe/create/update) Yes
Policies (realtime subscribe) Yes
Guard signer Yes
VIP tiers + status Yes
Spot fee rates Yes
Trading rate limits Yes
Profit and loss + trading statistics Yes
Product changelog (posts + changes) Yes
Server build version Yes
Price alerts (devnet) Yes
Balances and equity history Yes
Orders (create, cancel, modify, batch, cancel-all) Yes
User trades Yes
Triggers Yes
Internal transfers Yes
Dust conversion Yes
Transfer history Yes
Statement export files Yes
Deposit addresses Yes
Trading / funding withdraws Yes
Zipper deposit-withdraw config Yes
Chain analytics Yes
Lifecycle flows Yes
Realtime account and market streams Yes
Reference catalogs + wait-for-ready Yes
Qty / price decimal + scaled-int inputs Yes
Social verification Yes
Account resolve / lookup No

Rows marked No are intentional for API-key SDKs (use the TypeScript browser client for wallet login and session MFA).

Full cross-language comparison: SDK capability matrix.

Rows marked Yes mean that an SDK wrapper exists; deployment authorization still applies. In particular, social-verification start and mark_ready require an interactive session, and a route may not be mounted. A sub-account member call that targets the sub-account's owner (inviting the owner, accepting an invite for the owner, changing the owner's role or removing the owner) raises PolyesterSubaccountOwnerRoleLockedError, a PolyesterApiError with code == "AUTH_SUBACCOUNT_OWNER_ROLE_LOCKED" (Connect failed_precondition, REST 412). The request changed nothing and is not retryable: show "The owner's role can't be changed", and don't offer these actions for the member whose role is OWNER.

sub_accounts.get(sub_account_id=..., include_balances=True) also returns the sub-account's current balances, a BalancesList in the shape of balances.list (one AssetBalance per asset: funding, trading, reserved, available). Without include_balances, balances is None. It needs the READ_BALANCES action on the sub-account (its role, its attached policy and, for an API key, the key's policy), or the call raises PermissionDenied with AUTH_SUBACCOUNT_ACCESS_DENIED. An API key bound to a sub-account reads only that one; a root-scoped API key cannot read a sub-account's balances. When balances cannot be read right now the call raises AUTH_TEMPORARILY_UNAVAILABLE, which is_retryable_error(err) reports retryable: retry, or omit include_balances for the rest of the view.

view = await client.sub_accounts.get(sub_account_id=sub_id, include_balances=True)
for row in view.balances.balances if view.balances else []:
    print(row.asset_id, row.trading, row.available)

sub_accounts.subscribe() delivers each SubAccount change in order. An update with removed true means the caller no longer has access to that sub-account, for example after its owner removed the caller as a member: drop it from the caller's list. Its role is then empty, never a default role. A change of the caller's role or access does not move revision or updated_at, so apply each update as it arrives. sub_accounts.list and sub_accounts.get never set removed.

subscription = await client.sub_accounts.subscribe()
async with subscription:
    async for update in subscription:
        if update.removed:
            known.pop(update.id, None)
        else:
            known[update.id] = update  # update.role: "viewer", "trader", ...

sub_accounts.list_account_activity(...) returns one page of the security and activity history of the main account and every sub-account the caller may read, newest first; iter_account_activity(...) follows every page with the same filters. Filter by sub_account_ids and include_main_account (alone, it lists only the main account's own events, which carry no subaccount_id), entity_kinds ("session", "api_key", ...), event_actions ("created", "failed", ...), sources, api_key_id, and a timezone-aware start_time (inclusive) and end_time (exclusive). A filter the contract refuses (an unknown label, a repeated value or ID, too many values, an empty range) raises PolyesterValidationError before sending. api_key_id takes the key's ak_… ID, as key_id shows it. Each event names its subaccount_id, who acted in actor (kind "user", "api_key", "system" or "unauthenticated", with the account, the API key's ak_… ID, kind and label, or the system reason), the item it changed in item (kind names the ID that is set, id and name), and what changed in details: the change in its REST JSON form, one key naming the kind of item and holding only the fields the event set. A value that changed is a {"from": ..., "to": ...} pair (text, flags, numbers, times and statuses), an ID that changed a {"fromId": ..., "toId": ...} pair, and a list that changed an {"added": [...], "removed": [...]} or {"addedIds": [...], "removedIds": [...]} change; other fields are plain values, such as a sign-in method or a policy's sourceTemplateId. Keys are camelCase, enums their names, times RFC 3339, and IDs public IDs. A wallet sign-in is a "session" event, "created" or "failed". An API key needs READ_ACCOUNT_ACTIVITY.

Private streams require an Account ID and the corresponding API-key permission. A successful subscribe call means the token exchange and realtime handshake completed. The connection and subscription tokens are renewed on the same connection before they expire; a renewal the API or the server refuses is reported through set_on_error(...), and the subscription then resubscribes when the server ends it. The live order stream renews its own tokens. Treat a structured permission denial as non-transient and update the API-key policy before retrying.

Install

PyPI: https://pypi.org/project/polyester-sdk/

pip install "polyester-sdk==0.34.0"

Realtime (Centrifugo) and on-chain Funding helpers are included by default.

The PyPI sdist/wheel do not include tests/. Full pytest (unit, hardening, live) requires a git checkout of this repository.

For development from a git checkout:

git clone https://github.com/Fabric-Labs/polyester-sdk-python.git
cd polyester-sdk-python
python3.11 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Devnet pre-releases

Stable releases track testnet. While CHANGELOG.md has entries under ## Unreleased, every push to main also publishes a devnet pre-release of the next version, <version>.dev<YYYYMMDDHHmmss> (the commit time, UTC), for trying changes before they reach a stable release. pip installs a pre-release only when asked, so pip install polyester-sdk keeps installing the stable release.

pip install --pre polyester-sdk                          # newest, pre-releases included
pip install "polyester-sdk==0.34.0.dev20261117093000"    # one devnet build

The releases page holds one pre-release per upcoming version, pointing at its newest devnet build, with the changes it carries. A devnet build can change between snapshots, so pin an exact version. RELEASING.md describes both channels.

Examples

Runnable cookbook examples live in the sibling repo polyester-examples-python (REST market data, realtime streams, decimal + scaled-int order paths, and bots).

Quickstart

Create an API key in the Polyester app (API in the sidebar). Copy the key id and private key when shown. The private key is only displayed once. Open the key's Permissions, enable Spot trading, select the markets it may trade, and set a maximum order size appropriate for the strategy. For a subaccount-scoped key, attach an API-key policy that grants ledger reads for balances and private balance streams, plus Spot trading for order mutations. This is separate from the subaccount policy: authorization is the intersection of both policies, so configuring only the subaccount policy is insufficient.

import asyncio

from polyester import AsyncPolyester, POLYESTER_DEVNET_ENVIRONMENT

async def main() -> None:
    async with AsyncPolyester(
        environment=POLYESTER_DEVNET_ENVIRONMENT,
        api_key_id="ak_...",           # from API key creation
        api_private_key="...",       # 64-char hex secret from API key creation
        default_account_id="...",    # Profile → Account ID (see below)
    ) as client:
        overview = await client.market_overview.list(limit=5)
        for market in overview.markets:
            last = market.last_price.ticks if market.last_price is not None else None
            index = market.index_price.ticks if market.index_price is not None else None
            print(market.symbol, last, index)

        open_orders = await client.orders.list_open()
        print(f"{len(open_orders.orders)} open orders")

asyncio.run(main())

Credentials

Value Where to find it Constructor parameter
API key id API → create or view key api_key_id
API private key Shown once when the key is created api_private_key
Account ID Profile → Account ID default_account_id

Pass an environment preset so API, websocket, RPC, and contract pins stay together. POLYESTER_DEVNET_ENVIRONMENT is the constructor default. POLYESTER_TESTNET_ENVIRONMENT targets public testnet (api.testnet.polyester.com, chain 888169). Custom / VPC endpoints use create_polyester_environment or environment.with_urls(...). api_url / ws_url remain as transport overrides. A remote http:// or ws:// URL is refused unless you pass allow_insecure=True to either helper, for a private endpoint whose TLS terminates elsewhere; the environment keeps that opt-in, so the client accepts it. Loopback hosts never need it.

Pass all credentials as constructor parameters. The SDK does not read environment variables unless you pass them in yourself (or use from_env() in scripts; see below). from_env() also reads POLYESTER_ENV=devnet|testnet.

api_private_key accepts the 64-character hex Ed25519 secret from key creation, or raw 32-byte key material.

default_account_id is the Account ID string from your Profile page. Use the value exactly as shown in the app. Do not use an internal numeric id. An account username is optional; Account-ID-based authentication and private channel scoping are valid without one.

default_account_id is optional for public market-data calls. It is required for account-scoped operations such as private realtime channels, bucket transfers, and some ledger writes.

Automatic request signing gives concurrent identical calls distinct authentication tuples. Credentials with the same API key ID share one timestamp allocator in the process, including separate AsyncPolyester and Polyester clients and independently loaded ApiKeyCredentials. The signing protocol has no cross-process nonce, so assign one API key per process; sharing a key between processes can produce identical authentication tuples. Timestamps can lead the local clock by at most half a second. The async client applies bounded, cooperative backpressure without blocking the event loop. The low-level synchronous polyester.auth.sign_request helper instead raises PolyesterRateLimitError immediately when capacity is exhausted; honor retry_after. Neither path reuses a signature or runs past the API's limit, which refuses a timestamp more than one second ahead of the server clock as PolyesterTimestampSkewError. Keep the host clock synchronized.

ApiKeyCredentials redacts the private key in repr, str and logging. Pickling, deep-copying and dataclasses.asdict/astuple raise TypeError, also for a dataclass that holds the credentials; read private_key explicitly when you need it.

api_keys.generate_keypair() and guard_signer.export_wallet() return the private key as a polyester.Secret: repr, str, logging and Rich print [REDACTED], pickling raises TypeError and msgspec refuses to encode it. Read it with keypair.secret_key_hex.reveal(), keypair.secret_key.reveal() or result.private_key.reveal().

recv_window_ms on AsyncPolyester / Polyester sets the receive window of every signed API request: the server processes a request only until its signing timestamp plus that many milliseconds, sent as the signed X-API-RECV-WINDOW header. It must be an int from 1 to 60000, and any other value raises PolyesterValidationError before anything is sent. None, the default, sends no header, and the server applies 5000. A request that arrives after its window raises the retryable PolyesterTimestampSkewError; one that waited past it before admission raises PolyesterApiError with code REQUEST_DEADLINE_EXCEEDED, also retryable. Both changed nothing, and a retry signs again with a fresh timestamp. Realtime token requests always use the default window. polyester.auth.sign_request and canonical_signing_string take the same recv_window_ms for requests you sign yourself; the window's line follows the timestamp line.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases polyester-sdk

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Frame 2085668439 (1)
Group 1261154229