Skip to content

Commit 1fc2bc7

Browse files
committed
feat: If a link to a token is sent to an oracle account where the oracle does not have that link price,
1 parent 4ac19b1 commit 1fc2bc7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

repository/token.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ func (repo *Repository) getValueInCurrency(blockNum int64, oracle schemas.PriceO
6666
BlockNumber: big.NewInt(blockNum),
6767
}
6868
currencyAddr := repo.GetUSD()
69+
if oracle.Hex().Hex() == "0x6385892aCB085eaa24b745a712C9e682d80FF681" && token == "0x514910771AF9Ca656af840dff83E8264EcF986CA" && currency == "USD" && blockNum == 23465629 {
70+
return 21.432 * utils.GetFloat64Decimal(amount, repo.GetToken(token).Decimals) // link token price and amount for usd conversion
71+
}
6972
if currency != "USD" {
7073
currencyAddr = common.HexToAddress(currency)
7174
}

0 commit comments

Comments
 (0)