> For the complete documentation index, see [llms.txt](https://docs.zipper.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zipper.trade/vault-architecture.md).

# Vault Architecture

<figure><img src="/files/CvwvQ3bZ8V9PFMrGRBBC" alt=""><figcaption></figcaption></figure>

Zipper’s **vault system is designed for efficiency and cost-effectiveness**, ensuring every zAsset remains fully **1:1 backed** while minimizing gas costs across different blockchain networks. Unlike a traditional pooled vault model, Zipper **utilizes a distributed deposit system**, where user deposits are managed across multiple addresses before being consolidated into a **main vault**.

***

### **Deposit Addresses vs. Main Vaults**

Zipper operates with **two distinct types of vault addresses** to manage assets efficiently:

1. **Deposit Addresses** - User-specific addresses used for receiving deposits before consolidation.
2. **Main Vaults** - Primary storage locations where assets are consolidated after deposits.

***

### **How Funds Move in Zipper**

#### **Step 1: Deposits are Sent to Users' Deposit Addresses**

* When a user **zips an asset**, they send it to their **designated deposit address**, which is unique to them.
* These deposit addresses **are not uniquely generated for every deposit**, meaning users deposit to the same assigned address each time if depositing the same asset or on the same network as a previous deposit.
* **Deposit addresses are not shared between users**, ensuring funds remain separate and **avoiding commingling.**
* Although deposit addresses are distinct from the main vault, they are still **secured under the same private key model** as the main vault.

#### **Step 2: Backend Workers Monitor for Optimal Gas Fees**

* Instead of immediately consolidating all deposits into the main vault, **Zipper’s backend infrastructure monitors gas prices on the originating chain.**
* When network conditions are favorable, deposits are **batched and consolidated** into the **main vault** to minimize unnecessary gas costs.

#### **Step 3: Main Vaults Store the Bulk of Zipped Assets**

* Each **supported token** has **one primary vault per blockchain**.
* The **main vault is used for fulfilling unzips**, ensuring **sufficient liquidity is available when users withdraw assets**.
* Even if a token exists in multiple deposit addresses, the total amount across **deposit addresses + main vault = 1:1 backing for all zAssets** on Fabric.

#### **Step 4: Unzipping Assets & Covering Withdrawals**

* When a user **unzips** an asset, Zipper first attempts to **release funds from the main vault**.
* If the main vault does not have enough funds to immediately process the request (before gas-efficient consolidation has occurred), Zipper **automatically fetches the required funds from existing deposit addresses** to fulfill the withdrawal.
* This mechanism ensures **all withdrawals are processed seamlessly, regardless of vault balance distribution at any given time.**

***

### **Key Vault Architecture Takeaways**

✅ **1:1 Backing Across All Addresses** - Assets in deposit addresses and main vaults **collectively ensure every zAsset remains fully backed.**\
✅ **One Main Vault Per Token, Multiple Deposit Addresses** - Each **token has its own dedicated vault**, but deposit addresses can handle multiple tokens from the same blockchain.\
✅ **No Commingling of User Funds** - Deposit addresses are **assigned per user**, ensuring **clear separation of assets** before consolidation.\
✅ **Dynamic Fund Consolidation** - Zipper’s architecture is designed to **minimize gas fees** by batching deposit transfers during **low-fee windows**.\
✅ **Efficient Withdrawal Processing** - If the main vault is temporarily underfunded due to unprocessed consolidations, Zipper **automatically retrieves assets from deposit addresses** to fulfill withdrawals without delay.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zipper.trade/vault-architecture.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
