Skip to content

Commit

Permalink
sdk: account for switchboard max confidence
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Mar 5, 2024
1 parent cfbe238 commit e593a70
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sdk/src/oracles/switchboardClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ export class SwitchboardClient implements OracleClient {
aggregatorAccountData.latestConfirmedRound.result
);

const confidence = convertSwitchboardDecimal(
aggregatorAccountData.latestConfirmedRound.stdDeviation
const confidence = BN.max(
convertSwitchboardDecimal(
aggregatorAccountData.latestConfirmedRound.stdDeviation
),
price.divn(1000)
);

const hasSufficientNumberOfDataPoints =
Expand Down

0 comments on commit e593a70

Please sign in to comment.