FX Request for Quote (RFQ) — lock in a firm exchange rate before executing.
Workflow
- Call
request_quote/2to get a firm rate with a quote ID. - Review the quoted rate and expiry.
- Call
execute_quote/2to trade at that rate, orreject_quote/2to cancel.
Quotes expire — check expiresAt in the response and execute before then.
Examples
{:ok, quote} = ClearBank.MultiCurrency.FxTradeRfq.request_quote(client, %{
sell_account_id: "eur-acct-uuid",
buy_account_id: "gbp-acct-uuid",
sell_currency: "EUR",
buy_currency: "GBP",
sell_amount: "50000.00"
})
quote_id = quote["quoteId"]
{:ok, _} = ClearBank.MultiCurrency.FxTradeRfq.execute_quote(client, quote_id)
Summary
Functions
Executes a previously quoted FX trade.
Rejects/cancels a quote without executing.
Requests a firm FX quote (RFQ).
Functions
@spec execute_quote(ClearBank.Client.t(), String.t()) :: ClearBank.HTTP.result()
Executes a previously quoted FX trade.
Examples
{:ok, result} = ClearBank.MultiCurrency.FxTradeRfq.execute_quote(client, "quote-uuid")
@spec reject_quote(ClearBank.Client.t(), String.t()) :: ClearBank.HTTP.result()
Rejects/cancels a quote without executing.
Examples
{:ok, _} = ClearBank.MultiCurrency.FxTradeRfq.reject_quote(client, "quote-uuid")
@spec request_quote(ClearBank.Client.t(), map()) :: ClearBank.HTTP.result()
Requests a firm FX quote (RFQ).
Required params
:sell_account_id,:buy_account_id:sell_currency,:buy_currency:sell_amountor:buy_amount