> For the complete documentation index, see [llms.txt](https://city-protocol.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://city-protocol.gitbook.io/docs/developers/city-protocol-sdk/add-fund.md).

# Add fund

Generate user deposit addresses and list the assets accepted for deposit.

`CityFundClient` lists the assets and networks accepted for deposit and generates a user deposit address for each recipient, so users can fund their accounts from any supported network.

## How it works

`CityFundClient` authenticates with an API key issued for your integration and needs no wallet connection. The key, `FUN_API_KEY`, is a server-side secret tied to your fun.xyz integration, so the client runs on your backend behind a thin route that keeps the key private and gives you a hook for policy enforcement.

<figure><img src="https://3297077862-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJxNp2waFk6hg1G4lEQZu%2Fuploads%2FHuQjTwXgtXcqlwspfBTg%2Ffig-sdk-addfund.png?alt=media" alt="Eight stages from the asset picker through your backend route&#x27;s policy checks and getUdaAddress to the displayed address, then the user&#x27;s deposit, fun.xyz routing, arrival at recipientAddr and the confirmed balance"><figcaption><p>From asset picker to confirmed balance. Your backend route holds the key, checks policy and generates the deposit address, and fun.xyz routes the funded asset to the recipient on the destination network.</p></figcaption></figure>

{% stepper %}
{% step %}

### Supported assets

`getSupportedAssets` returns the assets and networks accepted for deposit, each with `symbol`, `name`, `network`, `tokenAddress` and `decimals`. The list populates the asset picker and validates the user's choice before any address is generated.
{% endstep %}

{% step %}

### Policy checks

Before it generates an address, your backend route runs compliance checks against the user and the wallet and enforces your allowed-asset policy, such as stablecoins only.
{% endstep %}

{% step %}

### Deposit address

`getUdaAddress` generates a unique User Deposit Address (UDA), one-time or session-scoped, from the recipient's wallet address (`recipientAddr`), your internal user identifier (`userId`), the source and destination chain IDs (`network` and `toNetwork`) and the target token on the destination network (`toTokenAddress`). The route logs each generation to your audit trail and maps the address to your user record for reconciliation, and the frontend shows it with the expected asset, the network and any minimum-amount guidance.
{% endstep %}

{% step %}

### Funding and routing

The user sends a supported asset to the UDA. The fun.xyz infrastructure manages the address, and its pipeline handles bridging, swapping and final delivery to `recipientAddr` on the target network.
{% endstep %}

{% step %}

### Confirmation

Your application polls or subscribes to onchain events on the destination network to confirm arrival at `recipientAddr` and updates the balance. The user can then trade, save or allocate into vaults through `CityClient`.
{% endstep %}
{% endstepper %}

{% content-ref url="/pages/8Bkdn8mMqSU52EOQZ02L" %}
[Create a fund client](/docs/developers/city-protocol-sdk/add-fund/create-a-fund-client.md)
{% endcontent-ref %}

{% content-ref url="/pages/6UEtpTixhpO1z0pjyL2e" %}
[Query methods](/docs/developers/city-protocol-sdk/add-fund/query-methods.md)
{% endcontent-ref %}

{% content-ref url="/pages/FWlssXC2Cm4Et8WmocAr" %}
[Backend integration](/docs/developers/city-protocol-sdk/add-fund/backend-integration.md)
{% endcontent-ref %}

{% content-ref url="/pages/49Tal9dKN3VCc0joYDHw" %}
[Common frontend flow](/docs/developers/city-protocol-sdk/add-fund/common-frontend-flow.md)
{% endcontent-ref %}
