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

Withdraw collateral

PreviousUnlock collateralNextLiquidation

Last updated 1 year ago

This sequence of actions demonstrates how the Flash Trade system handles the withdrawal of collateral. It includes the preparation for the withdrawal, the withdrawal itself, and the verification of the withdrawal.

  1. Preparation:

    1. CollalteralManager emits a WithdrawReport event, signaling that it is prepared for the withdrawal of collateral.

    2. The Resolver sends an unlocking transaction by calling the reportWithdraw method of the CollalteralManager contract in the receive chain to prepare a withdrawal.

    3. CollalteralManager increases the amount of locked collateral by the order amount. Locked collateral is the amount of collateral that is currently locked and cannot be used for other orders.

  2. Withdrawal:

    1. The Resolver instructs the CollateralManager to withdraw collateral, calling method withdraw and providing reportProof.

    2. CollateralManager checks to make sure the amount being withdrawn does not exceed the amount of locked collateral. If it does, the withdrawal is rejected.

    3. CollateralManager, with the help of Light Clients, verifies the proof of the Withdraw event provided with reportProof. If the proof is falsified, the withdrawal is rejected.

    4. CollateralManager decreases the total amount of collateral to reflect the withdrawal and updates its own state to reflect the new total amount.

    5. CollateralManager emits a Withdraw event, signaling that the withdrawal of collateral has occurred.

Collateral withdraw overview
Collateral withdraw process