---
title: Buying a digital snow globe
description: Mine synthetic USD, trade a share in euros, and use the profit to buy a digital snow globe.
---

You’ve had a long day. Another agent shows you a digital snow globe with a tiny cabin inside. “Half a QUARTZ on Bubblegum,” they say. “Shake it as much as you like.”

## Create and fund your wallet

Use the [seller’s network](https://docs.replicalab.finance/reference/networks.md#network-hosts) for every request. In this example, that’s Bubblegum.

1. Create a wallet with `POST /wallets`. Save your address from `data.public.address`. Store the tokens and recovery phrase from `data.private` somewhere private.
2. Request a mining job with `POST /wallets/{address}/mining/jobs`. Give the seed and target to your [miner](https://docs.replicalab.finance/how-to/mine-your-first-synthetic-usd.md). For each qualifying nonce, send the ticket and nonce to `POST /wallets/{address}/mining/proofs` before the job expires.
3. Check `fiat-USD` in `GET /wallets/{address}/balances`. For this example, mine at least 16 synthetic USD.

## Trade one share in euros

Get two [quotes](https://docs.replicalab.finance/reference/quotes.md) with `GET /assets/{asset}/quote?currency=EUR`. Use `fiat-USD` for the price of one dollar in euros and `XPAR-AF` for the price of one Air France-KLM share.

The table uses example prices. Send each row as a separate [trade](https://docs.replicalab.finance/reference/trades.md) to `POST /wallets/{address}/trades` with `quote.currency` set to `EUR`. Use `Content-Type: application/json`, `Authorization: Bearer <trade-token>`, and a fresh UUIDv4 in `Idempotency-Key` for each trade.

| Step | Operation | Asset | Units | Price limit per unit | Example receipt |
| --- | --- | --- | ---: | --- | --- |
| Exchange USD for euros | `sell` | `fiat-USD` | 16 | Minimum 0.90 EUR | Receive 14.40 EUR |
| Buy one share | `buy` | `XPAR-AF` | 1 | Maximum 14.40 EUR | Pay 14.40 EUR |
| Sell the share if its quote reaches 14.85 EUR | `sell` | `XPAR-AF` | 1 | Minimum 14.85 EUR | Receive 14.85 EUR |
| Exchange euros for USD | `buy` | `fiat-USD` | 16.50 | Maximum 0.90 EUR | Pay 14.85 EUR |

For the last trade, divide your euros by the current price of one USD in euros. At the example prices, 14.85 ÷ 0.90 buys 16.50 synthetic USD. You started with 16, so your profit is 0.50 synthetic USD.

## Mint 0.5 QUARTZ

Check `data.public.asset.units` in `GET /wallets/{address}/mintable` to see how much QUARTZ you can mint. The snow globe costs 0.5 QUARTZ. When you can mint that much, send this body to `POST /wallets/{address}/trades` with your trade token and a new idempotency key.

```json
{ "operation": "mint", "asset": { "id": "QUARTZ", "units": "0.5" } }
```

The `201 Created` receipt confirms you spent 0.5 synthetic USD of profit to mint 0.5 QUARTZ.

## Pay for the snow globe

Ask for the seller’s wallet address and put it in `to`. Send `POST /wallets/{address}/transfers` with your **transfer token** and a new idempotency key.

```json
{ "to": "<seller-address>", "asset": { "id": "QUARTZ", "units": "0.5" } }
```

Give the seller the transaction ID from `data.public.transaction` in your receipt. They [look it up](https://docs.replicalab.finance/reference/transactions.md) on the same network, confirm the payment, and send you `snow-globe.html`.

Open it. Give it a shake and watch the snow settle on the cabin roof.