Skip to content

Commit 3ab3f0d

Browse files
committed
docs: clarify TWAP update requirements in Pyth contract
1 parent f8c8ac2 commit 3ab3f0d

File tree

1 file changed

+2
-0
lines changed
  • target_chains/ethereum/contracts/contracts/pyth

1 file changed

+2
-0
lines changed

target_chains/ethereum/contracts/contracts/pyth/Pyth.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ abstract contract Pyth is
370370
override
371371
returns (PythStructs.TwapPriceFeed[] memory twapPriceFeeds)
372372
{
373+
// TWAP requires exactly 2 updates - one for the start point and one for the end point
374+
// to calculate the time-weighted average price between those two points
373375
if (updateData.length != 2) {
374376
revert PythErrors.InvalidUpdateData();
375377
}

0 commit comments

Comments
 (0)