Skip to content

Commit e30b48f

Browse files
docs: crypto refund destination + real-time fee assessment (#737)
## Summary Two clarifications to the Grid concept docs, prompted by a real-time USDC funding support case: - **Crypto refund destination** (`Transaction Lifecycle` → Refund Object): a new "Refund destination" subsection explains that where a refund lands depends on how the transaction was funded. Real-time (JIT) quotes funded with **crypto** are refunded to the customer's **internal account balance** for that asset — not back to the source wallet — because Grid can't verify the sending wallet belongs to the customer. That balance is reusable via a new quote or `POST /transfer-out`. - **Real-time fee assessment** (`Quote System` → Fees): a new "How the variable fee is applied" subsection documents how the variable fee is assessed for each locked side: - Sending locked: `received = send − send × fee` → send $50 at 10 bps ⇒ receive $49.95 - Receiving locked: `send = received / (1 − fee)` → receive $50 at 10 bps ⇒ send $50.05005005… - Plus a note on why receiver-locked divides by `(1 − fee)` (keeps the effective rate identical across both locked sides) and how FX layers on for cross-currency quotes. ## Test plan - `mint broken-links` — no broken links or anchors in the edited pages (the new `#locked-currency-side` link resolves) - Verified the worked numbers: `50 − 50×0.001 = 49.95`, `50 / 0.999 = 50.05005005…` - Additive-only edits to existing pages; no new pages, no navigation changes --------- Co-authored-by: Peng Ying <peng@lightspark.com>
1 parent 60d499d commit e30b48f

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

mintlify/platform-overview/core-concepts/quote-system.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,32 @@ Fees are deducted from the sending amount, so:
350350
of that quote.
351351
</Note>
352352

353+
### How the variable fee is applied
354+
355+
The variable fee (`gridApiVariableFeeRate`) is always assessed as a fraction of the **sending** amount. How that plays out depends on which side of the quote you lock (see [Locked Currency Side](#locked-currency-side)).
356+
357+
**Sending amount locked** (`lockedCurrencySide: "SENDING"`) — the fee is taken out of the amount you send, and the recipient receives the remainder:
358+
359+
```text
360+
received = send − send × fee
361+
```
362+
363+
Send $50 at a 10 bps (0.10%, `fee = 0.001`) rate: `received = 50 − 50 × 0.001 = 49.95`.
364+
365+
**Receiving amount locked** (`lockedCurrencySide: "RECEIVING"`) — Grid solves for the send amount that nets the exact received amount *after* the same fee:
366+
367+
```text
368+
send = received / (1 − fee)
369+
```
370+
371+
Receive $50 at 10 bps: `send = 50 / 0.999 = 50.05005005…`.
372+
373+
<Note>
374+
Receiver-locked quotes divide by `(1 − fee)` rather than adding `received × fee` so that locking the receiving side is never cheaper than locking the sending side at the same rate. Solving `send × (1 − fee) = received` for `send` keeps the effective fee rate identical across both locked sides.
375+
</Note>
376+
377+
For cross-currency quotes the exchange rate applies on top of this: the fee is taken on the sending currency, then the net amount is converted at the quoted rate. The same-currency examples above (for example USDC → USD at 1:1) show the fee in isolation.
378+
353379
## Best Practices
354380

355381
<AccordionGroup>

mintlify/platform-overview/core-concepts/transaction-lifecycle.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,18 @@ When a payment fails or is cancelled, refunds are tracked in a dedicated object
181181
}
182182
```
183183

184+
### Refund destination
185+
186+
Where a refund lands depends on how the transaction was funded:
187+
188+
- **Prefunded (internal account)** — the amount is credited back to the source internal account balance.
189+
- **Real-time (JIT) funding via an instant fiat rail** (RTP, PIX, SEPA Instant, etc.) — the refund is returned to the originating funding instrument.
190+
- **Real-time (JIT) funding via crypto** (for example USDC or BTC) — the refunded amount is credited to the customer's **internal account balance for that asset**. It is **not** returned to the wallet the funds were sent from.
191+
192+
<Note>
193+
Crypto deposits are not refunded to the source wallet because Grid cannot verify that the sending wallet belongs to your customer — the funds may have originated from an exchange or another third-party address. The credited internal balance is reusable: spend it with a new quote, or withdraw it to an external wallet with `POST /transfer-out`.
194+
</Note>
195+
184196
## Webhooks
185197

186198
Outgoing payment webhooks use the format `OUTGOING_PAYMENT.<STATUS>`. The webhook request body contains the full transaction resource.

0 commit comments

Comments
 (0)