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

# Units and pricing

> How quantities, prices and totals are measured: grams and kilograms, rupees per 10 grams or per kilogram, and decimal strings.

Bullion is traded by **weight**, not by lots or contracts. Every quantity, price and total in the API follows the rules on this page.

## Quantities are weights

An order's `quantity` is a weight in the **symbol's quoted measure**:

| Symbol quoted per | `quantity` is in | `unit` |
| - | - | - |
| gram or 10 grams (for example `GOLD_TRADE_999`) | grams | `g` |
| kilogram (for example `SILVER_999`) | kilograms | `kg` |

So `"quantity": 10` on `GOLD_TRADE_999` is 10 grams, and `"quantity": 2.5` on `SILVER_999` is 2.5 kilograms. The measure follows how the **symbol** is quoted, not the metal: check `unit` on the order rather than assuming silver means kilograms.

In a request, `quantity` is a JSON number greater than 0, with at most 4 decimal places. A symbol or your trading group can add its own size rule (minimum, maximum or step), refused with `400 quantity_rule` or `400 group_quantity_rule`.

## Prices are per quoted measure

`price` is the rate in rupees **per the symbol's quoted measure**: per 10 grams for the gold symbols above, per kilogram for silver. It is your own price, the same one the Bullionwale app shows you, with your account's pricing applied. You buy at the buy price and sell at the sell price.

To protect an order against a moving market, send `expected_price`: the price you showed or expect. If the live price has moved beyond Bullionwale's tolerance from it, the order is refused with `409 price_moved` and nothing is booked.

## Totals

`total` is the order's value in rupees:

```text theme={null}
total = price × (quantity ÷ size of the quoted measure, in the quantity's unit)
```

rounded to the paisa (2 decimals, half to even). For example:

| Order | Price | Total |
| - | - | - |
| 10 g of `GOLD_TRADE_999` | ₹141,250.00 per 10 g | 141,250.00 × (10 ÷ 10) = **₹141,250.00** |
| 25 g of `GOLD_TRADE_999` | ₹141,250.00 per 10 g | 141,250.00 × (25 ÷ 10) = **₹353,125.00** |
| 2.5 kg of `SILVER_999` | ₹165,000.00 per kg | 165,000.00 × (2.5 ÷ 1) = **₹412,500.00** |

A common mistake is `price × quantity` for gold: that is ten times too high, because the price is per 10 grams.

## Positions and limits are per metal

Positions and weight allocations are kept **per metal**, in the metal's own unit, whatever the symbol:

| Metal | Unit in `GET /positions` |
| - | - |
| Gold | `g` (grams) |
| Silver | `kg` (kilograms) |

See [Positions](/api-reference/positions/overview).

## Amounts are decimal strings

Every amount and weight in a response (`price`, `total`, `quantity`, `net`, `limit`, `close_price`, `realized_pnl`, …) is a **string** such as `"141250.00"` or `"10.0000"`, so no precision is lost in JSON. Parse them as decimals, never as floating-point numbers:

```python theme={null}
from decimal import Decimal

order = {"price": "141250.00", "quantity": "25.0000", "unit": "g", "total": "353125.00"}
assert Decimal(order["price"]) * Decimal(order["quantity"]) / 10 == Decimal(order["total"])
```

The number of decimals shown can differ between fields and environments (`"10"` and `"10.0000"` are the same weight), so compare values as decimals, not as text.

## Profit and loss

Only **realized** profit and loss exists: `realized_pnl` on a production order, set once Bullionwale has closed it. There is no mark-to-market or unrealized P\&L in the API.


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