Skip to content

Commit

Permalink
fix wrong pool and missing pool
Browse files Browse the repository at this point in the history
  • Loading branch information
t0rbik committed Dec 19, 2024
1 parent b29762d commit 740b8ab
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/lib/config/farms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,18 @@ export const STATIC_EXTERNAL_FARMS = {
},
],
},
{
symbol: "alETH-pxETH",
icon: "velodrome.svg",
collabicon: "",
name: "Velodrome",
actions: [
{
label: "Manage",
url: "https://velo.drome.eth.limo/deposit?token0=0x300d2c875C6fb8Ce4bf5480B4d34b7c9ea8a33A4&token1=0x3E29D3A9316dAB217754d13b28646B76607c5f04&type=0&factory=0xF1046053aa5682b4F9a81b5481394DA16BE5FF5a&chain=10",
},
],
},
{
symbol: "alETH-OP",
icon: "velodrome.svg",
Expand Down
20 changes: 17 additions & 3 deletions src/lib/queries/farms/useExternalFarmsAprs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ export const useOpExternalFarmsAprs = () => {
const opPrice = ethPriceData.coins["coingecko:optimism"].price;
const veloPrice = ethPriceData.coins["coingecko:velodrome-finance"].price;

const [pool0, pool1, pool2, pool3, pool4, pool5, pool6] =
const [pool0, pool1, pool2, pool3, pool4, pool5, pool6, pool7] =
await publicClient.multicall({
allowFailure: false,
contracts: [
{
address: "0x5b29e481f663ec2857487567E1383CBdE83fa2f1",
abi: veloStatsAbi,
functionName: "byIndex",
args: [31n],
args: [667n],
},
{
address: "0x5b29e481f663ec2857487567E1383CBdE83fa2f1",
Expand Down Expand Up @@ -205,6 +205,12 @@ export const useOpExternalFarmsAprs = () => {
functionName: "byIndex",
args: [5n],
},
{
address: "0x5b29e481f663ec2857487567E1383CBdE83fa2f1",
abi: veloStatsAbi,
functionName: "byIndex",
args: [909n],
},
{
address: "0x5b29e481f663ec2857487567E1383CBdE83fa2f1",
abi: veloStatsAbi,
Expand Down Expand Up @@ -257,8 +263,15 @@ export const useOpExternalFarmsAprs = () => {
ethPrice,
opPrice,
}),
"Velodrome alETH-OP": calculateVeloApr({
"Velodrome alETH-pxETH": calculateVeloApr({
pool: pool6,
poolSymbol: "sAMMV2-pxETH/alETH",
veloPrice,
ethPrice,
opPrice,
}),
"Velodrome alETH-OP": calculateVeloApr({
pool: pool7,
poolSymbol: "vAMMV2-alETH/OP",
veloPrice,
ethPrice,
Expand Down Expand Up @@ -297,6 +310,7 @@ const calculateVeloApr = ({
+formatEther(pool.emissions) * SECONDS_IN_A_YEAR * veloPrice;

const [token0, token1] = poolSymbol.split("-")[1].split("/");

const price0 = token0.includes("ETH")
? ethPrice
: token0 === "OP"
Expand Down

0 comments on commit 740b8ab

Please sign in to comment.