
This docs refer to Ref Finance, a community built DEX in NEAR.Please check their docs for more information.
Query Token Exchange Rate
One can query the exchange rate of a token pair by calling theget-token-price method on the DEX contract.
- 🌐 WebApp
Example response
Example response
Query Whitelisted Tokens
Anyone list tokens for sale in the DEX. This is why, in order to protect users, the DEX contract has a list of whitelisted tokens that can be traded.- 🖥️ CLI
Lantstool
Examples Response
Examples Response
Register in the DEX
In order to use the contract, make sure to register your account in the DEX by paying for the storage you will use in order to keep track of your balances.- 🖥️ CLI
Lantstool
Deposit funds
In order to swap tokens, one must first deposit tokens into the DEX. For this, you will need to transfer the FT you want to swap to the DEX contract.- 🖥️ CLI
Lantstool
Get Deposit Balances
Query your deposit balances by calling theget_deposits method:
- 🌐 WebApp
- 🖥️ CLI
Lantstool
- 📄 Contract
Query Pools
DEXs work by having multiple pools of token pairs (e.g. NEAR-USDC) that users can deposit tokens into.- 🌐 WebApp
- 🖥️ CLI
Lantstool
- 📄 Contract
Swap tokens
In order to swap a token for another, you need to have funds, and there needs to exist a pool that has both tokens on it.- 🌐 WebApp
- 🖥️ CLI
Lantstool
- 📄 Contract
Additional Resources
- Claim Fungible Tokens from Lockup - the example how to claim locked tokens from the
lockup.burrow.nearcontract. - BSC Dex Collection - the example of how to build simple swap page for a DEX.