# 5. Liquidity Graph Model

Baltex Protocol represents liquidity access as a directed weighted multigraph. Vertices represent asset states on networks (optionally decorated with venue context), and edges represent executable transformations (DEX swap, CEX trade, provider swap, withdraw/transfer, relay).

```mermaid
flowchart LR
    VS["Venue State
(Uniswap V3 Pool)"]
    A1["Asset State
(PEPE@ETH)"]
    A2["Asset State
(USDC@ETH)"]
    CM["CEX Market
(USDC/ZEC)"]
    RL["Relay Asset
(Monero L1)"]
    A3["Asset State
(ZEC@ZEC)"]

    VS -.-> A1

    A1 -- "DEX_SWAP" --> A2
    A2 -- "CEX_TRADE" --> CM
    CM -- "WITHDRAW" --> A3

    A1 -- "RELAY (private)" --> RL
    RL -- "OUTTAKE" --> A3
```

Figure 2. Simplified liquidity graph taxonomy (illustrative).<br>

#### Components

<table><thead><tr><th width="275">Component</th><th>Description</th></tr></thead><tbody><tr><td><strong>Venue State</strong> (Uniswap V3 Pool)</td><td>Liquidity venue providing the on-chain DEX swap context.</td></tr><tr><td><strong>Asset State</strong> (PEPE@ETH)</td><td>Initial asset — PEPE held on the Ethereum network.</td></tr><tr><td><strong>Asset State</strong> (USDC@ETH)</td><td>Intermediate asset after DEX swap — USDC on Ethereum.</td></tr><tr><td><strong>CEX Market</strong> (USDC/PEPE)</td><td>Centralized exchange market used to trade USDC into the withdrawal path.</td></tr><tr><td><strong>Relay Asset</strong> (RAND L1)</td><td>Private relay bridge asset on Monero L1 network, used for the off-exchange path.</td></tr><tr><td><strong>Asset State</strong> (ZEC@ZEC)</td><td>Final output asset — ZEC on the Zcash network.</td></tr></tbody></table>

***

#### Execution Paths

#### Path 1 — DEX Route

<table><thead><tr><th width="91">Step</th><th width="164">Action</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td><code>DEX_SWAP</code></td><td>Swap PEPE → USDC on Uniswap V3 (Ethereum).</td></tr><tr><td>2</td><td><code>CEX_TRADE</code></td><td>Trade USDC on a CEX market (USDT/ZEC pair).</td></tr><tr><td>3</td><td><code>WITHDRAW</code></td><td>Withdraw from CEX to destination as ZEC@ZEC.</td></tr></tbody></table>

#### Path 2 — Private Relay Route

<table><thead><tr><th width="90">Step</th><th width="167">Action</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td><code>RELAY (private)</code></td><td>Route PEPE@ETH through a private L1 relay bridge.</td></tr><tr><td>2</td><td><code>OUTTAKE</code></td><td>Extract the bridged value as ZEC@ZEC on the Zcash network.</td></tr></tbody></table>

***

#### Notes

* Both paths originate from **PEPE\@ETH** and terminate at **ZEC\@ZEC**.
* The **DEX route** is the public, on-chain path with higher transparency.
* The **Relay route** is a private, off-chain path optimized for privacy.
* The **Venue State** (Uniswap V3) is only relevant for the DEX path.

### 5.1 Edge attributes (normalized)

Each edge is evaluated under constraints and costs, typically including:

* limits: min/max amount supported
* fee model: venue fees + network fees (estimated)
* slippage model: for AMM edges (depth/price impact)
* latency model: expected time-to-complete distribution (p50/p90/p99)
* reliability score: historical success rate for the edge/venue
