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

# Money and time

> Amounts are integers in base units, as strings. Times are RFC3339 in UTC.

Money and token quantities are `Amount` objects, never JSON numbers:

```json theme={null}
{ "value": "12345678", "decimals": 6, "currency": "USD" }
```

That is 12.345678 USD.

* `value` is an integer in base units, as a string, and negative below zero.
* `currency` is `USD`, or the token id of a token quantity (`tok_solana_<mint>`).
* `priceAsOf` is present when we converted a value with a price, and holds the
  time of that price.
* Ratios (`returnPct`, `multiple`) and counts are JSON numbers.

> [!WARNING]
>
> Read `value` with a decimal or big integer type. A float loses digits: a token
> quantity with 18 decimals does not fit in a JavaScript `number`.

```js theme={null}
function formatAmount({ value, decimals }) {
  const raw = BigInt(value);
  const sign = raw < 0n ? "-" : "";
  const abs = raw < 0n ? -raw : raw;
  if (decimals === 0) return sign + abs.toString();
  const base = 10n ** BigInt(decimals);
  const fraction = (abs % base).toString().padStart(decimals, "0");
  return `${sign}${abs / base}.${fraction}`;
}

formatAmount({ value: "12345678", decimals: 6, currency: "USD" });
// "12.345678"
```

## Time

* Times in bodies are RFC3339 in UTC with milliseconds:
  `2026-11-01T08:42:10.250Z`.
* A time in a query parameter, such as `at` on a leaderboard, is RFC3339 with
  `Z` or an offset.
* `observedAt` on a block is when we last read it from the platform.


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