Skip to content

feat: add oracle price conditions (Chainlink + Pyth) #65

Open
minhtr09 wants to merge 1 commit into
mainfrom
conditional-swap-oracle
Open

feat: add oracle price conditions (Chainlink + Pyth) #65
minhtr09 wants to merge 1 commit into
mainfrom
conditional-swap-oracle

Conversation

@minhtr09

@minhtr09 minhtr09 commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@minhtr09 minhtr09 force-pushed the conditional-swap-oracle branch from 25c4647 to d26d596 Compare June 19, 2026 08:13
Comment on lines +89 to +91
priceIn < config.oracleIn.priceLimits >> 128
|| priceIn > uint128(config.oracleIn.priceLimits)
) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use packu128 for more concise code, or use unpack it clearly

}

// PYTH: price = pyth.price * 10^(expo + 18)
uint256 age = maxStaleness == 0 ? type(uint256).max : maxStaleness;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt allow zero max staleness

Comment on lines +52 to +62
if (updateData.length == 0) return;
address pythIn =
config.oracleIn.oracleType == OracleType.PYTH ? config.oracleIn.source : address(0);
address pythOut =
config.oracleOut.oracleType == OracleType.PYTH ? config.oracleOut.source : address(0);
if (pythIn != address(0)) {
_pythUpdate(pythIn, updateData);
}
if (pythOut != address(0) && pythOut != pythIn) {
_pythUpdate(pythOut, updateData);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too complicated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants