# Fill an offer

> One transaction: the buyer pays in SOL, 95% to the seller, 5% to the PAYDAY buy and burn, coins to the buyer. Market offers are priced on chain when it lands and carry your limit (maxPay). The limit comes from the live market price plus 1%, never from the offer's reference: ABOVE_MARKET means the reference sits over the market (it comes down about 3% a minute). If the price moves past the limit (errCode 6016) or within the same block (NO_FILL_PRICE_MOVED, 6022), build the fill again, show the buyer the new pay and ask again.


`POST https://dev.payday.direct/api/v1/otc/fill`

One transaction: the buyer pays in SOL, 95% to the seller, 5% to the PAYDAY buy and burn, coins to the buyer. Market offers are priced on chain when it lands and carry your limit (`maxPay`). The limit comes from the live market price plus 1%, never from the offer's reference: `ABOVE_MARKET` means the reference sits over the market (it comes down about 3% a minute). If the price moves past the limit (`errCode` 6016) or within the same block (`NO_FILL_PRICE_MOVED`, 6022), build the fill again, show the buyer the new `pay` and ask again.

## Body

- `wallet` (string, required): The wallet that signs and pays
- `listing` (string, required)
- `amountRaw` (string, required): Raw units to buy

```json
{
  "wallet": "BuyerWa11et11111111111111111111111111111111",
  "listing": "L1st1ngAddre55111111111111111111111111111111",
  "amountRaw": "250000000000"
}
```

## Responses

- 200: OK
- 400: Refused; nothing to sign
- 401: Missing or invalid key
- 429: Over the limit. Retry-After says when to try again.

```json
{
  "ok": true,
  "tx": "BASE64_UNSIGNED_V0",
  "units": 88112,
  "networkFeeLamports": 7800,
  "pay": "8100000",
  "fee": "405000",
  "toSeller": "7695000",
  "maxPay": "8181001",
  "lockedPrice": {
    "num": "30000000000",
    "den": "1000000000000000"
  },
  "floored": false,
  "amountRaw": "250000000000",
  "rentLamports": 0,
  "rentNote": null
}
```

## Example

```bash
curl -X POST "https://dev.payday.direct/api/v1/otc/fill" \
  -H "Authorization: Bearer pd_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"wallet":"BuyerWa11et11111111111111111111111111111111","listing":"L1st1ngAddre55111111111111111111111111111111","amountRaw":"250000000000"}'
```