How funds move
| Flow | How |
|---|---|
| External → funding | Deposit address route configured to stop in Funding |
| External → trading | Deposit address route configured to continue to Trading |
| Funding → funding | On-chain Funding Account transfer |
| Funding → trading | On-chain TradingGateway.deposit via chain (not ConnectRPC) |
| Funding → external | On-chain FundingAccount.withdrawToChain plus Zipper fee quote |
| Trading → funding | client.withdraw.prepare_api_key_to_funding, submit_prepared |
| Trading → external | client.withdraw.prepare_api_key_to_external_chain |
| Trading → trading | client.internal_transfers.create |
Also: Zipper config (client.zipper), lifecycle reads/streams (client.lifecycle), address book
for destinations.
Product overview: Funds & Transfers.
Deposit addresses
addr = await client.deposit.create_address(chain_id=1)
listed = await client.deposit.list_addresses(chain_id=1)See Deposit.
Trading withdraws
API-key bots prepare and persist an exact signed request, then submit it (no browser wallet signer on this SDK):
from pathlib import Path
from polyester import new_trading_withdraw_idempotency_key
prepared = client.withdraw.prepare_api_key_to_funding(
asset_id=2,
quantity="100.00",
idempotency_key=new_trading_withdraw_idempotency_key(),
)
# Persist before the first submission.
Path("withdraw-request.pb").write_bytes(prepared.request_bytes)
result = await client.withdraw.submit_prepared(prepared)Submit the same persisted request unchanged on retry. Details: Withdrawals.
Internal transfers
await client.internal_transfers.create(
asset_id=2,
quantity="10",
idempotency_key="xfer-1",
destination_subaccount_id="123",
)On-chain Funding helpers
from polyester.chain import (
POLYESTER_TESTNET_ENVIRONMENT,
PolyesterSmartAccount,
encode_trading_gateway_deposit,
)
account = PolyesterSmartAccount(
owner_private_key="0x...", # your EOA
environment=POLYESTER_TESTNET_ENVIRONMENT,
)
deposit = encode_trading_gateway_deposit(
trading_gateway=POLYESTER_TESTNET_ENVIRONMENT.contracts.trading_gateway_address,
u_asset_id="0x...",
quantity_scaled=10**18,
)
account.send_calls([deposit])Full surface: Chain helpers.
Security
High-risk money movement may require additional account controls. See Withdrawals & transfers security.
Related Topics
Authentication Configure Ed25519 API keys, Account ID, and env-based wiring for bots. Market data Read candles, public trades, order books, and market overview, no credentials required. Trading Place, modify, cancel, and batch spot orders; use triggers and risk attachments. Streaming Subscribe to public and private WebSocket Protobuf channels with async iterators, handshake-before-return, and fail-closed overflow. Accounts & balances Funding vs trading balances, reserved amounts, subaccounts, policies, and transfer history. Server-side usage Long-running bots, process lifecycle, catalogs, and configuration tips. Error handling Classify failures, retry safely with idempotency keys, and handle realtime overflow. Production trading operations Operate, test, troubleshoot, and upgrade an automated Python trading system safely.