zSwap

StatusEntrypoint

In development on testnet

zSwap

The first use case for DeFi Adaptors, zSwap, is designed to facilitate swap transaction flow towards some of the most widely used protocols in the Polygon DeFi ecosystem — Quickswap, Uniswap v3, and Curve. This functionality is found within the “Swap” tab in Panther’s decentralized application (dApp).

zSwap features a user interface similar to the DEXs mentioned above for a familiar user experience. It also allows users to dictate the token IDs for the assets they want to sell/buy from a list of accepted assets (see below), enabling them to choose the specific swap pair they wish to trade. Users can also input the amount of the sell token they wish to trade, and the zSwap function will query an exchange rate based on these inputs and provide users with up-to-date values. This ensures that users can make informed decisions about their trades and optimize their transactions for the best possible outcome.

zSwap’s goal is to cater to a wide range of user types, including institutions, and market makers. At mainnet release, zSwap will support the interaction with three different platforms, with the ability to highlight the best platform or “route” for users to conduct their swaps, allowing them to swap tokens at the most favorable rates and incur smaller fees.

The ability for users to swap assets privately serves a double purpose:

  1. Allowing users to trade between all allowlisted assets available using the platforms above.

  2. Contributing to the privacy that Pools provide to users holding assets within them.

In other words, no one can link assets within the pool to specific users since they can swap assets and trade with one another within it, even if deposits/withdraws to the Pool itself are viewable by observers.

Under the hood

The following scenario illustrates how zSwap works in a practical setting:

  • Alice wants to swap her ETH for USDC. As a privacy-conscious user, she already holds her ETH as zETH within Panther Protocol (ETH deposited into a Shielded Pool). This grants her access to the privacy-preserving functionalities of zSwap.

  • Alice connects her wallet to Panther and navigates to the Swap page on her Zone Manager’s dApp interface.

  • Alice navigates to the left side of the UI and chooses the selling token and an amount based on her historical deposits (e.g. zETH). She then chooses the receivable token (e.g. zUSDC).

  • zSwap automatically calculates the exchange rate between the sellable and receivable asset (e.g. 1750 zUSDC per 1 zETH) according to real-time market data from DEXs.

  • zSwap will automatically display the best swapping route identified and the details of the swap. Alice can choose to expand the list of DEX routing options to compare the costs of using a different DEX and select it if she decides to do so.

  • After Alice finds a preferred option among all the DEX options available, she executes the transaction by pressing the Swap button.

  • The DeFi Adaptor generates a unique hashed time-locked contract (HTLC) for this atomic swap.

  • During the swap process, Alice reveals her secret keys within the predefined time limit, allowing the DeFi Adaptor to execute the atomic swap. This process preserves her privacy, as Panther’s user identity and transaction details remain shielded within the Pool.

  • Once her transaction goes through, the newly deposited asset (in our example, USDC) is delivered to Alice as a zUSDC. Alice also gets rewarded for conducting a transaction on zSwap through Privacy Reward Points (PRPs), which reward users for increasing the anonymity set of the Panther ecosystem. Should an issue cause the transaction to fail at any step of the way, Alice’s asset balance would remain unchanged.

Last updated