monaco.api.copy_trading
Source: protos/api/copy_trading.proto
Use CopyTradingService to register as a lead trader, browse and follow lead traders, and manage your follows. A follow allocates collateral to a copy account (a cross risk bucket inside your margin account) and mirrors the leader’s fills into it as market orders under your own account.
Notes
ListLeadTraders,GetLeadTraderandListLeadTraderClosedTradesare public (no auth). Every other RPC requires authentication and is scoped to the session’s account.- A leader is addressed by their custom TraderCode handle. The sequencer allows one lead profile per wallet (a second application’s registration from the same wallet is refused with
INVALID_ARGUMENT), so a handle names one leader; a leader without a custom handle is not publicly addressable and is not listed. Users appear by wallet address and adisplaystring (the custom handle when claimed), never an internal id.GetLeadTraderreturnsNOT_FOUNDfor a suspended leader. UpsertLeadTraderregisters you or edits your profile. A registration must meet the platform’s eligibility rules (account equity, trading history, closed positions, and a claimed custom TraderCode handle); a refused registration returnsINVALID_ARGUMENTnaming the rule. The profile is replaced as sent: an omittedbioormin_allocationclears it, an omittedstatusmeansACTIVE, and an omittedshare_bpskeeps your current share.UpsertFollowwithoutfollow_idcreates a follow; with it, edits one of your follows. An edit takes the leader from the follow, so it keeps working after the leader releases their handle (leadermay be empty; a handle naming a different leader is refused).copy_existingon a create also copies the leader’s open positions into the new copy account; it applies only to a create (INVALID_ARGUMENTon an edit), and the follow keeps recording whether it copied at creation.PreviewFollowshows what a follow with those terms would open if it setcopy_existing, as totals only:estimated_margin(what the copies would reserve at placement) andestimated_fee, both rounded up to cents, pluscopied_positions,skipped_positionsandtruncated. It names no market, side or reason: the caller does not follow the leader yet. It is read-only and has the same session and terms rules asUpsertFollow:PERMISSION_DENIEDfor delegated agent and sub-account sessions,NOT_FOUNDfor an unknown or suspended leader,INVALID_ARGUMENTfor terms a follow would refuse, andFAILED_PRECONDITIONwhile copy trading is off. It spends the order-risk preview budget and the engine’s preview lane share. At most 64 positions are sized;truncatedis set when more matched.StopFollowstops one of your own follows. It is an exit and is never gated: only ownership applies (a banned or sub-account session can still stop its own follow), except that a delegated agent session cannot. It stays available during an operations block; registrations and follows do not.ListLeadTraderOpenPositionsis visible only to the leader’s current followers (a live follow in the session’s application); anyone else getsPERMISSION_DENIED. It is addressed by handle, so once a leader releases their handle it answersNOT_FOUNDeven for current followers, who still see the follow throughListMyFollowsandGetFollow, and the leader’s positions throughListFollowLeaderPositions.ListFollowLeaderPositionslists the open positions of the leader one of your follows copies, taking the leader from the follow.NOT_FOUNDunless the follow is yours;PERMISSION_DENIEDunless it is live (ACTIVEorCLOSE_ONLY).GetFollowResponse.copy_account_equityis the copy account’s equity at the engine’s marks: its collateral plus the unrealized PnL of its positions. It is a balance, not trading PnL, and it is absent when the engine cannot be read.- Delegated agent sessions and sub-account sessions cannot register or follow (
PERMISSION_DENIED); a delegated agent session cannot stop a follow either. A follow or profile that is not yours returnsNOT_FOUND. - When copy trading is switched off, registrations and new follows return
FAILED_PRECONDITION. - Stats (
LeadTraderStats) come from the leader’s account PnL rollups over 7d, 30d, 90d and all-time.pnlis trading PnL (realized plus unrealized, net of fees and funding).roi_pctdivides it by the highest base balance over the window (starting equity plus net deposits), so a withdrawal cannot inflate it; it is absent when that base is not positive.max_drawdown_pctis the largest peak-to-trough fall of cumulative PnL over the same base, sampled at the window’s rollup interval (1h for 7d, 4h for 30d and 90d, 1d for all-time).win_rate_pctcounts winning over winning plus losing closes. A risk bucket’s cash balance never feeds these figures. LeadTraderFollowSummary.allocatedis the collateral allocated by live follows (AUM as allocated, not marked to market).aum_equityis the same AUM marked: the summed equity of the live follows’ copy accounts at the engine’s marks, absent when it could not be read.sort=aumranks by it, with leaders lacking it last.ListLeadTradersserves a leaderboard snapshot refreshed about once a minute (as_of); it listsACTIVEleaders only, sorted highest first bysort, with leaders lacking a value for the metric last.- Lists use cursor pagination: omit
page_tokenfor the first page, then send each response’snext_page_tokenuntil it is empty. A token only works with the filters and sort that produced it (INVALID_ARGUMENTotherwise). There are no totals. Page size: up to 1000 on your own lists (ListMyFollows,ListMyFollowers), up to 100 on the public lists.

