Due to additional complexities with the xSUSHI token, this adapter allows for getting the real price of xSUSHI.
The calculation is done as follows:
pricexSUSHI = priceSUSHI * (SUSHI.balanceOf(xSUSHI.address) * 1e18 / xSUSHI.totalSupply())
The adapter takes the following environment variables:
Required? | Name | Description | Options | Defaults to |
---|---|---|---|---|
✅ | ETHEREUM_RPC_URL |
URL of Ethereum RPC node | ||
ETHEREUM_CHAIN_ID |
The chain id to connect to | 1 | ||
XSUSHI_ADDRESS |
The address of the xSUSHI token | 0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272 |
Additional environment variables must be set according to the Token Allocation adapter. This composite adapter executes the code from the Token Allocation composite adapter. As such the same configuration and input parameters apply to this adapter. See ../../non-deployable/token-allocation/README.md for more details.
See the Composite Adapter README for more information on how to get started.
Required? | Name | Description | Options | Defaults to |
---|---|---|---|---|
endpoint | The endpoint to use | price, ratio, sushi | price |
Required? | Name | Description | Options | Defaults to |
---|---|---|---|---|
✅ | base , from , or coin |
The symbol of the currency to query | xSUSHI |
|
✅ | quote , to , or market |
The symbol of the currency to convert to | BTC , ETH , USD |
|
source |
The data provider to query. This is required if not specified in config. |
{
"id": "1",
"data": {
"base": "xSUSHI",
"quote": "USD"
}
}
{
"data": {
"payload": {
"SUSHI": {
"quote": {
"USD": {
"price": 12.049759759496
}
}
}
},
"result": 14.422000451599907,
"sources": []
},
"jobRunID": "1",
"result": 14.422000451599907,
"statusCode": 200
}
Gets the ratio between SUSHI and xSUSHI tokens (with 18 decimals)
None
{
"id": "1",
"data": {}
}
{
"data": "1196870372476465755",
"jobRunID": "1",
"statusCode": 200
}
Gets the SUSHI token address from the xSUSHI contract
None
{
"id": "1",
"data": {}
}
{
"data": "0x6B3595068778DD592e39A122f4f5a5cF09C90fE2",
"jobRunID": "1",
"statusCode": 200
}