Kinetex Docs
  • Introduction
    • Why Kinetex?
  • About Kinetex
  • Roadmap
  • Flash Trade Protocol
    • Roles
    • Workflow
    • Swap Process
    • Collateral
      • Deposit collateral
      • Unlock collateral
      • Withdraw collateral
    • Liquidation
    • Proving Mechanism
    • Kinetex Light Clients
    • Non-EVM Networks
    • Gasless
    • Trusted Forwarders
    • LP for Resolvers
    • Staking
    • Flash Trade Security
    • Integrations
  • Aggregation Protocol
    • Architecture
      • Smart-contracts
    • Liquidity Sources
    • Route Building
    • Advanced Routing
    • Automated Execution
    • Gasless Transactions
    • Aggregation Security
    • Risks Mitigation
      • Slippage and Rates
      • MEV Protection
      • Control of Approvals
  • FAQ
  • Links
    • Demo
    • GitHub
    • Website
    • support@kinetex.io
Powered by GitBook
On this page
  1. Flash Trade Protocol
  2. Collateral

Unlock collateral

PreviousDeposit collateralNextWithdraw collateral

Last updated 1 year ago

This sequence of actions illustrates how the Flash Trade system confirms the successful processing of orders. It involves verifying the successful transfer of the order asset, adjusting the collateral status, and confirming the successful processing of the order.

  1. Verify that the transfer took place:

    1. The Resolver provides two proofs (receiveProof and sendProof) by calling the confirmOrderAssetSend method of the OrderResolver contract.

    2. OrderResolver verifies both AssetReceive and AssetSend events with the help of LightClient, which signals that the order has been completed.

    3. If any of the events is not verified, OrderResolver reverts the transaction.

  2. Unlock collateral:

    1. If both events are verified, CollateralManager adds the order collateral amount to the unlocked collateral (unlockCounter). The unlocked collateral is the amount of collateral that is not currently in use.

    2. CollateralManager sets the nonce bit of the order to 1, effectively invalidating the nonce. A nonce is a number used once, and in this context, it is used to ensure each transaction is processed only once.

    3. CollateralManager emits an OrderSendConfirm event, signaling that the order asset has been sent and the process has been confirmed successfully. Consequently, collateral for this order gets unlocked and can be reused for further orders.

Collateral unlock process