Skip to content

Commit

Permalink
fixed bug when creating MarketListedData for compound-forks (messari#303
Browse files Browse the repository at this point in the history
)

* fixed bug in MarketListedData for compound-forks

* Fixed more forks; switched ctoken & underlying

* bump subgraphVersion
  • Loading branch information
tnkrxyz authored and 0xbe1 committed Jun 27, 2022
1 parent 9b9a8b4 commit ac356aa
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 51 deletions.
15 changes: 8 additions & 7 deletions subgraphs/compound-forks/aurigami/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,17 @@ export function handleMarketListed(event: MarketListed): void {
protocol,
new TokenData(
underlyingTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),
new TokenData(
cTokenAddr,
getOrElse<string>(underlyingTokenContract.try_name(), "unknown"),
getOrElse<string>(underlyingTokenContract.try_symbol(), "unknown"),
getOrElse<i32>(underlyingTokenContract.try_decimals(), 0)
),
new TokenData(
cTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),

cTokenReserveFactorMantissa
),
event
Expand Down Expand Up @@ -178,7 +179,7 @@ function getOrCreateProtocol(): LendingProtocol {
"Aurigami",
"aurigami",
"1.2.1",
"1.0.2",
"1.0.3",
"1.0.0",
Network.AURORA,
comptroller.try_liquidationIncentiveMantissa(),
Expand Down
15 changes: 8 additions & 7 deletions subgraphs/compound-forks/banker-joe/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,17 @@ export function handleMarketListed(event: MarketListed): void {
protocol,
new TokenData(
underlyingTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),
new TokenData(
cTokenAddr,
getOrElse<string>(underlyingTokenContract.try_name(), "unknown"),
getOrElse<string>(underlyingTokenContract.try_symbol(), "unknown"),
getOrElse<i32>(underlyingTokenContract.try_decimals(), 0)
),
new TokenData(
cTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),

cTokenReserveFactorMantissa
),
event
Expand Down Expand Up @@ -168,7 +169,7 @@ function getOrCreateProtocol(): LendingProtocol {
"Banker Joe",
"banker-joe",
"1.2.1",
"1.0.1",
"1.0.2",
"1.0.0",
Network.AVALANCHE,
comptroller.try_liquidationIncentiveMantissa(),
Expand Down
14 changes: 7 additions & 7 deletions subgraphs/compound-forks/bastion-protocol/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ export function handleMarketListed(event: MarketListed): void {
protocol,
new TokenData(
underlyingTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),
new TokenData(
cTokenAddr,
getOrElse<string>(underlyingTokenContract.try_name(), "unknown"),
getOrElse<string>(underlyingTokenContract.try_symbol(), "unknown"),
getOrElse<i32>(underlyingTokenContract.try_decimals(), 0)
),
new TokenData(
cTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),
cTokenReserveFactorMantissa
),
event
Expand Down Expand Up @@ -178,7 +178,7 @@ function getOrCreateProtocol(): LendingProtocol {
"Bastion Protocol",
"bastion-protocol",
"1.2.1",
"1.0.5",
"1.0.6",
"1.0.0",
Network.AURORA,
comptroller.try_liquidationIncentiveMantissa(),
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/compound-forks/benqi/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function getOrCreateProtocol(): LendingProtocol {
"BENQI",
"benqi",
"1.2.1",
"1.0.3",
"1.0.4",
"1.0.0",
Network.AVALANCHE,
comptroller.try_liquidationIncentiveMantissa(),
Expand Down
15 changes: 8 additions & 7 deletions subgraphs/compound-forks/cream-finance/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,17 @@ export function handleMarketListed(event: MarketListed): void {
protocol,
new TokenData(
underlyingTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),
new TokenData(
cTokenAddr,
getOrElse<string>(underlyingTokenContract.try_name(), "unknown"),
getOrElse<string>(underlyingTokenContract.try_symbol(), "unknown"),
getOrElse<i32>(underlyingTokenContract.try_decimals(), 0)
),
new TokenData(
cTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),

cTokenReserveFactorMantissa
),
event
Expand Down Expand Up @@ -182,7 +183,7 @@ function getOrCreateProtocol(): LendingProtocol {
"CREAM Finance",
"cream-finance",
"1.2.1",
"1.0.2",
"1.0.3",
"1.0.0",
network,
comptroller.try_liquidationIncentiveMantissa(),
Expand Down
15 changes: 8 additions & 7 deletions subgraphs/compound-forks/iron-bank/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,17 @@ export function handleMarketListed(event: MarketListed): void {
protocol,
new TokenData(
underlyingTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),
new TokenData(
cTokenAddr,
getOrElse<string>(underlyingTokenContract.try_name(), "unknown"),
getOrElse<string>(underlyingTokenContract.try_symbol(), "unknown"),
getOrElse<i32>(underlyingTokenContract.try_decimals(), 0)
),
new TokenData(
cTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),

cTokenReserveFactorMantissa
),
event
Expand Down Expand Up @@ -169,7 +170,7 @@ function getOrCreateProtocol(): LendingProtocol {
"Iron Bank",
"iron-bank",
"1.2.1",
"1.0.4",
"1.0.5",
"1.0.0",
network,
comptroller.try_liquidationIncentiveMantissa(),
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/compound-forks/moonwell/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function getOrCreateProtocol(): LendingProtocol {
"Moonwell",
"moonwell",
"1.2.1",
"1.0.5",
"1.0.6",
"1.0.0",
Network.MOONRIVER,
comptroller.try_liquidationIncentiveMantissa(),
Expand Down
15 changes: 8 additions & 7 deletions subgraphs/compound-forks/scream/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,17 @@ export function handleMarketListed(event: MarketListed): void {
protocol,
new TokenData(
underlyingTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),
new TokenData(
cTokenAddr,
getOrElse<string>(underlyingTokenContract.try_name(), "unknown"),
getOrElse<string>(underlyingTokenContract.try_symbol(), "unknown"),
getOrElse<i32>(underlyingTokenContract.try_decimals(), 0)
),
new TokenData(
cTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),

cTokenReserveFactorMantissa
),
event
Expand Down Expand Up @@ -168,7 +169,7 @@ function getOrCreateProtocol(): LendingProtocol {
"Scream",
"scream",
"1.2.1",
"1.0.2",
"1.0.3",
"1.0.0",
Network.FANTOM,
comptroller.try_liquidationIncentiveMantissa(),
Expand Down
14 changes: 7 additions & 7 deletions subgraphs/compound-forks/venus/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ export function handleMarketListed(event: MarketListed): void {
protocol,
new TokenData(
underlyingTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),
new TokenData(
cTokenAddr,
getOrElse<string>(underlyingTokenContract.try_name(), "unknown"),
getOrElse<string>(underlyingTokenContract.try_symbol(), "unknown"),
getOrElse<i32>(underlyingTokenContract.try_decimals(), 0)
),
new TokenData(
cTokenAddr,
getOrElse<string>(cTokenContract.try_name(), "unknown"),
getOrElse<string>(cTokenContract.try_symbol(), "unknown"),
cTokenDecimals
),
cTokenReserveFactorMantissa
),
event
Expand Down Expand Up @@ -178,7 +178,7 @@ function getOrCreateProtocol(): LendingProtocol {
"Venus",
"venus",
"1.2.1",
"1.0.2",
"1.0.3",
"1.0.0",
Network.BSC,
comptroller.try_liquidationIncentiveMantissa(),
Expand Down

0 comments on commit ac356aa

Please sign in to comment.