> For the complete documentation index, see [llms.txt](https://docs.sodex.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sodex.com/for-developers/api-reference/wealth-api.md).

# Wealth API

Discover listed funds, read market history, check the current trading channel, request an RFQ quote, and query a wallet's ledger, holdings, and profit and loss.

**Mainnet base URL:** `https://mainnet-gw.sodex.dev/api/v1/wealth`

Every response uses HTTP 200. `code` `0` is success and carries `data`. `code` `-1` is failure and carries `error`. `timestamp` is Unix time in milliseconds. A successful health check omits `data`.

```json
{
  "code": 0,
  "timestamp": 1780000000000,
  "data": {}
}
```

```json
{
  "code": -1,
  "timestamp": 1780000000000,
  "error": "invalid parameter: fundId"
}
```

| `error`                                                  | When                                                                                                     |
| -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `invalid parameter: <name>`                              | A query or body field is rejected. A Wealth message that contains `bad input` is rewritten to this form. |
| `invalid request body: <message>`                        | The RFQ body is not JSON.                                                                                |
| `internal server error: wealth service unavailable`      | Wealth cannot be reached.                                                                                |
| `internal server error: wealth fund service unavailable` | The legacy asset list cannot reach the fund service.                                                     |
| Any other string                                         | The Wealth business message.                                                                             |

Amounts, shares, ratios, and prices are decimal strings. Parse them as decimals. A wallet address is `0x` or `0X` plus 40 hex characters. `fundId` is case-sensitive.

## REST API

{% content-ref url="/pages/5gasRARoKckLhAAre4qP" %}
[Funds](/for-developers/api-reference/wealth-api/funds.md)
{% endcontent-ref %}

{% content-ref url="/pages/FytdQrUn1OprVWYcB9Yb" %}
[Markets](/for-developers/api-reference/wealth-api/markets.md)
{% endcontent-ref %}

{% content-ref url="/pages/L63DkYfJHl0ox6fA6QPm" %}
[Trading](/for-developers/api-reference/wealth-api/trading.md)
{% endcontent-ref %}

{% content-ref url="/pages/yaEDCLtuvKdG09rz8Hlv" %}
[User Fund History](/for-developers/api-reference/wealth-api/user-fund-history.md)
{% endcontent-ref %}

{% content-ref url="/pages/OLQ5Q4Javy0QnNuFiL2E" %}
[Positions and PnL](/for-developers/api-reference/wealth-api/positions.md)
{% endcontent-ref %}

{% content-ref url="/pages/mFKi3PHNs7d9rUoms6P7" %}
[Recurring Buy Plans](/for-developers/api-reference/wealth-api/recurring-buys.md)
{% endcontent-ref %}

## Health

`GET /health`

```bash
curl "https://mainnet-gw.sodex.dev/api/v1/wealth/health" \
  -H "Accept: application/json"
```

Success means the downstream Wealth service is reachable. The body has `code` and `timestamp` only.

## Contract reference

{% content-ref url="/pages/nWiPb6EVD66EsJWdIuSs" %}
[Vault Contracts](/for-developers/api-reference/wealth-api/vault-contracts.md)
{% endcontent-ref %}

## Documentation

{% content-ref url="/pages/HsGuBebtzTDPQcpfRUyF" %}
[Quickstart](/for-developers/developers/wealth/quickstart.md)
{% endcontent-ref %}
