Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ node_modules/
.env.local
.env.*.local
dist/
coverage/
*.log
.DS_Store
6 changes: 5 additions & 1 deletion src/services/priceOracle.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ async function getPrice(assetCode, issuer = null) {

async function fetchFreshPrice(assetCode, issuer = null, redisUnavailable = false) {
const sourceResults = await fetchFromAllSources(assetCode, issuer);
const sourcesAttempted = sourceResults.map((r) => r.name);
const sourcesAttempted = sourceResults.map((r) => r.source);
const prices = sourceResults.map((r) => r.price);

const aggregatedPrice = median(prices);
Expand Down Expand Up @@ -236,4 +236,8 @@ module.exports = {
getPrice,
fetchFreshPrice,
refreshAllCachedPrices,
// Internal helpers exported for unit testing.
median,
detectAnomaly,
fetchFromAllSources,
};
Loading