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

# Funding and treasury automation

> Find deposit assets and addresses, then watch balances.

**Who it's for:** treasury and operations teams automating how a trading account is funded.

**What you build:** a funding job that knows which assets each venue accepts, keeps a deposit
address ready for each, and confirms when balances arrive.

## Call sequence

**1. What can be deposited**

[List deposit assets](https://docs.lean.xyz/api-reference/deposits/list-deposit-assets.md): chains and tokens each
venue accepts, with the provider's minimum.

**2. Where to send it**

[Get deposit addresses](https://docs.lean.xyz/api-reference/deposits/list-deposit-addresses.md) returns the addresses
already created. [Create deposit addresses](https://docs.lean.xyz/api-reference/deposits/create-deposit-addresses.md)
creates any that are missing; repeating it returns the same addresses. Neither moves money.

**3. Watch it land**

[Get balances](https://docs.lean.xyz/api-reference/account/list-balances.md).

Building against a test key? [Reset test mode](https://docs.lean.xyz/api-reference/test-mode/reset-test-mode.md) clears
simulated orders and positions and returns test balances to the starting amount, so every run
starts clean.

## Starter

```bash theme={"dark"}
curl -sS "$LEAN_API_URL/v1/deposits/assets" \
  -H "Authorization: Bearer $LEAN_API_KEY"

curl -sS "$LEAN_API_URL/v1/deposits/addresses?venue=hyperliquid" \
  -H "Authorization: Bearer $LEAN_API_KEY"
```

## Guardrails

* **Safe to repeat.** Creating deposit addresses is idempotent: run it on every deploy and you
  get the same addresses back.
* **Read before you write.** Getting addresses never creates one, and neither call moves money.
* **Provider minimums up front.** Each deposit asset lists its minimum, so your job never sends
  an amount too small to credit.


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