> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ascend.market/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture Overview

> Technical architecture of the Ascend protocol

## Introduction

Ascend is a **fully verifiable events perpetuals decentralized exchange** enabling leveraged trading on **outcome probabilities**. Ascend supports **Cardano, EVM, and Solana environments**, while enforcing all trading, risk, account, and settlement logic within Midnight, a **Cardano partnerchain** with **multi-resource consensus and native privacy.** Ascend inspires from Midnight's **Minotaur philosophy** for **multichain DeFi execution**, privacy focused, policy-driven model to:

* Order execution
* Margin and leverage enforcement
* Liquidation logic
* Event settlement

This allows execution rights, capital, risk, and permissions to be treated as **distinct yet composable resources**, all enforced under zero-knowledge guarantees.

Ascend adopts a **ZK-enforced execution architecture**, where all user actions are finalized on Midnight.

The architecture is designed to:

* Maximize throughput
* Preserve user privacy
* Provide cryptographic guarantees of correctness
* Maintain a single canonical execution state

<Frame>
  <img src="https://mintcdn.com/acme-58ae63bf/HfSRO5rxxkx_obLA/images/arch.png?fit=max&auto=format&n=HfSRO5rxxkx_obLA&q=85&s=1bce273f9f9981f565cdc0c335f64102" alt="Ascend Architecture Diagram" width="2160" height="2138" data-path="images/arch.png" />
</Frame>

***

## Ascend Engines

Instead of separating execution into off-chain and on-chain domains, Ascend structures protocol logic into **deterministic execution engines**, each enforced through Midnight ZK verification.

<AccordionGroup>
  <Accordion title="Matching Engine" icon="arrows-rotate">
    Executes probability-priced event perpetual orders with deterministic matching.
  </Accordion>

  <Accordion title="Risk Engine" icon="chart-line">
    Evaluates margin, leverage, and liquidation conditions in real-time.
  </Accordion>

  <Accordion title="Account Engine" icon="user">
    Manages funding and trading account state transitions.
  </Accordion>

  <Accordion title="Fund Control Engine" icon="vault">
    Handles internal and external fund movements securely.
  </Accordion>

  <Accordion title="Event Engine" icon="calendar-check">
    Governs event lifecycle, resolution, and settlement.
  </Accordion>
</AccordionGroup>

<Note>
  All engine outputs are subject to **ZK-verified constraints** and committed via Midnight.
</Note>

***

## Execution & Verification

### Trade Execution Flow

<Steps>
  <Step title="Sign">
    Orders are signed using **native ecosystem credentials** (Cardano, EVM, or Solana)
  </Step>

  <Step title="Match">
    Orders are interpreted by the Ascend Matching Engine
  </Step>

  <Step title="Validate">
    Execution results are validated by the Risk Engine
  </Step>

  <Step title="Commit">
    Final state transitions are proven and committed on Midnight
  </Step>
</Steps>

### Risk & Liquidation Enforcement

* Margin requirements evaluated per trading account
* Liquidation conditions checked deterministically
* Liquidation actions only applied if **ZK-verified as fair**

***

## Account Architecture

<CardGroup cols={2}>
  <Card title="Funding Account" icon="wallet">
    The **primary on-chain ownership entity** within Ascend.

    * Accept and manage deposits
    * Process withdrawals
    * Transfer funds between accounts
    * Allocate capital to trading accounts

    Tracks collateral, linked accounts, permissions, and multi-sig thresholds.
  </Card>

  <Card title="Trading Account" icon="chart-candlestick">
    **Subordinate accounts** dedicated to trading operations.

    * Isolated margin per account
    * Independent liquidation conditions
    * Position and funding tracking

    Multiple trading accounts can link to a single funding account.
  </Card>
</CardGroup>

***

## Account State Model

All account-related state is maintained as **zero-knowledge–verified state on Midnight**.

| Account Type    | State Includes                                                                     |
| --------------- | ---------------------------------------------------------------------------------- |
| Funding Account | Collateral balance, linked trading accounts, roles & permissions, multi-sig config |
| Trading Account | Active positions, margin utilization, funding adjustments, liquidation status      |

***

## Identity & Credentials

Ascend implements a **fully cryptographic identity framework** working with existing KYC, KYB, and identity providers.

<CardGroup cols={2}>
  <Card title="Multi-Account Control" icon="users">
    A single user may control multiple protocol accounts
  </Card>

  <Card title="Key-Based Ownership" icon="key">
    Account ownership tied to cryptographic keys
  </Card>

  <Card title="Signed Authorization" icon="signature">
    All actions enforced through signed transactions
  </Card>

  <Card title="No Web2 Layer" icon="ban">
    No separate Web2 identity required for execution
  </Card>
</CardGroup>

<Tip>
  This model removes the need for a Web2/Web3 credential split while preserving institutional-grade permissioning and access guarantees.
</Tip>
