# Transparency

Mosaiq holds client funds in a treasury wallet and in pooled venue accounts. The
transparency view of the console reads each of them from public APIs, in your
browser, every minute, and divides their total by what Mosaiq owes its clients.
Every reserve comes from a public source, not from Mosaiq's servers, so you can
check each figure with the requests on this page. Only the liabilities come
from Mosaiq's ledger.

## Where the funds are

| Location | Account | Asset |
| --- | --- | --- |
| Hyperliquid taker | [`0x3a17bDE82706aaF297A0d721D5c31E4EB3c48B65`](https://app.hyperliquid.xyz/explorer/address/0x3a17bDE82706aaF297A0d721D5c31E4EB3c48B65) | USDC |
| Hyperliquid maker | [`0xa3b5671871105a2aa47be6a5a76c68de70ed0600`](https://app.hyperliquid.xyz/explorer/address/0xa3b5671871105a2aa47be6a5a76c68de70ed0600) | USDC |
| Lighter | [account `693073`](https://app.lighter.xyz/explorer/accounts/693073) | USDC |
| Lighter Robinhood | [account `18320`](https://api.rh.lighter.xyz/api/v1/account?by=index\&value=18320) | USDG |
| Treasury on Arbitrum | [`0x3a17bDE82706aaF297A0d721D5c31E4EB3c48B65`](https://arbiscan.io/address/0x3a17bDE82706aaF297A0d721D5c31E4EB3c48B65) | USDC |
| Treasury on Robinhood Chain | [`0x3a17bDE82706aaF297A0d721D5c31E4EB3c48B65`](https://robinhoodchain.blockscout.com/address/0x3a17bDE82706aaF297A0d721D5c31E4EB3c48B65) | USDG |

The treasury owns both Lighter accounts and trades as the Hyperliquid taker. The
Hyperliquid maker is a sub-account of the treasury.

## How each balance is read

* Hyperliquid counts the total equity of an account (`marginSummary.accountValue`)
  on core and on each HIP-3 dex Mosaiq trades (`xyz`, `mkts`, `io`, `para`), plus
  the USDC it holds in spot. Each dex keeps its own balance, and the margin of
  isolated positions counts.
* Lighter counts the total asset value of an account: collateral, unrealized PnL
  in cross margin, and what isolated positions hold. The console counts an
  account only if the treasury owns it.
* The treasury counts `balanceOf` on the USDC contract on Arbitrum and on the
  USDG contract on Robinhood Chain.
* USDC counts at par. USDG counts at the CoinGecko `global-dollar` price, and a
  price older than an hour leaves USDG out of the total.

## Coverage

Coverage is the reserves divided by `totalUsdc` from
[`GET /v1/liabilities`](/api/liabilities): client equity, withdrawals not paid
yet and deposits waiting for review, read from Mosaiq's ledger at most once a
minute. At 100% or more, every client balance is backed. The console rounds
the coverage down, and shows none while a reserve is unread or a client
position has no fresh price.

```bash
curl -s 'https://production.mosaiq.0d.finance/v1/liabilities' | jq '.data'
```

## Check it yourself

These commands need `curl` and `jq`. Each one sends the same request as the
console.

### Hyperliquid taker

The first command prints the equity on each dex Mosaiq trades. The second prints the USDC held in spot. The balance is their sum.

```bash
for dex in "" "xyz" "mkts" "io" "para"; do curl -s https://api.hyperliquid.xyz/info -H 'content-type: application/json' -d "{\"type\":\"clearinghouseState\",\"user\":\"0x3a17bDE82706aaF297A0d721D5c31E4EB3c48B65\",\"dex\":\"$dex\"}" | jq -r '.marginSummary.accountValue'; done
```

```bash
curl -s https://api.hyperliquid.xyz/info -H 'content-type: application/json' -d '{"type":"spotClearinghouseState","user":"0x3a17bDE82706aaF297A0d721D5c31E4EB3c48B65"}' | jq -r '.balances[] | select(.coin == "USDC") | .total'
```

### Hyperliquid maker

The first command prints the equity on each dex Mosaiq trades. The second prints the USDC held in spot. The balance is their sum.

```bash
for dex in "" "xyz" "mkts" "io" "para"; do curl -s https://api.hyperliquid.xyz/info -H 'content-type: application/json' -d "{\"type\":\"clearinghouseState\",\"user\":\"0xa3b5671871105a2aa47be6a5a76c68de70ed0600\",\"dex\":\"$dex\"}" | jq -r '.marginSummary.accountValue'; done
```

```bash
curl -s https://api.hyperliquid.xyz/info -H 'content-type: application/json' -d '{"type":"spotClearinghouseState","user":"0xa3b5671871105a2aa47be6a5a76c68de70ed0600"}' | jq -r '.balances[] | select(.coin == "USDC") | .total'
```

### Lighter

Prints the total asset value: collateral, unrealized PnL in cross margin, and what isolated positions hold.

```bash
curl -s 'https://mainnet.zklighter.elliot.ai/api/v1/account?by=index&value=693073' | jq -r '.accounts[0].total_asset_value'
```

### Lighter Robinhood

Prints the total asset value: collateral, unrealized PnL in cross margin, and what isolated positions hold.

```bash
curl -s 'https://api.rh.lighter.xyz/api/v1/account?by=index&value=18320' | jq -r '.accounts[0].total_asset_value'
```

### Treasury on Arbitrum

Prints `balanceOf` on the token contract, in micro-units (6 decimals).

```bash
curl -s https://arb1.arbitrum.io/rpc -H 'content-type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"to":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831","data":"0x70a082310000000000000000000000003a17bde82706aaf297a0d721d5c31e4eb3c48b65"},"latest"]}' | jq -r '.result' | xargs printf '%d\n'
```

### Treasury on Robinhood Chain

Prints `balanceOf` on the token contract, in micro-units (6 decimals).

```bash
curl -s https://rpc.mainnet.chain.robinhood.com -H 'content-type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"to":"0x5fc5360d0400a0fd4f2af552add042d716f1d168","data":"0x70a082310000000000000000000000003a17bde82706aaf297a0d721d5c31e4eb3c48b65"},"latest"]}' | jq -r '.result' | xargs printf '%d\n'
```

### USDG price

Prints the USD price the console values USDG at.

```bash
curl -s 'https://api.coingecko.com/api/v3/simple/price?ids=global-dollar&vs_currencies=usd&include_last_updated_at=true' | jq '.["global-dollar"].usd'
```

## Movements

The console lists 30 days of USDC movements from the public ledger of both
Hyperliquid accounts and from the explorer log of the Lighter account.
Rebalancing shows up there as transfers between venues and accounts. The
treasury wallets and Lighter Robinhood have no public log, so their transfers
show only when they reach one of those accounts.

### Hyperliquid taker ledger

```bash
curl -s https://api.hyperliquid.xyz/info -H 'content-type: application/json' -d "{\"type\":\"userNonFundingLedgerUpdates\",\"user\":\"0x3a17bDE82706aaF297A0d721D5c31E4EB3c48B65\",\"startTime\":$(( ($(date +%s) - 2592000) * 1000 ))}"
```

### Hyperliquid maker ledger

```bash
curl -s https://api.hyperliquid.xyz/info -H 'content-type: application/json' -d "{\"type\":\"userNonFundingLedgerUpdates\",\"user\":\"0xa3b5671871105a2aa47be6a5a76c68de70ed0600\",\"startTime\":$(( ($(date +%s) - 2592000) * 1000 ))}"
```

### Lighter log

```bash
curl -s 'https://explorer.elliot.ai/api/accounts/693073/logs?limit=100&offset=0&pub_data_type=L1Deposit,L1DepositV2,L2TransferV2,Withdraw,WithdrawV2'
```

## Limits

* A reading takes a few seconds and about 20 requests. A transfer that lands
  during one can be counted twice or missed until the next reading. A reading
  proves nothing about the time between two readings.
* Money in transit, in a bridge or a venue withdrawal, is in no balance until it
  lands, so reserves dip while a rebalance moves funds.
* There is no insurance fund. A loss at a venue or a bridge comes out of
  reserves.
* Only USDC and USDG count. Other tokens these accounts hold, such as HYPE or
  LIT, do not.
* The treasury also owns Hyperliquid sub-accounts and two Lighter sub-accounts
  that Mosaiq does not trade with. They do not count.
* Liabilities come from Mosaiq's ledger, not from a public source. They differ
  from the reserves in the cases that
  [`GET /v1/liabilities`](/api/liabilities#where-the-figure-and-the-reserves-differ)
  lists, such as a deposit that is in the reserves before its credit.
