Monaco Protocol SDK v0.8.4
Delegated Agents
Delegated agents let an owner wallet authorize a separate signer address to submit orders on the owner’s behalf. The owner retains custody of all funds, collateral movement, and withdrawal rights. The agent can only perform the trading actions permitted by its policy.How it works
- Owner calls
upsertDelegatedAgentto register an agent address and define its constraints. - Agent authenticates with its own wallet (normal
sdk.authchallenge flow), then callscreateDelegatedSessionwith the owner’s user ID to receive a short-lived, owner-scoped delegated auth session. - Agent signs trading requests with that delegated session. Orders are matched and settled against the owner’s margin accounts; the agent wallet is recorded as the signer.
Owner setup
Agent session
The agent first authenticates with its own wallet, then exchanges for an owner-scoped delegated session using a locally generated session public key:Placing orders as an agent
Once the delegated session is active, place orders normally. PassstrategyKey to let Monaco
auto-resolve or create an isolated margin bucket for that key, so you never need to manage
marginAccountId directly:
strategyKey maps to a dedicated, owner-owned margin account. Omitting strategyKey
uses the owner’s default margin account for the trading pair.
List and revoke
UpsertDelegatedAgentRequest shape
strategyKey on order placement
Both placeLimitOrder and placeMarketOrder now accept an optional strategyKey field. Monaco
uses this to resolve the owner’s parent margin account and target the isolated bucket for the
given (market, strategyKey) pair. This is the recommended way for delegated agents to trade
without managing bucket IDs manually — but it is also usable in non-delegated flows for strategy
tagging and segregated margin accounting.
strategyKey is also available on batchCreate and batchReplace per-order params.
Migration
No breaking changes. All additions are opt-in:sdk.delegatedAgentsis a new module — existing code is unaffected.strategyKeyis optional — all existing order placement calls work without change.

