Skip to content

Commit

Permalink
Fix pricing
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh9200 committed Aug 12, 2024
1 parent ee8f25c commit 7ca6aec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions subgraphs/llama-airforce/src/prices/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@ export const BIGDECIMAL_USD_PRICE = BigDecimal.fromString("1000000");
export const AAVE_ORACLE_DECIMALS = 8;
export const DEFAULT_USDC_DECIMALS = 6;
export const DEFAULT_DECIMALS = BigInt.fromI32(18);

export const PIREX_CVX_ADDRESS = Address.fromString(
"0xbce0cf87f513102f22232436cca2ca49e815c3ac"
);
export const CONVEX_TOKEN_ADDRESS = Address.fromString(
"0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b"
);
4 changes: 4 additions & 0 deletions subgraphs/llama-airforce/src/prices/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export function getUsdPricePerToken(
tokenAddr: Address,
block: ethereum.Block | null = null
): CustomPriceType {
if (tokenAddr.equals(constants.PIREX_CVX_ADDRESS)) {
tokenAddr = constants.CONVEX_TOKEN_ADDRESS;
}

if (tokenAddr.equals(constants.NULL.TYPE_ADDRESS)) {
return new CustomPriceType();
}
Expand Down

0 comments on commit 7ca6aec

Please sign in to comment.