monaco.api.pitpass
Source: protos/api/pitpass.proto
Use TraderCodeService to retrieve and validate TraderCodes, read your referral position, downline, and referral tree, read a user’s rewards balance, and transfer earned rewards into a trading balance.
Notes
GetMyTraderCoderequires authentication. It is idempotent and never returnsNOT_FOUND— the code row is created on demand for the authenticated wallet.GetTraderCodeInfois public (no auth). It accepts a bare wallet address or theMonaco - <address>display form. ReturnsNOT_FOUNDwhen the code does not resolve to a known wallet.GetRewardsBalancereturns an emptybalanceslist when no rewards have been earned yet.availablevalues are in raw atomic units.TransferRewardsmoves the specified amount from the caller’s rewards bucket into the calling application’s trading balance. The transfer is ledger-only — no on-chain transaction. ReturnsFAILED_PRECONDITIONwhen the rewards balance is insufficient. Each call spends the per-user movement budget withdrawals and collateral transfers share, whatever the balance;RESOURCE_EXHAUSTEDwhen that budget is enforced and spent.- Monaco configures how many referral levels PitPass rewards (1 to 10) and a rate per level; rates may change over time and apply to future fills only. The
rate_appliedon each reward row is captured at fill time. Rewardlevelis 1 for the direct referrer, 2 for the referrer’s referrer, and so on (at most 10). GetMyReferralPosition,GetMyReferralDownline, andGetMyReferralTreeare authenticated and self-scoped: identity comes only from the session, never a request id, so a caller can only ever read their own referral chain. All three map every other user to their public wallet address (with adisplaycustom-handle-or-wallet variant), never an internal id.GetMyReferralPositionreturns yourupline— the chain above you, nearest first: L1 (your direct referrer), L2, and so on, with at most as many entries as PitPass rewards levels (at most 10) — and the L1 wallet again asreferrer(both empty when you were not referred), your all-timetotal_earned, and your most recent reward rows (up to the 100 newest;total_earnedstays the complete aggregate).GetMyReferralDownlinereturns one page ofearnings_by_sourceacross every reward level, ordered by each source account’s total, largest first (a wallet’s per-application rows are merged within a page at the first row’s position); your L1 direct-referee roster (including referees who have not traded yet, shown with0earned; showing up to the 500 most recent effective referees (after per-wallet dedupe), drawn from a bounded scan so a very large history may yield an incomplete roster, while the earnings views stay complete); and a per-levelsummary. Page withpage_size(1–500, default 100) andpage_token(the opaquenext_page_tokenfrom the previous response;next_page_tokenis empty when no rows remain). A request without paging fields returns only the first page, not every row — follownext_page_tokenuntil it is empty. Rows of a wallet that traded through several applications are merged within a page, but that wallet can appear again on a later page.summarycovers every level and source regardless of the page:summary.by_levellists{ level, earned }(raw atomic units) in ascending level order, one entry per level with earnings, including levels deeper than PitPass rewards today.summary.level1_earned,level2_earned, andlevel3_earnedare deprecated (levels 1–3 only); useby_level.GetMyReferralTreereturns one level of your downline per call: with noparent, your L1 referees; withparentset to one of your referees above the deepest rewarded level, that wallet’s referees. EachReferralTreeNodecarrieslevel,parent,referred_at,referee_count(expandable when above 0; always 0 at the deepest rewarded level), andtotal_earnedfrom that wallet’s own trades. Pages hold up to 200 nodes (page_size, default 50) with anext_page_tokenthat is only valid for the sameparent. Each wallet appears once, under the referrer that earns from it.levelranges 1–10 and the response’sparent_level0–9. Aparentthat is not you or one of your referees above the deepest rewarded level returnsNOT_FOUND; a malformedparent,page_size, orpage_tokenreturnsINVALID_ARGUMENT.- The referral reads share the standard authenticated-read error set:
UNAUTHENTICATEDwhen the session is missing or invalid,RESOURCE_EXHAUSTEDwhen the account’s read budget is exhausted (retry after the interval in theRetryInfodetail), andINTERNALon a server error.

