Skip to content

Commit 773458c

Browse files
committed
Price wOUSD via OUSD (ERC4626 previewRedeem) so Merkl reward APY resolves
1 parent fbe2187 commit 773458c

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/shared/post-processors/exchange-rates/mainnetCurrencies.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const mainnetCurrencies = {
2121
OETH: '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3',
2222
OUSD: '0x2a8e1e676ec238d8a992307b495b45b3feaa5e86',
2323
wOETH: '0xdcee70654261af21c44c093c300ed3bb97b78192',
24+
wOUSD: '0xd2af830e8cbdfed6cc11bab697bb25496ed6fa62',
2425
WETH: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
2526
stETH: '0xae7ab96520de3a18e5e111b5eaab095312d7fe84',
2627
eETH: '0x35fa164735182de50811e8e2e824cfb9b6118ac2',

src/shared/post-processors/exchange-rates/price-routing-mainnet.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ const getPrice_wOETH_OETH = async (ctx: Context, block: Block['header']) => {
190190
return woeth.previewRedeem(1_000_000_000_000_000_000n)
191191
}
192192

193+
// wOUSD is ERC4626-wrapped OUSD; same previewRedeem interface as wOETH (deployed at 14566204).
194+
const getPrice_wOUSD_OUSD = async (ctx: Context, block: Block['header']) => {
195+
if (block.height < 14566204) return 1_000_000_000_000_000_000n
196+
const wousd = new woethAbi.Contract(ctx, { height: block.height }, mainnetCurrencies.wOUSD)
197+
return wousd.previewRedeem(1_000_000_000_000_000_000n)
198+
}
199+
193200
const getPrice_OUSD_ETH = async (ctx: Context, block: Block['header']) => {
194201
const ousdusd = await getPrice_OUSD_USD(ctx, block)
195202
const ethusd = await getChainlinkPrice(ctx, block.height, 'ETH', 'USD')
@@ -267,6 +274,11 @@ export const priceMap: Partial<
267274
...twoWay('ETH', 'rETH', getRETHPrice),
268275
...twoWay('ETH', 'frxETH', getFrxEthPrice),
269276
...twoWay('wOETH', 'OETH', getPrice_wOETH_OETH),
277+
...twoWay('wOUSD', 'OUSD', getPrice_wOUSD_OUSD),
278+
...derived('wOUSD', 'USD', [
279+
{ base: 'wOUSD', quote: 'OUSD' },
280+
{ base: 'OUSD', quote: 'USD' },
281+
]),
270282
...twoWay('OUSD', 'USD', getPrice_OUSD_USD),
271283
...twoWay('OUSD', 'ETH', getPrice_OUSD_ETH),
272284
...twoWay('ETH', 'stETH', (ctx, block) => getOethOraclePrice(ctx, block.height, 'stETH')),

0 commit comments

Comments
 (0)