Skip to content

Commit

Permalink
add fee recipient for lido tag (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo authored Jun 25, 2024
1 parent 0b84887 commit b60a87c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
21 changes: 11 additions & 10 deletions packages/brain/src/calls/importValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
ROCKET_POOL_FEE_RECIPIENT,
STADER_POOL_FEE_RECIPIENT_MAINNET,
STADER_POOL_FEE_RECIPIENT_PRATER,
LIDO_FEE_RECIPIENT_HOLESKY,
LIDO_FEE_RECIPIENT_MAINNET,
} from "@stakingbrain/common";
import {
reloadValidatorsCron,
Expand Down Expand Up @@ -222,18 +224,17 @@ async function getNonEditableFeeRecipient(
case "stakehouse":
return await new StakeHouseSDK().getLsdFeeRecipient(pubkey);

case "lido":
if (network === "mainnet") return LIDO_FEE_RECIPIENT_MAINNET;
else if (network === "holesky") return LIDO_FEE_RECIPIENT_HOLESKY;

// Stader FR cannot be known in advance
case "stader":
if (suggestedFeeRecipient) {
return suggestedFeeRecipient;

// Set fee recipient to socializing pool adddress if it is not defined
} else {
if (network === "mainnet") {
return STADER_POOL_FEE_RECIPIENT_MAINNET;
} else if (network === "prater") {
return STADER_POOL_FEE_RECIPIENT_PRATER;
}
if (suggestedFeeRecipient) return suggestedFeeRecipient;
// Set fee recipient to socializing pool adddress if it is not defined
else {
if (network === "mainnet") return STADER_POOL_FEE_RECIPIENT_MAINNET;
else if (network === "prater") return STADER_POOL_FEE_RECIPIENT_PRATER;
}
default:
throw new Error("Fee recipient not found for tag: " + tag);
Expand Down
7 changes: 7 additions & 0 deletions packages/common/src/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ export const BURN_ADDRESS = "0x0000000000000000000000000000000000000000";
export const ROCKET_POOL_FEE_RECIPIENT =
"0xd4E96eF8eee8678dBFf4d535E033Ed1a4F7605b7" as const;

// https://docs.lido.fi/deployed-contracts/#core-protocol
export const LIDO_FEE_RECIPIENT_MAINNET =
"0x388C818CA8B9251b393131C08a736A67ccB19297" as const;
// https://docs.lido.fi/deployed-contracts/holesky/#core-protocol
export const LIDO_FEE_RECIPIENT_HOLESKY =
"0xE73a3602b99f1f913e72F8bdcBC235e206794Ac8" as const;

export const STADER_POOL_FEE_RECIPIENT_MAINNET =
"0x9d4C3166c59412CEdBe7d901f5fDe41903a1d6Fc" as const;

Expand Down
4 changes: 3 additions & 1 deletion packages/common/src/types/db/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ export const tags = [
"stakehouse",
"solo",
"stader",
"lido",
] as const;

export const nonEditableFeeRecipientTags = [
"rocketpool",
"stakehouse",
"stader",
"stakewise"
"stakewise",
"lido",
] as const;

export type NonEditableFeeRecipientTag =
Expand Down

0 comments on commit b60a87c

Please sign in to comment.