HyperHack
Test DEX
Learn how to use the Test DEX and its subgraph
Interacting with the DEX
A Decentralized Exchange (DEX) allows users to swap tokens directly from their wallets, provide liquidity, and earn fees. To use the DEX:
-
Connect Your Wallet: Use a wallet like MetaMask or Rabby to connect to the DEX Interface.
-
Swap Tokens:
- Select the token you want to swap from and the token you want to receive.
- Enter the amount and review the estimated output.
- Approve the token if required, then confirm the swap.
-
Provide Liquidity:
- Go to the "Liquidity" section.
- Select the token pair and amounts to deposit.
- Approve both tokens if necessary, then supply liquidity.
- You will receive LP (Liquidity Provider) tokens representing your share.
Querying DEX Data with the Subgraph
The subgraph indexes on-chain DEX events and exposes them via a GraphQL API for easy querying.
-
Access the Subgraph:
- Use the Subgraph Endpoint
-
Example Queries:
- Fetch Recent Swaps:
- Get Liquidity Pool Stats:
- Fetch Recent Swaps:
Get Testnet Tokens
You can get testnet tokens from the HyperHack Forum.