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

Commit

Permalink
fix(notional-finance-v3): Fix supply and borrow position key (#3093)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpoulin authored Nov 29, 2023
1 parent afccc62 commit 5000792
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type NotionalBorrowingDefinition = {
underlyingTokenAddress: string;
currencyId: number;
tokenId: string;
fCashPV: number;
maturity: number;
type: string;
};
Expand Down Expand Up @@ -120,8 +121,9 @@ export class ArbitrumNotionalFinanceV3BorrowContractPositionFetcher extends Cont
params: GetDataPropsParams<NotionalView, NotionalBorrowingDataProps, NotionalBorrowingDefinition>,
) {
const defaultDataProps = await super.getDataProps(params);
const props = pick(params.definition, ['currencyId', 'tokenId', 'maturity', 'fCashPV', 'type']);
return { ...defaultDataProps, ...props, positionKey: Object.values(props).join(':') };
const props = pick(params.definition, ['currencyId', 'tokenId', 'maturity', 'type']);
const fCashPV = params.definition.fCashPV;
return { ...defaultDataProps, ...props, fCashPV, positionKey: Object.values(props).join(':') };
}

async getLabel({ contractPosition }: GetDisplayPropsParams<NotionalView>): Promise<string> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type NotionalFinanceLendingDefinition = {
underlyingTokenAddress: string;
currencyId: number;
tokenId: string;
fCashPV: number;
maturity: number;
type: string;
};
Expand Down Expand Up @@ -119,8 +120,9 @@ export class ArbitrumNotionalFinanceV3SupplyContractPositionFetcher extends Cont
params: GetDataPropsParams<NotionalView, NotionalFinanceLendingDataProps, NotionalFinanceLendingDefinition>,
) {
const defaultDataProps = await super.getDataProps(params);
const props = pick(params.definition, ['currencyId', 'tokenId', 'maturity', 'fCashPV', 'type']);
return { ...defaultDataProps, ...props, positionKey: Object.values(props).join(':') };
const props = pick(params.definition, ['currencyId', 'tokenId', 'maturity', 'type']);
const fCashPV = params.definition.fCashPV;
return { ...defaultDataProps, ...props, fCashPV, positionKey: Object.values(props).join(':') };
}

async getLabel({ contractPosition }: GetDisplayPropsParams<NotionalView>): Promise<string> {
Expand Down

0 comments on commit 5000792

Please sign in to comment.