> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xmonaco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# V1.0.2

# Monaco Protocol SDK v1.0.2

This release ships PitPass TraderCodes — Monaco's referral program — alongside the full tiered-fee system. Every user gets a unique referral code; rewards accrue from referred users' trading activity up to three levels deep, funded from net protocol fees and instantly transferable into any trading balance.

## Added

### PitPass TraderCodes

Every Monaco wallet now has a unique TraderCode. Share it to earn a share of the net protocol fee generated by referred users' trades — up to three levels deep.

**How rewards work:**

| Level | Relationship | Rate |
| - | - | - |
| L1 | Direct referral's trades | 30% of net fee |
| L2 | L1's referral's trades | 15% of net fee |
| L3 | L2's referral's trades | 5% of net fee |

Rewards are computed on the realized net fee at fill time (taker fee minus maker rebate) and credited instantly to a per-user rewards bucket. The bucket is app-agnostic — rewards accumulate regardless of which Monaco application generated the trade.

**New endpoints:**

* **REST / TypeScript SDK / gRPC** — `GET /api/v1/pitpass/codes/me` — return the authenticated user's TraderCode
* **REST / TypeScript SDK / gRPC** — `GET /api/v1/pitpass/codes/{code}` — public lookup to validate a referral code at signup
* **REST / TypeScript SDK / gRPC** — `GET /api/v1/pitpass/rewards/balance` — read accrued rewards across all reward tokens
* **REST / TypeScript SDK / gRPC** — `POST /api/v1/pitpass/rewards/transfer` — move rewards into a trading balance (ledger-only, no gas, immediately tradeable)

**Auth verify — new optional field:**

`POST /api/v1/auth/verify` now accepts an optional `referralCode` field. When a new user provides a valid code on first sign-in, a referral relationship is recorded atomically. Invalid codes and codes supplied for returning users are silently ignored and never block sign-in.

```typescript theme={null}
// Capture ?ref=CODE from URL and pass at auth time
await sdk.auth.authenticate("your-client-id", capturedCode);

// Get and share your own code
const { code } = await sdk.pitpass.getMyTraderCode();

// Check earned rewards
const { balances } = await sdk.pitpass.getRewardsBalance();

// Move rewards to trading balance
await sdk.pitpass.transferRewards({ token: "0xusdc...", amount: "1000000" });
```

### Tiered fees

Fee tiers are now applied per-user based on a 14-day rolling weighted volume (`14d perp + 2.5 × 14d spot`). Six tiers are available. Volumes are recomputed daily at 00:00 UTC. The current tier and the volume needed to reach the next tier are returned by `GET /api/v1/fees/tier` (added in v0.8.18).

## Upgrade

```bash theme={null}
npm install @0xmonaco/core@1.0.1 @0xmonaco/types@1.0.1 @0xmonaco/react@1.0.1
# or bun
bun add @0xmonaco/core@1.0.1 @0xmonaco/types@1.0.1 @0xmonaco/react@1.0.1
```

The new `pitpass` namespace is additive. Auth verify gains one optional field (`referralCode`). All other existing endpoint shapes, field names, and authentication requirements are unchanged.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.