> For the complete documentation index, see [llms.txt](https://bubblegum-reality.gitbook.io/bubblegum-reality-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bubblegum-reality.gitbook.io/bubblegum-reality-docs/compliance/eligibility.md).

# Eligibility Gate

A gate before **any** trade action. Client-persisted for UX, server-enforced for effect. It fails closed.

## Claim

```ts
interface EligibilityClaim {
  region?: string;                    // ISO-ish code, upper-cased
  notRestrictedPerson?: boolean;
  reviewedRiskDisclosure?: boolean;
  understandsTokenizedDebt?: boolean;
}
```

All four are required. Every field is optional in the type precisely so the evaluator must handle absence explicitly rather than trusting a caller.

## Evaluation order

`evaluateEligibility()` in `src/lib/eligibility.server.ts` returns `{ eligible, reason }`:

| Order | Failure                          | Reason                                     |
| ----- | -------------------------------- | ------------------------------------------ |
| 1     | claim is `null` / `undefined`    | Eligibility has not been established.      |
| 2     | no region                        | Select your country or region.             |
| 3     | `notRestrictedPerson` falsy      | Restricted-person confirmation is missing. |
| 4     | `reviewedRiskDisclosure` falsy   | Risk disclosure has not been acknowledged. |
| 5     | `understandsTokenizedDebt` falsy | Tokenized-debt acknowledgement is missing. |
| 6     | region is restricted             | Trading is not available in `{REGION}`.    |

Order matters: the region-restriction check runs **last**, so a user who has not acknowledged anything gets an acknowledgement prompt rather than a jurisdiction message.

## Restricted regions

Configured server-side via `RESTRICTED_REGIONS` as a comma-separated list, upper-cased and trimmed. When unset, the default is:

```
US, CU, IR, KP, SY, RU, BY, VE, MM, OTHER
```

`OTHER` is restricted by design — an unrecognized or unlisted region is treated as restricted, not as permitted.

## Enforcement points

1. **Client** — `src/hooks/use-eligibility.ts` persists the claim to `localStorage` and `src/components/terminal/eligibility-gate.tsx` blocks trade UI until it is complete.
2. **Server** — `fetchFirmQuote` requires the full claim and returns `NOT_ELIGIBLE` **before** any 0x call. Clearing `localStorage` does not obtain a firm quote.

Indicative pricing does not require eligibility; it is a read, not a trade path.

## Privacy

No eligibility detail is logged — not the region, not the acknowledgements. The claim is evaluated and discarded.

## Limits

This is a self-attestation mechanism. It is not KYC, not identity verification, not geolocation, and it does not by itself constitute legal compliance. See [Disclaimers](/bubblegum-reality-docs/compliance/disclaimers.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bubblegum-reality.gitbook.io/bubblegum-reality-docs/compliance/eligibility.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
