> For the complete documentation index, see [llms.txt](https://docs.flash.trade/flash-trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flash.trade/flash-trade/flash-trade-protocol/build-on-flash/flash-trade-api/flash-trade-v1/data-formats-and-precision.md).

# Data Formats & Precision

### Numeric Precision

| Domain        | Native Decimals     | Display Decimals | Notes                               |
| ------------- | ------------------- | ---------------- | ----------------------------------- |
| USD amounts   | 6                   | 2                | `500000000` native = `"500.00"` UI  |
| Token amounts | Varies              | Varies           | SOL = 9 decimals, USDC = 6 decimals |
| Oracle prices | `(price, exponent)` | Varies           | Compute: `price × 10^exponent`      |
| Leverage      | Basis points (BPS)  | 2                | `50000` BPS = `"5.00"` leverage     |
| Percentages   | —                   | 5                | `"0.03600"` = 0.036%                |

***

### UI String Format

All `*Ui` fields are human-readable decimal strings (e.g., `"148.52"`, `"500.00"`). Parse as floats or display directly.

***

### KMB Formatting

Fields ending in `Kmb` format large numbers for display:

| Raw Value    | Formatted  |
| ------------ | ---------- |
| `999.50`     | `"999.50"` |
| `1500`       | `"1.50K"`  |
| `2500000`    | `"2.50M"`  |
| `3000000000` | `"3.00B"`  |

***

### Base64 Account Data

The `positionAccountData` and `orderAccountData` fields in enriched responses contain raw Anchor account bytes encoded as base64. Use these when enrichment fields are `null`:

javascript

```javascript
import { Program } from '@coral-xyz/anchor';
import { Buffer } from 'buffer';

const rawBytes = Buffer.from(positionAccountData, 'base64');
const position = program.coder.accounts.decode('position', rawBytes);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flash.trade/flash-trade/flash-trade-protocol/build-on-flash/flash-trade-api/flash-trade-v1/data-formats-and-precision.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
