-
Notifications
You must be signed in to change notification settings - Fork 383
feat(tenderize): integrate tenderTokens and swapTokens #882
Conversation
symbol, | ||
decimals, | ||
supply, | ||
tokens: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put the underlyingToken
in this array
symbol, | ||
decimals, | ||
supply, | ||
tokens: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing as mentioned earlier, put the underlyingToken
in this array
import { TENDERIZE_DEFINITION } from '../tenderize.definition'; | ||
|
||
const appId = TENDERIZE_DEFINITION.id; | ||
const groupId = TENDERIZE_DEFINITION.groups.swaptokens.id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename group to swap
, and rename the file to tenderize.swap.token-fetcher.ts
(the additional tokens
is redundant)
const network = Network.ETHEREUM_MAINNET; | ||
|
||
@Register.TokenPositionFetcher({ appId, groupId, network }) | ||
export class EthereumTenderizeSwapTokensTokenFetcher implements PositionFetcher<AppTokenPosition> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the above changes, rename this to EthereumTenderizeSwapTokenFetcher
.
import { TENDERIZE_DEFINITION } from '../tenderize.definition'; | ||
|
||
const appId = TENDERIZE_DEFINITION.id; | ||
const groupId = TENDERIZE_DEFINITION.groups.tendertokens.id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename group to tender
, and rename the file to tenderize.tender.token-fetcher.ts
Rename the class below to EthereumTenderizeTenderTokenFetcher
symbol, | ||
decimals, | ||
supply, | ||
tokens: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add underlying token to this array
supply, | ||
tokens: [], | ||
dataProps: {}, | ||
pricePerShare: 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Price per share is Number(virtualPrice) / 10 ** decimals
as you did above (it's the ratio of the price of your tender token to your underlying token)
displayProps: { | ||
label: symbol, | ||
secondaryLabel: buildDollarDisplayItem(price), | ||
tertiaryLabel: `${apy}% APY`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apy.toFixed(2)
will be rendered better in the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are already doing that in the API endpoint
label: symbol, | ||
secondaryLabel: buildDollarDisplayItem(price), | ||
tertiaryLabel: `${apy}% APY`, | ||
images: [`https://app.tenderize.me/tender${symbol}.svg`], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
images: getImagesFromToken(underlyingToken)
This will use the image of the underlying token. In our UI, we automatically render the Tender logo at the top right of that logo as well, so it'll look nice trust me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case we might as well query here the original logo, because the one we host is a BW version for the underlying assets
displayProps: { | ||
label: symbol, | ||
secondaryLabel: buildDollarDisplayItem(price), | ||
tertiaryLabel: `19.34% APY`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably shouldn't hard code this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file used at all actually? You can probably remove it.
Hello @vmaark ! Looks like you did not provide an address when submitting your PR. I recognize it may have seemed kind of random that we were asking for a wallet address with a PR submission, but we are actually looking for ways to reward Studio contributors in the future. Is there an address you’d want to provide? Could even be an empty address, if you do not have an doxxed address Let me know! Also, if you’d like to privately provide it, feel free to shoot me a TG https://t.me/SamIAm_0x or DM on the Zapper Discord. Thanks! |
Description
Initial integration for https://tenderize.me.
Integrate tenderTokens (liquid staking derivatives of MATIC, LPT, GPT, AUDIO), and their corresponding swap/LP tokens, e.g.
tGRT-SWAP
(paired with their underlying token).Checklist
How to test?
http://localhost:5001/apps/tenderize/tokens?groupIds[]=swaptokens&network=ethereum
http://localhost:5001/apps/tenderize/tokens?groupIds[]=tendertokens&network=ethereum
http://localhost:5001/apps/tenderize/balances?addresses[]=0xe916b4a5691bd2ad3b4af3b2549fed521f65de35&network=ethereum