AlphaSwap Tutorial

Dmytriiev Petro
6 min readMay 31, 2024

--

To engage with the Aleo blockchain and experience its privacy-centric features, setting up a proper wallet is essential. Here’s a step-by-step guide to get you started.

Getting the Leo Wallet

The Leo Wallet is specifically designed for the Aleo testnet. To download it, visit the official Leo Wallet website. Once installed, follow the official guide to create your testnet wallet. This wallet will be your primary tool for interacting with Aleo’s decentralized applications (dApps).

Additionally, AlphaSwap supports Fox Wallet and Soter Wallet. These wallets can also be downloaded from their respective official websites, providing you with more options for managing your assets.

Claiming Aleo Test Credits

New users can claim Aleo Test Credits daily by visiting the official Aleo faucet. Follow the prompts to send a text message and receive your test credits. For a quicker option, claim 5 Aleo Test Credits directly through the AlphaSwap faucet.

AlphaSwap Experience

Homepage Features

Visit the AlphaSwap homepage to access various functions such as Assets, Swap, Pools, Faucet, and Info. The interface also offers settings adjustments and wallet connection options, ensuring a user-friendly experience.

Wallet Connection and Settings

To connect your wallet on AlphaSwap, click the ‘Connect Wallet’ button in the top right corner. After signing in, your Aleo testnet wallet will be connected, displaying your wallet address. This connection is crucial for performing transactions and managing your assets on the platform.

Adjust transaction settings via the settings button, which allows you to control the allowable slippage for trades. The default is set at 0.5%, but you can customize it according to your preferences to manage price changes during trade execution.

Faucet

Due to the absence of a unified token protocol on Aleo, users must claim AlphaSwap’s test tokens via the Faucet feature. Click the claim button, sign with your wallet, and the test tokens will be allocated to you. Note that due to Aleo’s slower network confirmation times, receiving these tokens might take a few minutes. These tokens are for testing purposes only and hold no real value.

Wrap/Unwrap

AlphaSwap supports the ARC20 token protocol within the Aleo ecosystem, enabling the trading of ARC20-compliant tokens. For instance, Aleo Credits must be wrapped into WALEO before trading on AlphaSwap. You can also unwrap WALEO back into Aleo Credits at any time.

The Wrap function is designed for the privacy-focused conversion of Aleo Credits. Publicly received Aleo Credits need to be privatized using wallet tools before wrapping. Leo Wallet allows for the conversion between public and private states of Aleo Credits.

Asset Management

The Assets feature displays all AlphaSwap assets in your wallet. For privacy protection, private assets are not shown by default but can be revealed by opting to “Manage my private token.” Users can toggle tokens between public and private states, enhancing control over asset privacy.Swap Functionality

Swap functionality

AlphaSwap’s public trading feature, Basic Swap, offers a trading experience similar to Uniswap. Select the token pair you wish to exchange, enter the amount, and confirm the swap by signing the transaction with your wallet. The trade finalizes upon network confirmation.

Future updates will introduce private trading functionality, allowing users to execute transactions without disclosing their address information.

Liquidity Pool

AlphaSwap currently offers public Liquidity Pools, enabling users to add liquidity and earn fees from traders’ transactions. Add liquidity by selecting the desired tokens and amount, then confirm by signing with your wallet. Manage your liquidity assets (LP Tokens) in the “My Pool” section, where you can also remove liquidity to reclaim your original tokens.

Future updates will introduce private Liquidity Pool features, providing enhanced privacy and potential earnings.

Privacy Conversion

AlphaSwap supports Aleo blockchain’s privacy trading features, requiring users to manage private tokens. This function allows the privatization of public tokens, making them unassociated with your address. Tokens can also be re-publicized at any time.

Managing private tokens requires a signature to access your wallet’s private token balance. Switch tokens between public and private states as needed, enhancing your asset privacy management.

Private Swap Experience

To engage in private swaps, ensure your wallet contains private tokens. When initiating a private swap, select the input and output tokens, specify the amount, and the platform will display the expected outcome. Due to the complexity of private swaps, be mindful of several factors:

  1. Due to the UTXO model, it’s often not possible to trade the entire balance of private tokens in a single transaction. The platform will display the maximum amount that can be input, requiring multiple transactions to move all intended private tokens.
  2. In private swaps, you might not receive the full amount in private tokens. A portion of the output tokens might be public, sent to an address specified by the user.
  3. Price impact refers to how a trade affects the token’s price, particularly noticeable when the liquidity pool is small and the trade volume large.
  4. The “Wear Ratio” indicates the acceptable level of slippage for a private swap, akin to public swaps but compensated through public tokens. A portion of public tokens is reserved to mitigate potential slippage, with unspent public tokens potentially returned to the user. The platform suggests a default wear ratio of 0.5%.
  5. The refund address feature allows users to choose whether to receive unspent public tokens. Enabling this feature requires specifying a separate address for returns to maintain transaction privacy.

Once all necessary information for a private swap is entered, click on the “Private Swap” button to submit your transaction. Wait for the transaction to complete to view the updated balance in your wallet.

Conclusion

AlphaSwap stands as the inaugural DEX built on the Aleo blockchain, blending traditional features of Uniswap with Aleo’s privacy-preserving technology. It offers innovative solutions for trading and liquidity provision with privacy tokens, enhancing users’ privacy without compromising on capital efficiency. AlphaSwap is committed to advancing the Aleo DEX space, promising more cutting-edge and user-friendly functionalities in the future.

About AlphaSwap

AlphaSwap (previously AleoSwap) provides a private, secure, and smooth trading experience on the Aleo blockchain. Join the journey towards a new era of decentralized finance with AlphaSwap.

--

--