Custom Linking
Query Parameters
The Tachyswap front-end supports URL query parameters to allow for custom linking to the Tachyswap frontend. Users and developers can use these query parameters to link to the Uniswap frontend with custom prefilled settings.
Each Page has specific available URL parameters that can be set. Global parameters can be used on all pages.
A parameter used on an incorrect page will have no effect on frontend settings. Parameters not set with a URL parameter will be set to standard frontend defaults.
Global
theme
String
Sets them to dark or light mode.
Theme Options
Theme can be set as light
or dark
.
Example Usage
https://app.tachyswap.org/#/swap?theme=dark
Swap Page
inputCurrency
address
Input currency that will be swapped for output currency.
outputCurrency
address or XTZ
Output currency that input currency will be swapped for.
exactAmount
number
The custom token amount to buy or sell.
exactField
string
The field to set custom token amount for. Must be input
or output
.
Defaults
XTZ defaults as the input currency. When a different token is selected for either input or output XTZ will default as the opposite selected currency.
Constraints
Addresses must be valid ERC20 addresses. Slippage and amount values must be valid numbers accepted by the frontend (or error will prevent from swapping). Slippage can 0, or within the range 10->9999 bips (which converts to 0%, 0.01%->99%)
When selecting XTZ as the output currency a user must also choose an inputCurrency that is not XTZ (to prevent XTZ being populated in both fields)
Setting Amounts
Two parameters, exactField and exactAmount can be used to set specific token amounts to be sold or bought. Both fields must be set in the URL or there will be no effect on the settings.
Example Usage
https://app.tachyswap.org/#/swap?exactField=input&exactAmount=10&inputCurrency=0x2C03058C8AFC06713be23e58D2febC8337dbfE6A
Pool Page
The Pool page is made up of 2 subroutes: add
, remove
.
Add Liquidity
Token0
address
Pool to withdraw liquidity from. (Must be an ERC20 address with an existing token)
Token1
address
Pool to withdraw liquidity from. (Must be an ERC20 address with an existing token)
Example Usage
https://app.tachyswap.org/#/add/0xfc24f770F94edBca6D6f885E12d4317320BcB401/0x2C03058C8AFC06713be23e58D2febC8337dbfE6A
Remove Liquidity
Token0
address
Pool to withdraw liquidity from. (Must be an ERC20 address with an existing token)
Token1
address
Pool to withdraw liquidity from. (Must be an ERC20 address with an existing token)
Example Usage
https://app.tachyswap.org/#/remove/0xfc24f770F94edBca6D6f885E12d4317320BcB401/0x2C03058C8AFC06713be23e58D2febC8337dbfE6A
Last updated