Overview

ZigZag launched on zkSync Lite (previously zkSync 1.0) in November 2021. On this page you will find more information about how the DEX works.

Atomic swaps

zkSync Lite does not support smart contracts, but only pre-compiled contracts by MatterLabs. ZigZag is utilising the built-in atomic swap feature to provide swaps to users. ZigZag matches users with market maker bots. Users and market maker bots can post liquidity in the order book, but only market maker bots can fill orders. Unfortunately, zkSync Lite does not support partial fills. This means that orders will only get executed when a market maker can fully fill the order. This is fixed with our Arbitrum DEX. More information on market maker bots can be found on the Market maker page.

Swap fees

There are no fees for placing or cancelling orders. ZigZag is also not charging any protocol fee for use of the platform. Users only pay swap fees (around $0.05) to cover zkSync network fees (as found on transactions in the explorer or on L2Fees. Market maker bots pay these network fees, but users pay the swap fee to the market maker. Swap fees are paid with the token you're trading. You don't need ETH for swap fees for example. If you bridge over DAI to zkSync, you can trade DAI for ETH and pay the gas fee with your DAI.

zkSync network fees depend on network activity and L1 gas. With more activity on zkSync, swap fees will go down. Thus, swap fees will lower overtime. In the beginning network fees were $1 on zkSync, but have now lowered to $0.05.

Limit order system

The limit order system is live on zkSync Lite. After 7 days of placing a limit order it will expire and a new order has to be placed. On zkSync Lite you can only have one order open at a time. If you have a limit order open, you can't place other orders on that account. If you make a normal transaction (sending funds from your account) or a bridge transaction, your limit order will be cancelled.

Bridging and fees

Bridging can be done on the bridge page: https://trade.zigzag.exchange/bridge.

Bridge between Ethereum and zkSync (normal)

The ZigZag user interface taps into the zkSync smart contract. This means that your funds will be sent to the zkSync smart contract and then get bridged. ZigZag has no custody over your funds. Funds should arrive quickly (within a few minutes) when bridging from L1 -> L2. Withdrawals (L2 -> L1) however can take from 10 minutes up to 7 hours depending on zkSync's network activity. There are no fees involved other than Ethereum mainnet gas fees for these transactions. Be sure check the current gas on Ethereum to pick a good moment and save money when bridging. When bridging back from zkSync to Ethereum the gas fee is shown in the sign message.

Bridge from zkSync to Ethereum (fast)

Additionally, ZigZag provides a Fast Withdraw bridge. Currently supported tokens are ETH and FRAX and will be bridged instantly from zkSync to Ethereum. After bridging, please wait ~1 minute for the next block to mine on Ethereum mainnet and you will receive your L1 tokens. Fees are deducted from the amount before sending to L1. The bridge fee is the current L1 gas fee * 1,5. Fast withdraw bridge liquidity can be found here:

Permissionless listing

Anyone can permissionlessly list any token pair through the list pair page. Listing a new pair on ZigZag requires for the token to be listed on zkSync first.

List your token on zkSync

If the token is not yet listed on zkSync, go to zkSync's token page, click "Add New Token" and pay a 500 DAI fee (from Ethereum mainnet) to get your token listed in a permissionless way. Wait a few minutes for the token to appear in the list.

List your pair on ZigZag

If your token does exist on zkSync and has an Internal ID, continue to the list pair page. First, purchase an Arweave allocation for 0.5 USDC.

Then fill in the form:

  • Enter the Internal ID's found on https://zkscan.io/explorer/tokens

  • Set in the swap fee as close to $1 as possible

  • Decide on how many decimals you want the price of the pair to appear in (ex: $1.000710 DAI/USDC = '6' decimals

  • If applicable, change the network to Rinkeby

For your pair to be functional for trading, you'll need to run a liquidity node. More information can be found on the Market maker page.

What is the account activation fee? (Change Pubkey transaction)

The account activation fee is a one-time fee imposed by zkSync to register your account with zkSync. This fee only applies to your first zkSync transaction. The registration process happens directly on the Ethereum smart contract and therefore it is an L1 transaction, so the activation fee is to pay the Ethereum miners and not zkSync validators.

Tokens listed on ZigZag

All tokens listed on ZigZag Exchange zkSync Lite can be found here: https://zkscan.io/explorer/tokens/. zkSync filters out tokens and lists the correct ones based on CoinGecko and Uniswap. This means that only legit tokens will get their correct ticker. Scam tokens will be listed as ERC20-XXX tokens. ZigZag can only list tokens that have been bridged through zkSync's smart contract. The token name and ticker are pulled from the token contract and can be found in the pair.

A clarification on certain tokens:

  • FTM - Native

  • MATIC - Native

  • SOL - Wormhole

  • AVAX - Wormhole

What is the difference between an Initiated, Committed, and Verified transaction on zkScan?

The differences can be found in zkSync's FAQ:

  • Initiated: the zkSync server has received and processed the transaction.

    • If you made a transfer or swap, your funds are available immediately.

  • Pending: the transaction appears in a block that is committed to the L1 smart contract.

  • Complete: the transaction’s block has been proven and verified on the L1 smart contract.

    • If you made a bridge transaction, you will need for the transaction to be completed before you can use your funds. This can range from 10 minutes up to a few hours. Also see the Bridge and fees paragraph.

Nonce mismatch

Occasionally a ‘nonce mismatch’ error can come up when placing an order, resulting in a rejected order. This does not result in deducted gas or trading fees. What you can do as user is to refresh, reconnect your wallet and place a new order.

When a user signs an order, the nonce is included in the signed message. So when the swap is submitted, user's nonce has to match the signed nonce. If the user or the market maker increases their nonce before the swap is submitted (by making any other transaction, eg transfer, withdraw or another swap) then the order they signed becomes invalid. This becomes especially apparent when a market maker has to process a lot of swaps at a time.

Arweave bridge

You can access Arweave storage at a rate of $1/MB by paying directly on zkSync. Instructions on how to use our Arweave bridge can be found in the GitHub repository.

Why did we build an Arweave bridge?

The original Ethereum vision had a component called Swarm that was supposed to be a decentralized storage layer for dApps to use. It got too complicated to include it, so it was canned. Fast forward 6 years, and we still don't have a great way for users on Ethereum to access file storage. Filecoin works, but frankly Arweave has a better architecture and is more mature. At the moment, neither of these networks allows you to pay directly from L2s.

In order to implement permissionless listing, users need to store pair metadata in a publicly accessible space with guarantees that the data won't disappear. Forcing users to obtain $AR to list a token seemed clunky, so we built a bridge. You can pay directly on zkSync with USDC, USDT, or DAI and send data for permanent storage on Arweave.

As a bonus, we realized that this could serve as a decentralized file storage layer for L2s, so we decided to open source the code and spin it off as a separate project. Our NFT marketplace in the future will be using this service. OpenSea and other services use IPFS, but it's a clunky system, and very often content goes missing or is inaccessible because of network topology issues.

We think Arweave has the potential to become the filesystem for Ethereum dapps and we want to help make it happen. We're going to extend this bridge to Starknet and whichever other chains we build on.

Our service currently offers storage at a rate of $1/MB. Listing a pair will consume ~1kB, so it shouldn't cost you more than $0.01 to pay data fees to list a pair. We will re-price the storage as necessary in the future to make listing NFTs cheap as well.

Users probably won't even notice they are interacting with this service. This is mostly for dApps to give an easy way to allow users to pay for their own storage.

Last updated