Swapping

This section describes how to swap between assets in Penumbra using the default frontend. Penumbra offers a built-in decentralized exchange (DEX) that allows you to swap tokens privately and with optimal trade execution.

💡

A new frontend, Veil, for using Penumbra's built-in DEX is currently in alpha. You can try it out at dex.penumbra.zone (opens in a new tab). This frontend allows you to swap as well as open liquidity positions.

To swap using the default frontend, go to the Swap (opens in a new tab) page.

Swap

You can select the asset you want to swap from and to, and the amount you want to swap. The left-hand side specifies the input token, and the right-hand side specifies the output token.

💡

You are guaranteed to get the best market execution for your swap. Learn more about Penumbra's state of the art DEX design here.

Instant Swaps

Instant swaps are the simplest form of swap. This is the default mode of the swap page. You can also configure it manually by setting the Speed slider all the way to the left-hand side to the Instant Price option.

Swap Speed slider

The Instant Swap panel will estimate how your swap will be executed:

Instant Swap

This panel shows an estimation of:

  • How much of the output token you will receive,
  • The routes that will be used to execute the swap, and
  • The price impact of executing your swap.

You can click Estimate to get an updated estimate.

Once you are happy with the estimated execution, you can click Swap to execute your swap. In the Prax Wallet confirmation screen, you will see the swap:

Swap Confirmation

Once you approve the transaction, the swap will be executed, and you will see a notification:

Swap Notification

You will notice that a SwapClaim is being generated automatically. This is done after the swap is executed to mint the output tokens privately into Penumbra's shielded pool. After a moment, you should see:

Swap Claim

At this point, you will see the output tokens in your balance!

Gradual Dutch Auctions

Penumbra's DEX also supports gradual Dutch auctions. This is a more advanced form of swap that allows you to perform price discovery based on market demand, by offering your input swap assets over a period of time at dimishing prices until all tokens are sold.

You configure Gradual Dutch Auctions by moving the Speed slider on the swap page to the right. Play with the slider to view how different time scales affect the number of auctions that will be created. By moving the slider to the right, the auction will take place over a greater amount of time, leading to tokens being sold at more price points.

Speed slider

The Gradual Dutch Auction panel will show you an estimate of the price execution of the auction:

Gradual Dutch Auction

As above with the instant swap, click Estimate to get an updated estimate. You should set the Maximum and Minimum prices in this panel to ensure you get the best price for your tokens.

Click Start auctions to begin. The Prax Wallet approval screen will appear similar to the instant swap but will show auctions being created:

Gradual Dutch Auction Confirmation

You will see your auctions appear in the My Auctions part of the frontend.

The auctions conclude when all the input tokens are sold or when the auction duration expires, whichever comes first.

You can also end the auction by clicking End next to the auction:

Gradual Dutch Auction End

After the auction has ended, you can withdraw your output tokens by clicking Withdraw next to the auction:

Gradual Dutch Auction End Withdraw