Fix Aave v2 Reward Token

This commit is contained in:
Georges KABBOUCHI 2021-11-07 21:26:05 +02:00
parent a2b22db828
commit df850e352d

View File

@ -168,8 +168,8 @@
:type="item.type"
:supply-reward-rate="item.supplyRewardRate"
:borrow-reward-rate="item.borrowRewardRate"
reward-token-name="MATIC"
reward-currency="matic"
:reward-token-name="rewardTokenName"
:reward-currency="rewardCurrency"
:cf="item.cf"
:ll="item.ll"
:borrow-enabled="item.borrowEnabled"
@ -192,15 +192,17 @@ import { useBigNumber } from "~/composables/useBigNumber";
import CardAave from "~/components/protocols/CardAave.vue";
import AaveIcon from "~/assets/icons/aave.svg?inline";
import ButtonCTAOutlined from "~/components/common/input/ButtonCTAOutlined.vue";
import { Network, useNetwork } from "~/composables/useNetwork";
export default defineComponent({
components: {
BackIcon,
CardAave,
AaveIcon,
ButtonCTAOutlined,
ButtonCTAOutlined
},
setup() {
const { activeNetworkId } = useNetwork();
const {
position,
displayPositions,
@ -208,7 +210,7 @@ export default defineComponent({
totalBorrow,
status,
liquidation,
maxLiquidation,
maxLiquidation
} = useAaveV2Position();
const { div } = useBigNumber();
@ -227,6 +229,30 @@ export default defineComponent({
"type"
);
const rewardTokenName = computed(() => {
if (activeNetworkId.value === Network.Avalanche) {
return "AVAX";
}
if (activeNetworkId.value === Network.Mainnet) {
return "stkAAVE";
}
return "MATIC";
});
const rewardCurrency = computed(() => {
if (activeNetworkId.value === Network.Avalanche) {
return "avax";
}
if (activeNetworkId.value === Network.Mainnet) {
return "stkaave";
}
return "matic";
});
return {
position,
filteredPositions,
@ -239,6 +265,8 @@ export default defineComponent({
color,
text,
maxLiquidation,
rewardTokenName,
rewardCurrency
};
}
});