Skip to content

Commit

Permalink
add uniETH to lsdhandler
Browse files Browse the repository at this point in the history
  • Loading branch information
slasher125 committed Dec 7, 2023
1 parent 749d52e commit 62ce642
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/handlers/triggerLSDRates.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ const lsdTokens = [
type: a,
fee: 0.1,
},
{
name: 'Bedrock uniETH',
symbol: 'uniETH',
address: '0xF1376bceF0f78459C0Ed0ba5ddce976F1ddF51F4',
addressExchangeRate: '0x4beFa2aA9c305238AA3E0b5D17eB20C045269E9d',
type: a,
// fee: 0.1,
},
];

const priceUrl = 'https://api.0x.org/swap/v1/quote';
Expand Down Expand Up @@ -310,6 +318,14 @@ const getExpectedRates = async () => {
type: 'function',
};

const uniETHAbi = {
inputs: [],
name: 'exchangeRatio',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
};

// --- cbETH
const cbETHRate = Number((await axios.get(cbETHRateUrl)).data.amount);

Expand Down Expand Up @@ -440,6 +456,16 @@ const getExpectedRates = async () => {
})
).output / 1e18;

const uniETH =
(
await sdk.api.abi.call({
target: lsdTokens.find((lsd) => lsd.name === 'Bedrock uniETH')
.addressExchangeRate,
chain: 'ethereum',
abi: uniETHAbi,
})
).output / 1e18;

return lsdTokens.map((lsd) => ({
...lsd,
expectedRate:
Expand Down Expand Up @@ -467,6 +493,8 @@ const getExpectedRates = async () => {
? ETHx
: lsd.name === 'NodeDAO'
? nETH
: lsd.name === 'Bedrock uniETH'
? uniETH
: 1,
}));
};

0 comments on commit 62ce642

Please sign in to comment.