Currency exchange in Crassula
Key Concepts
Native vs. Synthetic Exchange
In a native model, exchanges occur directly between the user’s accounts. This requires a currency pair balance within the same provider.
In Crassula, synthetic exchange enables transactions even without matching balances or providers. The system uses intermediary steps and accounts to fulfill exchange requests.
Pooling accounts are used to temporarily hold funds.
Interledger transactions bridge different providers if necessary.
Exchanges can happen between virtual and real accounts across providers.
Exchange Rates and Calculation
R1 (Initial Rate): Market rate at transaction initiation.
R2 (Execution Rate): Market rate at transaction processing.
Client Rate: Final rate = R1 - markup %
Allowed Rate Deviation: ±2.5%. If exceeded, the exchange is declined.
Account and Transaction Types
End-user account: Account where an exchange is initiated and completed.
Pooling account: Used for intermediary fund storage.
Real/virtual accounts: See Real and Virtual Accounts.
Currency conversion transaction: Reflects the conversion logic.
Interledger transaction: Connects pooling and end-user accounts across providers.
How It Works

Step 1: User Initiates Exchange
User selects the currency and amount.
Crassula fetches the market rate from the FX provider.
Crassula calculates:
Client Rate (with markup)
Estimated fees
User reviews and confirms the exchange.
Step 2: Pre-order Processing
Market rate R1 is updated.
Client Rate and fees are recalculated.
Crassula creates:
Currency conversion transaction (debit)
Fee transaction (debit)
Interledger transaction (if required)
Step 3: Order Creation
An exchange order is created but not executed until rate R2 is fetched.
Step 4: Rate Check
R2 is fetched.
System checks if 0.975 ≤ R2/R1 ≤ 1.025.
If yes: Order proceeds.
If no: Order is declined, and funds are released.
Step 5: Completing the Exchange
The order is executed on the FX provider’s side.
If needed, Crassula triggers an interledger transaction to finalize the process.
Flow of Funds
Refer to the diagrams below for detailed flows between:
Real accounts (same or different providers)
Virtual accounts
Real-to-virtual and virtual-to-real

These diagrams showcase how funds travel from end-user to the pooling account and back, depending on the exchange and account types involved.
Liquidity Considerations
Same Provider (real accounts + FX provider)
Pooling account movement mimics client transactions.
No manual liquidity management required.
Cross-provider or different account types
Liquidity must be manually managed.
Crassula does not automate liquidity top-ups for pooling accounts.