-
Notifications
You must be signed in to change notification settings - Fork 381
feat(bastion-protocol): Add Bastion protocol to Zapper #628
feat(bastion-protocol): Add Bastion protocol to Zapper #628
Conversation
const borrowApy = Math.pow(1 + secondsPerDay * Number(borrowRate), 365) - 1; | ||
|
||
// Display Props | ||
const label = underlyingToken.symbol; |
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.
You should use the realmName
in the label. The dataProps
are not displayed in the UI, only the displayProps
.
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.
Example:
const label = `${underlyingToken.symbol} in ${realmName}`
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.
Did just that, thanks for letting me know.
}; | ||
|
||
@Injectable() | ||
export class BastionSupplyTokenHelper { |
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 it possible to avoid the code duplication by using the CompoundSupplyTokenHelper
from src/apps/compound/helpers
? That helper should work for any Compound fork.
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.
You can take inspiration from src/apps/market-xyz/avalanche/market-xyz.supply.token-fetcher.ts
, which is a lot like Bastion in that there are multiple isolated lending markets that all operate via separate comptrollers.
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.
Used CompoundSupplyTokenHelper
now.
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.
Looks like our ABI is not compatible with compound's, I will fix that first.
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.
Because of the ABI difference, I think it's best to just stick with using our own helper.
}; | ||
|
||
@Injectable() | ||
export class BastionSwapTokenHelper { |
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 it possible to use the CurvePoolTokenHelper
from src/apps/curve/helpers
? See src/apps/saddle/ethereum/saddle.pool.token-fetcher.ts
for an example of a Curve fork that uses those helper classes to avoid code duplication.
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 don't keep track of the volume at the moment so the value is zero for now. Otherwise, using the CurvePoolTokenHelper
works fine.
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.
Overall the implementation will work, but you could probably remove a lot of code duplication using the helper classes from the Compound and Curve apps.
One required change would be to add the realmName
to the label so that users can differentiate their deposited/borrowed balances across different realms.
Ping me once you're ready for a merge!
…/zapper-integration into bastion-protocol
I think it's good for merging, let me know if you still have any issues. To sum up the changes:
|
Thank you for your patience ser @BastionProvider Merging now. |
Hello @BastionProvider ! 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! |
Gentle ping on the above @BastionProvider ! Let me know |
Hey, sorry I just saw this. What's your tag on discord? I can't find you on the zapper discord for some reason. I'll DM the address there @SamIam-0x . |
Hey- Discord name is Sam | Zapper#8264 |
Description
Bastion Lending and Stableswap integration to Zapper
Checklist
How to test?