Overview
Swaps convert funds between assets within the same account — for example, BRL to USDT or USDC to BRL. Every swap references a quote that locks the FX rate. Once executed, a swap cannot be reversed.Prerequisites
- An active account with sufficient balance in the quote’s source asset.
- Valid authentication credentials.
Steps
1
Create a quote
Specify the source asset, target asset, and either the amount you want to spend (The response returns the quote
sourceAmountValue) or the amount you want to receive (targetAmountValue), never both.id, the locked effectiveRate, the computed destinationAmount, and expiresAt. The quote belongs to your customer, not to an account, and can be consumed by exactly one operation before it expires.2
Create the swap
Reference the account and the quote. No other inputs are needed — source and target assets and amounts are derived from the quote.Returns
201 immediately with the operation in REQUESTED status. Settlement happens asynchronously.3
Track the swap
Subscribe to
OPERATION_COMPLETED and OPERATION_FAILED to receive the terminal outcome — both deliver the same payload as OPERATION_REQUESTED, with data.currentState.status set to the new status (and data.currentState.reason populated on failure). Between creation and the outcome, OPERATION_PROCESSING fires exactly once, the moment the swap starts executing.What happens next
- Make a withdrawal — send the converted funds out of the account.