Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(origin-dollar): Fix logos and OGV staking rewards (#956)
  • Loading branch information
mikeshultz committed Jul 28, 2022
1 parent ff6ea53 commit 12f387b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/apps/origin-dollar/assets/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -23,25 +23,30 @@ export class EthereumOriginDollarRewardsContractPositionFetcher implements Posit
) {}

async getPositions() {
const baseTokens = await this.appToolkit.getBaseTokenPrices(network);

const ogv = baseTokens.find(v => v.address === '0x9c354503c38481a7a7a51629142963f98ecc12d0');
if (!ogv) return [];

const appTokens = await this.appToolkit.getAppTokenPositions({
appId: 'origin-dollar',
groupIds: ['veogv'],
network,
});

const ogv = appTokens.find(v => v.address === '0x0c4576ca1c365868e162554af8e385dc3e7c66d9');
const veogv = appTokens.find(v => v.address === '0x0c4576ca1c365868e162554af8e385dc3e7c66d9');

if (!ogv) {
if (!veogv) {
return [];
}

const position: ContractPosition = {
type: ContractType.POSITION,
appId,
groupId,
address: ogv.address,
address: veogv.address,
network,
tokens: [...appTokens],
tokens: [ogv],
dataProps: {},
displayProps: {
label: `${getLabelFromToken(ogv)} Staking Rewards`,
Expand Down
3 changes: 2 additions & 1 deletion src/apps/origin-dollar/helpers/ogv-rewards.balance-helper.ts
Expand Up @@ -3,6 +3,7 @@ import { Inject, Injectable } from '@nestjs/common';
import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface';
import { drillBalance } from '~app-toolkit/helpers/balance/token-balance.helper';
import { ContractPositionBalance } from '~position/position-balance.interface';
import { claimable } from '~position/position.utils';
import { Network } from '~types/network.interface';

import { OriginDollarContractFactory } from '../contracts';
Expand Down Expand Up @@ -41,7 +42,7 @@ export class OGVRewardsBalanceHelper {
});

const balanceRaw = await multicall.wrap(veogv).previewRewards(address);
const tokenBalance = drillBalance(contractPosition.tokens[0], balanceRaw.toString());
const tokenBalance = drillBalance(claimable(contractPosition.tokens[0]), balanceRaw.toString());

const contractPositionBalance: ContractPositionBalance = {
...contractPosition,
Expand Down

0 comments on commit 12f387b

Please sign in to comment.