Margined Protocol
  • About
  • VAULTS
    • Deposits
    • Withdrawals
  • DESIGN
    • High Level Architecture
    • Security Risks
  • Strategies
    • LendLease
    • Concentrated Liquidity
    • Redemption Rate Arbitrage
    • Funding Rate
    • Coinhedge
  • Grid Trading
  • Resources
    • Contracts
    • API
    • Assets
    • Links
Powered by GitBook
On this page
  1. DESIGN

High Level Architecture

PreviousWithdrawalsNextSecurity Risks

Last updated 3 months ago

Locust integrates on-chain smart contracts with an off-chain executor. This architecture delivers a DeFi native product with high levels of customization, flexible strategies, and excellent performance.

Core Components

  1. Fund Contract (Vault):

    • User Interactions: Users deposit funds into the Fund Contract and redeem them when needed.

    • Purpose: It acts as a secure vault for storing user assets and serves as the central repository for fund management.

  2. Strategy Contract:

    • Fund Withdrawal: The Strategy Contract periodically withdraws funds from the Fund Contract to implement specific investment strategies.

    • Periodic Repayment: To support ongoing user redemptions and ensure accurate accounting, the Strategy Contract periodically repays a portion of the funds back to the Fund Contract.

    • Authz Grants: This contract issues authorization (Authz) grants to the off-chain Locust executor, defining what actions the executor is permitted to perform.

  3. Locust Off-Chain Executor:

    • Management Role: It manages the funds held within the Strategy Contract, executing strategy-specific operations.

    • Security via Authz: The executor is only authorized to sign messages on behalf of the Strategy Contract when it holds the appropriate Authz permissions. This design ensures that every action taken is explicitly permitted and verificable on-chain.

26KB
high-level-architecture.excalidraw
Figure 1: High Level Locust Architecture