# Oracle Migration to Uniswap v3 (incentive adjustments)

**URL:** <https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510>\
**Category:** General Discussion\
**Created:** [October 9, 2023, 8:14pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510 "2023-10-09T20:14:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![piesrtasty](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.reflexer.finance/piesrtasty/32/207_2.png) [@piesrtasty](https://community.reflexer.finance/u/piesrtasty)\
**Post date:** [October 9, 2023, 8:14pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/1 "2023-10-09T20:14:54Z")

</div>

## Oracle Migration to Uniswap v3 (incentive adjustments)

### Overview

The list of oracles currently used can be found in this [post](https://hackmd.io/@piesrtasty/current-reflexer-oracles).

We would like to migrate the Chainlink RAI / USD oracle to Uni V3 (3 day TWAP).

As a Uni V3 pool would be RAI / ETH we will need to multiply the value by an ETH / USD price to get RAI / USD. We will have a converter feed contract that sits in front of the RAI / ETH uni v3 oracle and the ETH / USD Chainlink TWAP to perform this conversion.

This post will outline why we are switching, the associated incentive adjustments, the steps we will take to enact that change, and the timeline for the change.

### Reasons for switching

1. Chainlink plans to deprecate both it’s RAI / ETH and RAI / USD feeds due to lack of liquidity.
2. We have decreasing confidence in the data sources behind the RAI / USD chainlink feed as we have been seeing odd pricing deviations from time to time.

### Incentive Adjustments

We currently incentize liquidity in the RAI / ETH Uni V2 pool with 30 FLX / day. To ensure adequate liquidity for the Uni V3 oracle we will shift incentives from the V2 pool to the V3 pool so the LPs will migrate. As we know it’s an inconvenience to move LP positions over we will increase rewards the first month to 40 FLX / day (split between both pools) followed by a constant 30 FLX / day rate on the Uni v3 pool going forward. The incentive adjustment schedule will be as follows:

#### **FLX Distribution #31**

**Distribution date:** October 2023  
**Start:** September-15-2023 12:50pm UTC  
**Cutoff-date:** October-15-2023 12:50pm UTC  
**RAI/ETH UNI-V2 LP** : 30 FLX / day  
**RAI/ETH UNI-V3 LP** : 0 FLX / day

#### **FLX Distribution #32**

**Distribution date:** November 2023  
**Start:** October-15-2023 12:50pm UTC  
**Cutoff-date:** November-15-2023 12:50pm UTC  
**RAI/ETH UNI-V2 LP** : 20 FLX / day  
**RAI/ETH UNI-V3 LP** : 20 FLX / day

#### **FLX Distribution #33 and onward**

**Distribution date:** December 2023  
**Start:** November-15-2023 12:50pm UTC  
**Cutoff-date:** December-15-2023 12:50pm UTC  
**RAI/ETH UNI-V2 LP** : 0 FLX / day  
**RAI/ETH UNI-V3 LP** : 30 FLX / day

### Steps to implement oracle migration

1. Write forum post to share with community and get feedback (that is this post 🥹)

2. Write Uni V3 oracle and `ConverterFeed` contract.

3. Deploy contracts and monitor for period of time

4. Governance Proposal

### Timeline

- The contracts can be written, deployed, and monitored immediately.
- We will need to wait until the LPs have migrated by the end of November to enact the change.
- The governance process will take ~ 8 days
  - 1 day vote delay
  - 6 day vote period
  - 1 day execution delay

### Next Steps / Going Forward

Some things we are thinking about include

1. Having multiple duration TWAPs we can switch between for the RAI / USD feed. (1, 3, and 7)
2. Explore alternate ETH / USD oracles besides chainlink.
3. Add an additional backup (3rd) ETH / USD oracle and put all 3 behind a medianizer.

---

<div class="post-metadata">

**Author:** ![goron\_dan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.reflexer.finance/goron_dan/32/261_2.png) [@goron\_dan](https://community.reflexer.finance/u/goron_dan)\
**Post date:** [October 10, 2023, 11:55am UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/2 "2023-10-10T11:55:08Z")

</div>

In regards to getting community feedback, here’s mine: 🤝❤  
The migration to UniV3 from Chainlink would have been expected anyways, I believe it’s time to let Chainlink handle RWAs and use the enhanced Univ3 capabilities.  
So the proposed setup is that oracle contract reads RAI/ETH pool parity and overlays ETH/USD price(fed by Chainlink still untill better options), to get RAI/USD?. Then feeds the GEB system with that data.?  
I learned recently that HAI codebase is modern and clean, so I informally vote for trying this…  
Multiple duration TWAPs are also a pleasant surprise…  
3.What viable options do we have for alternative ETH/USD price action?

---

<div class="post-metadata">

**Author:** ![kyoronut](https://avatars.discourse-cdn.com/v4/letter/k/b487fb/32.png) [@kyoronut](https://community.reflexer.finance/u/kyoronut)\
**Post date:** [October 10, 2023, 1:23pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/3 "2023-10-10T13:23:43Z")

</div>

Will the Uni v3 LP range be full-range?  
What will be the Uni v3 pool fee tier?

---

<div class="post-metadata">

**Author:** ![ghost](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@ghost](https://community.reflexer.finance/u/ghost)\
**Post date:** [October 10, 2023, 1:35pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/4 "2023-10-10T13:35:03Z")

</div>

Good change and good comms.

I’m curious to see what alternatives to the Chainlink ETH/USD oracle people propose.

---

<div class="post-metadata">

**Author:** ![peakaw](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.reflexer.finance/peakaw/32/198_2.png) [@peakaw](https://community.reflexer.finance/u/peakaw)\
**Post date:** [October 10, 2023, 4:29pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/5 "2023-10-10T16:29:33Z")

</div>

We’ve improved the RAI ConverterFeed to create a better combined TWAP when using the ChainlinkTWAP contract and UniV3 TWAP. With these changes, the UniV3 TWAP now exactly matches the timeframe of the Chainlink TWAP.

This is what TAI is using in prod for TAI/USD.

> <https://github.com/money-god/geb-uniswap-median/blob/master/src/UniV3ChainlinkTWAPConverterFeed.sol>

---

<div class="post-metadata">

**Author:** ![piesrtasty](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.reflexer.finance/piesrtasty/32/207_2.png) [@piesrtasty](https://community.reflexer.finance/u/piesrtasty)\
**Post date:** [October 11, 2023, 2:08am UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/6 "2023-10-11T02:08:20Z")

</div>

Yes your understanding of the proposed setup is correct.

In terms of viable alternatives to ETH / USD, we are currently using [Tellor Data Feed | Decentralized Oracle Protocol](https://tellor.io/data-feed/) s a backup so that is a possibility.

Chronicle that powers MKR is launching a new protocol that might be interesting. (See: [https://www.coindesk.com/tech/2023/09/05/multibillion-dollar-oracle-tool-chronicle-to-expand-outside-of-makerdao-ecosystem/](https://www.coindesk.com/tech/2023/09/05/multibillion-dollar-oracle-tool-chronicle-to-expand-outside-of-makerdao-ecosystem/))

We could also use an ETH / DAI or ETH / USDC uni v3 oracle in place of ETH / USD.

Have not extensively explored this yet though. Do you have any suggestions?

---

<div class="post-metadata">

**Author:** ![piesrtasty](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.reflexer.finance/piesrtasty/32/207_2.png) [@piesrtasty](https://community.reflexer.finance/u/piesrtasty)\
**Post date:** [October 11, 2023, 2:09am UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/7 "2023-10-11T02:09:36Z")

</div>

This is awesome! We plan on using this for the oracle migration.

---

<div class="post-metadata">

**Author:** ![piesrtasty](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.reflexer.finance/piesrtasty/32/207_2.png) [@piesrtasty](https://community.reflexer.finance/u/piesrtasty)\
**Post date:** [October 11, 2023, 2:12am UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/8 "2023-10-11T02:12:32Z")

</div>

This has not been finalized yet. Full range would be most resilient to manipulation. Re: fee tier, maybe 0.3% as it’s not a stable since it’s being paired with ETH.

What are you thinking?

---

<div class="post-metadata">

**Author:** ![kyoronut](https://avatars.discourse-cdn.com/v4/letter/k/b487fb/32.png) [@kyoronut](https://community.reflexer.finance/u/kyoronut)\
**Post date:** [October 11, 2023, 1:08pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/9 "2023-10-11T13:08:42Z")

</div>

I second full-range. Regarding the fee tier, I think 0.05% is better. It defines daily minimum activities and the oracle precision. With the current pool size (~$1.2m) and the swap gas cost (~$2.5), an arbitrage trade occurs with a 0.14% (= sqrt{2.5/1.2e6}, see also [https://x.com/kyoronut/status/1629460968815362048?s=20](https://x.com/kyoronut/status/1629460968815362048?s=20) ) price change, which is smaller than 0.3%. When the pool grows to $10m, it occurs with a 0.05% price change.

---

<div class="post-metadata">

**Author:** ![piesrtasty](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.reflexer.finance/piesrtasty/32/207_2.png) [@piesrtasty](https://community.reflexer.finance/u/piesrtasty)\
**Post date:** [October 11, 2023, 6:23pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/10 "2023-10-11T18:23:55Z")

</div>

Very good point, 0.05% makes sense to me.

---

<div class="post-metadata">

**Author:** ![kyoronut](https://avatars.discourse-cdn.com/v4/letter/k/b487fb/32.png) [@kyoronut](https://community.reflexer.finance/u/kyoronut)\
**Post date:** [October 12, 2023, 1:28am UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/11 "2023-10-12T01:28:57Z")

</div>

Just comment. Bribing through Bunni+HiddenHand looks \>2x efficient now. However current DAO’s distro. style (1 month retroactive) doesn’t suit it.

Besides that, just specifying Bunni LP token (ERC20) may make tracking easier for rewarding than UniV3Pos-NFT. It also brings some options like collateral usage, Saviour integration, etc.

---

<div class="post-metadata">

**Author:** ![stonks](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@stonks](https://community.reflexer.finance/u/stonks)\
**Post date:** [October 19, 2023, 10:20pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/12 "2023-10-19T22:20:52Z")

</div>

Has this been finalized? Full-range seems like a bit of a waste. Why not something like +/- 3% of redemption price?

---

<div class="post-metadata">

**Author:** ![piesrtasty](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.reflexer.finance/piesrtasty/32/207_2.png) [@piesrtasty](https://community.reflexer.finance/u/piesrtasty)\
**Post date:** [October 20, 2023, 3:38pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/13 "2023-10-20T15:38:46Z")

</div>

No, this has not been finalized. Definitely open to discussion.

---

<div class="post-metadata">

**Author:** ![stonks](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@stonks](https://community.reflexer.finance/u/stonks)\
**Post date:** [October 20, 2023, 4:40pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/14 "2023-10-20T16:40:12Z")

</div>

I would think a narrow range around the redemption price would be best for countering manipulation and also provide more useful liquidity (plus LP will get much more fees so will encourage more LP’s to join hopefully)

I’m not sure what the best way to determine that narrow range is. Also whether it should be set as a fixed range at the beginning of the month or updated constantly as redemption price changes (more work/gas for LPs and harder to figure out rewards, but could be necessary if redemption price moves too much in a month)

---

<div class="post-metadata">

**Author:** ![piesrtasty](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.reflexer.finance/piesrtasty/32/207_2.png) [@piesrtasty](https://community.reflexer.finance/u/piesrtasty)\
**Post date:** [November 15, 2023, 2:57am UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/15 "2023-11-15T02:57:08Z")

</div>

**Update on incentive changes from uni v2 → uni v3 and oracle migration**

I messed up in the incentives communication and didn’t update the proper label on GitHub incentives info for this period Oct 15 - Nov. 15th. It said RAI / DAI uni v3 was incentivized when it should have said RAI / ETH univ3). Additionally I did not update the RAI incentives table and the actual website.

That being the case I think it’s fair to use the distribution info that was incorrect on GitHub because that was what everyone saw publicly. Doing that would mean the following

Thus to honor what was on Github I propose we use the following incentives structure:

#### **FLX Distribution #32**

This was intended to be 20 FLX / UNI-V2 RAI / ETH and 20 FLX / UNI-V3 RAI / ETH but said UNI-V3 DAI / ETH on GitHub.

**Distribution date:** November 2023  
**Start:** October-15-2023 12:50pm UTC  
**Cutoff-date:** November-15-2023 12:50pm UTC  
**RAI/ETH UNI-V2 LP** : 20 FLX / day  
**RAI/DAI UNI-V3 LP** : 20 FLX / day ( **This is the one I messed up** )

#### **FLX Distribution #33**

**Distribution date:** December 2023  
**Start:** November-15-2023 12:50pm UTC  
**Cutoff-date:** December-15-2023 12:50pm UTC  
**RAI/ETH UNI-V2 LP** : 20 FLX / day  
**RAI/ETH UNI-V3 LP** : 20 FLX / day

#### **FLX Distribution #34**

**Distribution date:** January 2024  
**Start:** December-15-2023 12:50pm UTC  
**Cutoff-date:** January-15-2023 12:50pm UTC  
**RAI/ETH UNI-V2 LP** : 0 FLX / day  
**RAI/ETH UNI-V3 LP** : 30 FLX / day

For the RAI/ETH UNI-V3 LP I propose we use the 0.05% fee tier for the reasons [kyoronut](https://community.reflexer.finance/u/kyoronut) suggested above.

For the range I suggest we do + / - N% around the price of RAI on the start of the distribution period.

So for example if the price of RAI is $2.73 on Nov. 15th then we use the following range.

N = 3%

Lower: 2.6481  
Upper: 2.8119

Please let me know what you all think, especially regarding the fee tier and the LP range.

---

<div class="post-metadata">

**Author:** ![kyoronut](https://avatars.discourse-cdn.com/v4/letter/k/b487fb/32.png) [@kyoronut](https://community.reflexer.finance/u/kyoronut)\
**Post date:** [November 15, 2023, 3:19pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/16 "2023-11-15T15:19:16Z")

</div>

As long as the purpose of the pool is the oracle usage, I think full-range is the only choice.

---

<div class="post-metadata">

**Author:** ![piesrtasty](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.reflexer.finance/piesrtasty/32/207_2.png) [@piesrtasty](https://community.reflexer.finance/u/piesrtasty)\
**Post date:** [November 15, 2023, 7:25pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/17 "2023-11-15T19:25:47Z")

</div>

The primary purpose is indeed oracle usage.

---

<div class="post-metadata">

**Author:** ![0x-kingfish](https://avatars.discourse-cdn.com/v4/letter/0/94ad74/32.png) [@0x-kingfish](https://community.reflexer.finance/u/0x-kingfish)\
**Post date:** [November 16, 2023, 12:57am UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/18 "2023-11-16T00:57:49Z")

</div>

yeah lets go w full-range liquidity. everything else is too complicated and will likely create problems.

---

<div class="post-metadata">

**Author:** ![goron\_dan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.reflexer.finance/goron_dan/32/261_2.png) [@goron\_dan](https://community.reflexer.finance/u/goron_dan)\
**Post date:** [November 16, 2023, 7:59am UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/19 "2023-11-16T07:59:18Z")

</div>

seems legit, oracle usage priority for common interest and stability of protocol  
Regarding a more private interest of LPers, is it worth to start a new thread and get RAI big brains to propose/explore some outside the box ideas?

---

<div class="post-metadata">

**Author:** ![ghost](https://avatars.discourse-cdn.com/v4/letter/g/f04885/32.png) [@ghost](https://community.reflexer.finance/u/ghost)\
**Post date:** [November 16, 2023, 1:27pm UTC](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510/20 "2023-11-16T13:27:06Z")

</div>

If you want not full range liquidity, a contract like this one would have advantages over the original proposal. It’s less “price fixing” and more “avoid incentivizing JIT liquidity providers that don’t help the oracle”.

[https://twitter.com/guil\_lambert/status/1468807040898408449](https://twitter.com/guil_lambert/status/1468807040898408449)

But as others have pointed out, probably makes more sense to go full range.

[Next page](https://community.reflexer.finance/t/oracle-migration-to-uniswap-v3-incentive-adjustments/510.md?page=2)
