Transaction Flow Model for Joining the Balancer Pool
Last updated
Last updated
The focus here is on the interaction between users, the Balancer Pool, and the Layer 1 Cross-chain Virtual Machine (L1X VM) and Ethereum Virtual Machine (L1X EVM) architectures, emphasizing the transaction and validation mechanisms involved in liquidity provision and X Balancer Pool Token (XBPT) issuance.
Initial Token Amount Calculation and Price Impact Assessment: Users start by querying the amount of X Balancer Pool Tokens (XBPT) they are eligible to receive in exchange for a specified amount of input liquidity (amountIN). This query not only calculates the receivable XBPT amount but also evaluates the transaction's price impact on the liquidity pool. This step is crucial for users to understand the potential slippage and its effects on the pool's price dynamics.
Transaction Preview and User Confirmation: Upon receiving the transaction details, including the XBPT amount and price impact, users review this information in a transaction preview. If the terms are acceptable, they confirm the transaction, initiating the process of transferring liquidity to the source chain.
Source Chain Confirmation and Event Emission: The transaction's confirmation on the source chain triggers the emission of an event. This event signifies the successful liquidity addition to the pool and acts as a signal for further cross-chain and contract interactions.
Event Listening and Verification by L1X Nodes: Layer 1 Cross-chain (L1X) Event Listener Nodes take on the role of monitoring, verifying, and broadcasting the confirmed event. These nodes act as intermediaries, ensuring that only valid and confirmed events are processed further, maintaining the integrity of cross-chain interactions.
Full Validator Nodes Processing: The validated events are then relayed to L1X Full Validator Nodes. These nodes are responsible for the initial handling of the transaction within the Layer 1 Cross-chain ecosystem, marking the beginning of the contract lifecycle in the L1X Virtual Machine (VM).
Transaction State Management: The L1X EVM Contract Registry plays a pivotal role at this juncture, recording the transaction's state. This registry ensures that the transaction is recognized and managed correctly throughout its lifecycle within the L1X VM environment.
Balancer Handler Contract Invocation: Understanding the nature of the transaction as an L1X VM operation, the Balancer Handler Contract identifies and invokes the appropriate function within the Balancer Contract deployed on the L1X EVM. This step is essential for bridging the transaction across contract boundaries and VMs.
Cross-Contract and Cross-VM Interaction: This stage highlights the innovative cross-contract and cross-VM call mechanism, allowing the L1X VM Contract to interact seamlessly with the Balancer Pool Contract on the L1X EVM. It exemplifies the interoperability and flexibility of the L1X architecture in handling complex, cross-environment transactions.
Execution and XBPT Issuance: With the contracts executed on the L1X EVM, the transaction culminates in the issuance of XBPT tokens to the rightful recipient. This step not only marks the successful addition of liquidity to the Balancer Pool but also the beginning of the user's participation in the pool's governance and reward mechanisms.
Bonus Reward Distribution Update: Finally, the Balancer Registry updates to reflect the distribution of bonus rewards to the initial holder of the XBPT tokens. This periodic distribution mechanism incentivizes long-term liquidity provision and participation within the Balancer ecosystem.