Oracles
Tranquil Finance currently uses an oracle stack based on Chainlink price feeds.
After migrating to use Chainlink oracles, this section is now only here for references purposes.
We use a 10-minute TWAP oracle for each supported Sushiswap pair. These oracles are based on the design recommended and supported by Uniswap V2, which also applies to the Sushiswap fork.
This type of TWAP oracle is resistant to flashloan attacks, like the recent exploit on CREAM Finance. However, one weakness of TWAP oracles is the freshness of the price in volatile market conditions. For this reason, we will keep conservative collateral factors for all markets until Chainlink oracles are integrated.
In addition to the TWAP oracles, the team also maintains a fallback oracle that kicks in if the TWAP oracle price is not fresh or the pair has insufficient liquidity. The prices are queried from Coingecko and periodically posted to the contract.
The team also have a suite of alerts paging us when anomalies occur, such as discrepancies in the oracle price. We will take swift and appropriate action to defend the assets deposited with the protocol.
Because the Sushiswap TWAP oracles require constant updates to maintain freshness, we have jobs to periodically make the update transactions. Additionally, we have implemented an economic incentive for the community to help keep the oracles up to date.
Anyone can claim a small amount of TRANQ that is slowly dripped by the faucet. In doing so, the transaction also updates the TWAP oracles. Harmony's low fees makes claiming from the faucet regularly worthwhile to do.
These are the main oracles for Tranquil Finance:
Contract | Text |
---|---|
TranquilPriceOracle | 0x0C99E05CD2dCb52A583a3694F4d91813eFb5B071 |
ChainlinkPriceOracle | 0x1b2dC29Bcd7B54021514aE9A06dE9ebD20597819 |
UniswapOracle | 0x5Aaa4233a27CD10E8c31dE34E25dB7Ee2b976C5a |
FallbackOracle | 0x6BFf70a4e7e2574F309fD5999492E478f2Fb737A |
For our legacy UniswapOracle, each Sushiswap pair has its own TWAP oracle:
Sushiswap Pair | Contract Address |
---|---|
1WBTC / WONE | 0xbd69ad94354933D459abAD93F8769f1f146DDC0a |
1ETH / WONE | 0x3096CDdAcc8a81C27c3F8F225B9b61A6c52E2CAd |
1USDC / WONE | 0xfD494aa1617446843Db82ad4f2F3B18f7b1393Ca |
1USDT / WONE | 0x64f48DF335a79dABDB1cB754729Fa80B065d788d |
Last modified 1yr ago