diff --git a/projects/subgraph-bean/schema.graphql b/projects/subgraph-bean/schema.graphql index 79720dbbfd..f740f8b026 100644 --- a/projects/subgraph-bean/schema.graphql +++ b/projects/subgraph-bean/schema.graphql @@ -8,7 +8,7 @@ type Token @entity { "Number of decimals" decimals: BigInt! - "Last USD price calculated" + "Last USD price calculated. Isn't calculated for all tokens, in those cases will be zero." lastPriceUSD: BigDecimal! } @@ -19,6 +19,9 @@ type Bean @entity { "Which chain this Bean is from" chain: String! + "Smart contract address of the Beanstalk this Bean is associated with" + beanstalk: String! + "Current supply" supply: BigInt! diff --git a/projects/subgraph-bean/src/utils/Bean.ts b/projects/subgraph-bean/src/utils/Bean.ts index 9c6527f306..cd3c7e70bf 100644 --- a/projects/subgraph-bean/src/utils/Bean.ts +++ b/projects/subgraph-bean/src/utils/Bean.ts @@ -7,7 +7,8 @@ import { BEAN_WETH_V1, BEAN_WETH_CP2_WELL, BEAN_3CRV_V1, - BEAN_LUSD_V1 + BEAN_LUSD_V1, + BEANSTALK } from "../../../subgraph-core/utils/Constants"; import { dayFromTimestamp, hourFromTimestamp } from "../../../subgraph-core/utils/Dates"; import { ONE_BD, toDecimal, ZERO_BD, ZERO_BI } from "../../../subgraph-core/utils/Decimals"; @@ -21,6 +22,7 @@ export function loadBean(token: string): Bean { if (bean == null) { bean = new Bean(token); bean.chain = "ethereum"; + bean.beanstalk = BEANSTALK.toHexString(); bean.supply = ZERO_BI; bean.marketCap = ZERO_BD; bean.lockedBeans = ZERO_BI;