ClearBank.MultiCurrency.FxTradeRfq (ClearBank v1.0.0)

Copy Markdown View Source

FX Request for Quote (RFQ) — lock in a firm exchange rate before executing.

Workflow

  1. Call request_quote/2 to get a firm rate with a quote ID.
  2. Review the quoted rate and expiry.
  3. Call execute_quote/2 to trade at that rate, or reject_quote/2 to 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

execute_quote(client, quote_id)

@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")

reject_quote(client, quote_id)

@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")

request_quote(client, params)

@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_amount or :buy_amount