Skip to content

Commit

Permalink
Simulate Neutron current Pyth price source.
Browse files Browse the repository at this point in the history
  • Loading branch information
piobab committed Mar 20, 2024
1 parent 8ae5285 commit 137f03a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion contracts/oracle/wasm/src/price_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,17 @@ impl PriceSourceChecked<Empty> for WasmPriceSourceChecked {
denom: &str,
config: &Config,
price_sources: &Map<&str, Self>,
kind: ActionKind,
_kind: ActionKind,
) -> ContractResult<Decimal> {
// Kind (Default or Liquidation) is used to differentiate between the two types of pricing in Pyth price source.
// Liquidation only check Staleness, while Default checks Staleness, Confidence and Deviation.
//
// Current Mars contracts on Neutron don't use kind and always checks only Staleness for Pyth (if we want to use this feature we
// have to migrate other Mars v2 contracts).
//
// It is safe to use Liquidation kind for all price sources simulating the current behavior on Neutron (only Staleness check).
let kind = ActionKind::Liquidation;

match self {
WasmPriceSource::Fixed {
price,
Expand Down

0 comments on commit 137f03a

Please sign in to comment.