Getting Started
This guide will help you quickly understand how to use JAMM DEX for token swaps and liquidity management.
Prerequisites
Before you begin, please ensure you have the following:
JuChain Wallet: A Web3 wallet that supports the JuChain network.
JU Token: The native token used to pay for transaction fees.
Test Tokens: ERC-20 tokens for swapping.
Contract Addresses
Mainnet Addresses
JAMMFactory:
0x6b5d54E6F73e96Ca960DBA71D778b98221939aa6JAMMRouter:
0x3F26fb54C28Eab026e908A9A9357a456F3c8Dc87WJU:
0x4d1B49B424afd7075d3c063adDf97D5575E1c7E2USDT:
0xc8e19C19479a866142B42fB390F2ea1Ff082E0D2ETH:
0x80077F108Dd73B709C43A1a13F0EEF25e48f7D0eBNB:
0x151b6F646Ac02Ed9877884ed9637A84f2FD8FaA6
Testnet Addresses
JAMMFactory:
0xbddd716a9d6325700d1c29562c819987e5b1f6a8JAMMRouter:
0x3f8b0038023393009712D0051D192a8825dd02B9WJU:
0xb8cdb16bc2b64d42638e285a691973ff10078d8e
Your First Token Swap
1. Setup
First, you need to connect to the JuChain network and prepare the tokens for swapping.
2. Executing a Swap
The following example shows how to swap TokenA for TokenB:
3. Swapping with JU
If you want to swap with the native JU token, use the ETH-related functions:
Providing Liquidity for the First Time
1. Adding Liquidity
2. Removing Liquidity
Using the permit Function
permit FunctionJAMM DEX supports EIP-2612 permit, allowing you to approve token spending with a signature, avoiding a separate approve transaction.
Querying Information
Getting Pair Information
Calculating Swap Amounts
Common Error Handling
Common Reasons for Transaction Failure
"JAMMRouter: EXPIRED": The transaction deadline has passed.
"JAMMRouter: INSUFFICIENT_OUTPUT_AMOUNT": Slippage is too high, and the output amount is less than the minimum required.
"JAMM: INSUFFICIENT_LIQUIDITY": Not enough liquidity in the pair for the swap.
"JAMMFactory: INVALID_FEE": An unsupported fee tier was used.
Error Handling Example
Next Steps
Now that you understand the basics of using JAMM DEX, you can continue learning about:
Fee Structure - Understand the fee system.
Referral System - Learn how to earn referral rewards.
Integration Guides - Integrate JAMM DEX into your application.
Getting Help
If you encounter any issues, you can get help through the following channels:
Technical Docs: Check the detailed technical reference.
Community Support:
https://t.me/jammfun
Last updated