-
Notifications
You must be signed in to change notification settings - Fork 0
Technical Architecture Diagram on XRPL
Muwpayteam edited this page Apr 17, 2024
·
1 revision
sequenceDiagram
participant User as User
participant MUWP as MUWP Platform
participant SC as Smart Contracts on Various Blockchains
participant DEX as Decentralized Exchange
participant Bridge as Cross-Chain Bridge
participant AS as Atomic Swaps
participant XRPL_SC as XRPL Smart Contracts
participant XRPL as XRP Ledger
User->>+MUWP: Initiate Swap
MUWP->>+SC: Fetch Token Prices
SC-->>-MUWP: Return Prices
MUWP->>+DEX: Query Best Swap Routes
MUWP->>+Bridge: Query Cross-Chain Routes
DEX-->>MUWP: Provide Options
Bridge-->>MUWP: Provide Cross-Chain Options
MUWP->>+AS: Check for Direct Swap Availability
AS-->>-MUWP: Return Direct Swap Options
MUWP->>XRPL_SC: Determine Optimal Path
alt Optimal Route via DEX
MUWP->>DEX: Execute Swap
DEX->>XRPL: Convert to XRP
else Optimal Route via Bridge
MUWP->>Bridge: Execute Cross-Chain Swap
Bridge->>XRPL: Convert to XRP
else Direct Swap via Atomic Swaps
MUWP->>AS: Execute Atomic Swap
AS->>XRPL: Convert to XRP
end
XRPL-->>User: Transfer XRP to Wallet
This sequence diagram illustrates how a user performs a token swap using the Multi-Blockchain User Wallet Platform (MUWP), integrated with the XRP Ledger (XRPL). MUWP facilitates swaps across various blockchains by identifying the most optimal route for the user's exchange needs.
- Action: The user engages with the MUWP platform, specifying the source and destination tokens and the swap amount.
- Action: MUWP interacts with smart contracts on various blockchains to access current token prices or exchange rates.
- Response: Smart contracts from different blockchains send back the requested token prices to MUWP.
- DEXs (Decentralized Exchanges): MUWP queries DEXs to discover the best trading routes within the chosen blockchain.
- Cross-Chain Bridges: MUWP explores potential cross-chain swaps by querying bridges that facilitate token transfers across different blockchains.
- DEXs: Provide details on available swap options and their rates.
- Bridges: Offer information on cross-chain swap possibilities, which may involve wrapping and unwrapping tokens on different blockchains.
- Action: MUWP checks for the availability of direct swaps using Atomic Swaps (AS), enabling trustless peer-to-peer token exchanges without centralized intermediaries.
- Response: If direct atomic swaps are feasible, the AS module within MUWP provides details on these options.
-
Analysis: MUWP analyzes data from various sources:
- Token prices from smart contracts.
- Swap options and rates from DEXs.
- Cross-chain swap options and fees from bridges.
- Direct swap details from atomic swaps (if available).
- Outcome: Based on this data, MUWP determines the most efficient and cost-effective route for the swap.
- DEX: Executes the swap directly through the selected DEX, possibly involving multiple token conversions.
- Bridge: Carries out the cross-chain swap via the selected bridge, including token wrapping and transferring.
- Atomic Swaps: If a direct swap is selected, MUWP facilitates the atomic swap process.
- Action: After executing the swap, MUWP converts the tokens to XRP, the native token of the XRPL.
- Final Step: The XRP Ledger processes the transaction and transfers the swapped XRP tokens to the user's wallet, completing the swap process.