* By Starcoin community
With the development of blockchain, DeFi is essential part of the public chain ecosystem. Recently, lots of DeFi projects have emerged in the Starcoin ecosystem. The cross-chain bridge Poly Network has settled in strongly, the FAI has landed on the Stable Coin track, and Starswap is about to take off. Starswap has been deployed on Starcoin’s Barnard network and will be launched on the main network soon.
Starswap contains two core functions: Swap and liquidity mining. Swap is to exchange one kind of Token for another kind of Token on the chain. The role of liquidity mining is to provide liquidity for a certain trading pair in a decentralized trading pool. This article will explain to you how to try Starswap early.
Select the Correct Network
Set up StarMask’s network first. If it is the main network, choose the Starcoin main network. In this article, we will use the Barnard test network, so set the StarMask network to the Barnard network.
Ensure StarMask Has Enough STC
StarMask has enough STC to perform subsequent operations such as swap. Run test on the Barnard network, so you need to apply for the STC required for the test through the Starcoin faucet. In the case of the main network, users are required to top up their wallet accounts by themselves.
Faucet
Find Barnard’s Faucet on Starcoin official website
Copy Account Address
Copy your own account address from StarMask
Apply for Test STC
Fill in the account address in step 2 to the Starcoin faucet opened in step 1 to apply for STC on the Barnard testnet.
It should be noted here that, in order to prevent malicious applications, the faucet website needs to bind a Twitter account to apply.
Swap Transaction
The previous section is preparation work, and here is the official introduction to Starswap. Click on the Starswap experience entry to enter home page.
Connect to StarMask Wallet
Click to connect your own StarMask wallet as shown.
Select a Token
Select one token you want to swap.
Select FAI as example
FAI is the first stable coin in the Starcoin ecosystem. Take FAI as an example.
Swap
This step is to actually use STC to exchange FAI. First, enter the number of STC, which will be converted into the number of FAI according to the exchange price on the chain. Then click the Swap button.
Confirm Swap
In this step, mainly to confirm the transaction details such as quntity and slippage, StarMask will be called after confirmation.
Initiate a Transaction
In this step, we will actually initiate an on-chain transaction, so wallet confirmation, signature, and transaction are required.
Submit transaction to the chain
After the transaction is submitted on the chain, close the pop-up window. At this point, the Swap is finished, and the account has the FAI Token at this time.
Liquidity
After the previous swap transaction, the account now has STC and FAI.
Go to liquidity Page
As shown in Figure ①, click ‘Pool’ to enter the liquidity page. If StarMask is not connected, click ‘connect to a wallet’ to connect StarMask. Then click ‘Add Liquidity’ button to add liquidity.
Add liquidity
First select the LP pair, here STC and FAI are used as examples. Click ① adding the number of STC and FAI, try to add them proportionally. Then click the ‘Supply’ button to add liquidity.
Confirm
In this step, it is mainly to confirm the details of liquidity transactions, and StarMask will be called after confirmation.
Initiate a Transaction
In this step, we will actually initiate an on-chain transaction, so wallet confirmation, signature, and transaction are required.
Submit transaction to the chain
After the transaction confirmation, and close the pop-up window after the transaction is on the chain.
Added liquidity successfully
After adding liquidity successfully, you can see the addition result on the list page.
Starcoin and Starswap
The previous is the tutorial of Starswap for Swap trading and liquidity mining.
Starswap is used as the universal DEX of Starcoin ecosystem, marking Starcoin’s entry into a new DeFi era. Starswap is a Move contract, resource-oriented programming and generic programming. In terms of security and extensibility, it is better than Solidity.
It is believed that there will be more and more Move contracts, and the Starcoin ecology and the Move ecology will become more and more abundant.