Oracle TWAP Anchoring Upgrade

2 min readSep 18, 2022


We are excited to announce the upgrade of Bastion’s oracle infrastructure with an Anchoring mechanism factoring in the Time-Weighted Average Price (TWAP) of Trisolaris prices. Any deviations in prices from the Flux pricefeed beyond a 15% threshold will result in prices being frozen until they correct. This allows Bastion to increase the security of our oracles while maintaining decentralisation. After backtesting with historical price simulations, we have found that this design is resilient to blackswan events such as the previous USDT Price Spike Incident.

Oracle Monitoring System Dashboard

We also built a live oracle monitoring system viewable on the Bastion Dashboard. It displays important data points such as the timestamps, the historical prices from the Flux price feed and the TWAP from Trisolaris. The team has also built an alert system of on-chain scraping bots which monitor the oracles for stale prices, price deviations, and RPC downtime.


The pricefeeds have undergone several independent audits and we are glad to publicly release Watchpug’s report. The Oracle contract is publicly verified on Aurorascan.

The off-chain infastructure for triggering the updates for the time weighted average price and running the bots for the monitoring system were deployed in multiple instances on separate cloud service providers for redundancy to get as close to 100% uptime as possible. One instance in particular, for triggering the TWAP update, is run as a CRON job in Open Zeppelin Defender’s Autotask feature.

Bounty hunters are encouraged to report bugs, if there are any, to our newly released Immunefi Bug Bounty program for up to $250k in rewards.

About Bastion

Bastion is a Lending and Stableswap protocol built on Aurora, NEAR’s EVM-compatible layer. The project innovates with novel features such as: isolated markets, interest rate swaps, increased receipt token utility, veTokens, gauges, and boosters. Building on Aurora enables Bastion to create an autonomous interest-rate engine with superior capital efficiency, low slippage swaps, fast transactions, ultra-low fees, precise liquidations, and harness the underlying UX benefits of NEAR.

Website | Twitter | Discord | Blog | Docs | Email

DISCLAIMER: This article does not constitute investment advice. Bastion Protocol Token (BSTN) is a means by which users may utilize and govern the protocol. Bastion does not recommend purchasing BSTN for speculative investment purposes. BSTN tokens may lose value or have no value and may have no market. Please read the full disclaimers here.