> ## 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.16

# Monaco Protocol SDK v1.0.16

This release adds exact tier-resolved fee rates to fee simulation and deprecates the integer/flat fee-bps fields, adds an optional Cloudflare Turnstile token to the faucet, and corrects the HTTP status returned when the matching engine rejects an order-management request. It rolls up the consumer-facing changes shipped since v1.0.7.

## Added

### Exact tier fee rates on fee simulation

`fees.simulateFees` — `GET /api/v1/fees/simulate` and gRPC `FeesService.SimulateFees` — now returns two decimal basis-points strings alongside the existing fields:

| Field | Type | Meaning |
| - | - | - |
| `monacoTakerFeeBpsExact` | `string \| null` | Tier-resolved taker rate the ledger charges this caller, e.g. `"6.5"`. Equals `monacoTakerFee / notional` |
| `monacoMakerRebateBpsExact` | `string \| null` | Tier-resolved maker rebate (negative is a rebate), e.g. `"-1"` |

Fee tiers are per-user and fractional. An integer field cannot represent a rate like `6.5`, so these string fields carry the exact rate the ledger applies. Prefer them for any fee display or reconciliation.

```typescript theme={null}
const fees = await sdk.fees.simulateFees({
  tradingPairId: pair.id,
  side: "BUY",
  price: "65000",
  quantity: "0.1",
});

// exact tier-resolved rate the ledger charges this caller
console.log(fees.monacoTakerFeeBpsExact); // e.g. "6.5"
```

### Optional faucet captcha token

`sdk.faucet.mint()` accepts an optional `turnstileToken` (Cloudflare Turnstile). It maps to the REST request-body field `turnstileToken` and gRPC `MintTokensRequest.turnstile_token`. Omitting it keeps today's behavior; a valid token becomes required once the gateway enables faucet captcha enforcement.

```typescript theme={null}
await sdk.faucet.mint({ turnstileToken: "0x..." });
```

## Changed

### Order-management endpoints return the correct HTTP status on rejection

Place, cancel, replace, and batch order endpoints (including conditional orders) now map matching-engine client-fault rejections to their proper HTTP status instead of surfacing them as `500 Internal Server Error`. For example, an invalid TP/SL trigger price now returns `400`.

| gRPC code | HTTP status |
| - | - |
| `invalid_argument`, `out_of_range`, `resource_exhausted` | `400` |
| `not_found` | `404` |
| `failed_precondition`, `already_exists` | `409` |
| `permission_denied` | `403` |
| `unauthenticated` | `401` |

Genuine matching-engine faults still return `500`. Client code that treated every order rejection as a `500` should branch on the specific status.

### Rust REST SDK builds on native-tls

The published `monaco-sdk` crate now builds its `reqwest` HTTP client on native-tls instead of rustls, matching the rest of the Monaco workspace. Consumers on platforms without a system TLS library — for example static musl builds — now need OpenSSL available at build time.

## Deprecated

### Integer and flat fee-bps fields

The following fields are deprecated because they echo the pre-tiered, pair-level rate rather than the caller's per-user tiered fee:

* `monacoTakerFeeBps` / `monacoMakerRebateBps` (integer) on the fee-simulation response
* `makerFeeBps` / `takerFeeBps` (flat) on the trading-pair and account responses

Use `monacoTakerFeeBpsExact` / `monacoMakerRebateBpsExact`, or `GET /api/v1/fees/tier` / `fees.getMyFeeTier`, for the caller's real rate. The deprecated fields remain populated for backward compatibility.

## Upgrade

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

No response fields were removed and no endpoint paths or authentication requirements changed. If you read `monacoTakerFeeBps` / `monacoMakerRebateBps` or the flat `makerFeeBps` / `takerFeeBps`, migrate to the exact fields (or `getMyFeeTier`) to display the tier-resolved rate. If you handle order-rejection errors by HTTP status, branch on the specific `4xx` codes above instead of assuming `500`.


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