Skip to content

Commit

Permalink
orbiter one oracle: Add iBTC as fair value price feed
Browse files Browse the repository at this point in the history
  • Loading branch information
kaythxbye committed Oct 6, 2023
1 parent 3c8bd40 commit 7295a76
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmd/blockchain/ethereum/diaOrbiterOneOracleService/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,20 @@ func periodicOracleUpdateHelper(oldPrice float64, deviationPermille int, auth *b
}
rawQ.Price = rawQ.Price * collateralRatio
rawQ.Symbol = "kBTC"
} else if address == "iBTC" && blockchain == "Kintsugi" {
rawQ, err = getAssetQuotationFromDia("Bitcoin", "0x0000000000000000000000000000000000000000")
if err != nil {
log.Fatalf("Failed to retrieve %s quotation data from DIA: %v", address, err)
return oldPrice, err
}

collateralRatio, err := getCollateralRatioFromDia("IBTC")
if err != nil {
log.Fatalf("Failed to retrieve %s collateral ratio data from DIA: %v", address, err)
return oldPrice, err
}
rawQ.Price = rawQ.Price * collateralRatio
rawQ.Symbol = "iBTC"
} else if address == "0x853d955aCEf822Db058eb8505911ED77F175b99e" && blockchain == "Ethereum" {
// Second special case: for FRAX use GQL with a selection of markets
price, symbol, err := getFraxGraphqlAssetQuotationFromDia(blockchain, address, 120, "vwap")
Expand Down

0 comments on commit 7295a76

Please sign in to comment.