Query Parameters
The Pegasys front-end supports URL query parameters to allow for custom linking to the Pegasys frontend. Users and developers can use these query parameters to link to the Pegasys 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.
#
GlobalParameter | Type | Description |
---|---|---|
theme | String | Sets them to dark or light mode. |
#
Theme OptionsTheme can be set as light
or dark
.
#
Example Usagehttps://app.pegasys.finance/#/swap?theme=light
#
Swap PageParameter | Type | Description |
---|---|---|
inputCurrency | address | Input currency that will be swapped for output currency. |
outputCurrency | address or SYS | 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 . |
#
DefaultsSYS defaults as the input currency. When a different token is selected for either input or output SYS will default as the opposite selected currency.
#
ConstraintsAddresses 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 SYS as the output currency a user must also choose an inputCurrency that is not SYS (to prevent SYS being populated in both fields)
#
Setting AmountsTwo 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 Usagehttps://app.pegasys.finance/#/swap?exactField=input&exactAmount=10&inputCurrency=0xeFAeeE334F0Fd1712f9a8cc375f427D9Cdd40d73
#
Pool PageThe Pool page is made up of 2 subroutes: add
, remove
.
#
Add LiquidityParameter | Type | Description |
---|---|---|
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 Usagehttps://app.pegasys.finance/#/add/0x6B175474E89094C44Da98b954EedeAC495271d0F/0xeFAeeE334F0Fd1712f9a8cc375f427D9Cdd40d73
#
Remove LiquidityParameter | Type | Description |
---|---|---|
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) |
Pegasys Dash seperated.
#
Example Usagehttps://app.pegasys.finance/#/remove/0x6B175474E89094C44Da98b954EedeAC495271d0F-0xeFAeeE334F0Fd1712f9a8cc375f427D9Cdd40d73