Skip to content

Commit 137f03a

Browse files
committed
Simulate Neutron current Pyth price source.
1 parent 8ae5285 commit 137f03a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

contracts/oracle/wasm/src/price_source.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,17 @@ impl PriceSourceChecked<Empty> for WasmPriceSourceChecked {
324324
denom: &str,
325325
config: &Config,
326326
price_sources: &Map<&str, Self>,
327-
kind: ActionKind,
327+
_kind: ActionKind,
328328
) -> ContractResult<Decimal> {
329+
// Kind (Default or Liquidation) is used to differentiate between the two types of pricing in Pyth price source.
330+
// Liquidation only check Staleness, while Default checks Staleness, Confidence and Deviation.
331+
//
332+
// Current Mars contracts on Neutron don't use kind and always checks only Staleness for Pyth (if we want to use this feature we
333+
// have to migrate other Mars v2 contracts).
334+
//
335+
// It is safe to use Liquidation kind for all price sources simulating the current behavior on Neutron (only Staleness check).
336+
let kind = ActionKind::Liquidation;
337+
329338
match self {
330339
WasmPriceSource::Fixed {
331340
price,

0 commit comments

Comments
 (0)