# Common Integration Flows

#### Deposit Screening

1. When a user initiates a deposit, call `amlClient.analyzeWallet()` with their source address.
2. Inspect the analysis response for risk scores and flagged categories.
3. If the risk score exceeds your threshold, block the deposit and route the case to your compliance queue. Otherwise, proceed with the vault `deposit` or `mint` call via `CityClient`.

#### Transaction Monitoring

1. After a deposit transaction confirms on-chain, call `amlClient.analyzeTransaction()` with the transaction hash and a `customer_reference` tying it to the user and action.
2. Store the returned analysis ID in your database.
3. Poll with `getTransactionAnalysis()` or consume a webhook (if your backend supports it) to retrieve the final result.
4. Apply your risk policy — flag, freeze, or allow — based on the returned exposure breakdown.

#### Reference Data Sync

For the best operator experience, we recommend pre-fetching reference data at startup or on a scheduled interval. Call `listSupportedAssets()` to validate your asset coverage, `listRiskRules({ includeIdMap: true })` to populate your rule-label cache, and `listCriteriaCategories()` to keep category displays in your compliance dashboard current. This avoids redundant calls on each analysis request and keeps your internal tooling responsive.


---

# Agent Instructions: 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:

```
GET https://city-protocol.gitbook.io/docs/software-development-kit/aml/common-integration-flows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
