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 (not a ConnectRPC trading deposit) |
| Funding โ external | On-chain Zipper path |
| Trading โ funding | PrepareAPIKeyToFunding โ persist โ SubmitPrepared |
| Trading โ external | PrepareAPIKeyToExternalChain โ persist โ submit |
| Trading โ trading | client.InternalTransfers.Create |
Product overview: Funds & Transfers.
Deposit addresses
addr, err := client.Deposit.CreateAddress(ctx, 1, nil, nil)
listed, err := client.Deposit.ListAddresses(ctx, 1, nil, nil)See Deposit.
Trading withdraws
API-key bots prepare and persist the complete signed request before sending:
import (
"github.com/Fabric-Labs/polyester-sdk-go/models"
"github.com/Fabric-Labs/polyester-sdk-go/services"
)
prepared, err := client.Withdraw.PrepareAPIKeyToFunding(services.PrepareAPIKeyWithdrawParams{
AssetID: 2, Amount: models.AssetAmountFromDecimal("100.00"),
AmountScale: 2, IdempotencyKey: "withdraw-stable-1",
})
if err := os.WriteFile("prepared-withdraw.bin", prepared.RequestBytes(), 0600); err != nil {
log.Fatal(err)
}
result, err := client.Withdraw.SubmitPrepared(ctx, prepared)Wire amount_e18 always uses fixed scale 18. Input scale conversion is exact, overflow checked,
and never rounded. Restore persisted bytes with services.PreparedTradingWithdrawFromBytes and
submit them unchanged after an outcome-unknown error.
Details: Withdrawals.
Internal transfers
dest := "123"
_, err := client.InternalTransfers.Create(
ctx, 2, models.AssetAmountFromDecimal("10"),
"xfer-1", nil, nil, nil, &dest, nil, nil,
)See Internal transfers.
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 with the Go SDK. Streaming Subscribe with Messages() channels, handshake-before-return, and fail-closed overflow. Accounts & balances Funding vs trading balances, holds, subaccounts, policies, and transfer history. Server-side usage Long-running bots, process lifecycle, catalogs, and configuration tips. Error handling Classify Go SDK errors with errors.As, retry with idempotency keys, handle queue overflow. Production trading operations Operate, test, troubleshoot, and upgrade an automated Go trading system safely.