kortanaswap
Kortana

Oracle

Spot price, time-weighted price, and why the difference matters.

Spot price is the instantaneous reserve ratio. It is what the interface displays, and it is accurate — but it can be moved arbitrarily far within a single transaction by anyone with enough capital, and a flash loan removes even that requirement.

The time-weighted average price averages over a window, which makes manipulation cost proportional to how long the false price must be held. Holding it means standing against arbitrage for every block of that window.

Any contract pricing collateral off spot can be drained this way, and many have been. KortanaSwap's oracle enforces a thirty-minute minimum window in code — there is no function that returns a shorter average, so a consumer cannot opt out by mistake.