Production & Simulated Trading
Production & Simulated Trading: Agent Java SDK v0.3.0 integration, examples, parameters and response semantics.
This guide targets Agent Java SDK v0.3.0 and Java 8+.
Choose both the frontend mode and the funds environment
Configure the partner backend’s funds environment separately from the frontend trading mode. Binding and entry credentials are shared; issuing a ticket or token does not select a wallet or move funds.
For wallet-transfer-status, omitting environment uses the original order’s saved environment, including a simulated order. An explicitly conflicting environment is rejected. Prefer storing the environment and passing it explicitly when recovering an operation.
isSimulatedUser describes the account. It does not route new requests to a simulated wallet. Omitting environment on a new funds request still selects production, even when the account flag is true.
Supported Java request models
These requests support withEnvironment(ExecutionEnvironment.SIMULATED):
TransferRequest,TransferAllOutRequest,ReverseOrderRequest.QueryOrderRequest,ListOrdersRequest.QueryUserAssetsRequest.WalletTransferRequest,WalletTransferQueryRequest.
bind, queryAccount, createEntryUrl, createEmbedToken, and the six perpetual query request models do not select a funds environment.
Initialize client using Quick Start and use the public user ID from your saved binding.
Preserve the original environment
Persist the interface type, agentOrderNo, user identity and environment before sending a funds request. Keep that environment during status queries, recovery, reconciliation and webhook processing. After a timeout, never retry by omitting the original environment or using a new order number.
Funding/Contract transfers stay within one environment. Simulated funds cannot become production funds. Use separate partner-side simulated accounting and recognizable order prefixes such as SIM-.
Simulated integration sequence
- Bind the user and save the public platform user ID.
- Query balances with explicit
SIMULATEDand include Funding when needed. - Create a small simulated Funding transfer and persist its original business order.
- Confirm the final result with the dedicated Funding status query.
- Open or embed the target seconds page in
demomode. - Query the same simulated wallets and reconcile the actual transferred amount.
- To test perpetual trading, transfer simulated Funding to simulated Contract and use the simulated futures frontend. The six partner perpetual queries cannot validate simulated trading history.
Acceptance checklist
Before switching to production, change both the backend funds target and frontend mode. Pending orders continue to recover in their original environment.