Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add reserve rebalancing address #122

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/addresses.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const wallets = {
CUSTODIAN_ETH: "0x26ac3A7b8a675b741560098fff54F94909bE5E73",
ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1:
"0x13a9803d547332c81Ebc6060F739821264DBcf1E",
RESERVE_REBALANCING_ADDRESS: "0xDA7BFEF937F0944551a24b4C68B054bfA7127570",
};

const tokensAddresses = {
Expand Down Expand Up @@ -121,11 +122,12 @@ export type ReserveCrypto =
const ADDRESSES: ReserveCrypto[] = [
{
assetType: AssetType.ERC20,
label: "Operational Multisig on Celo",
label: "USDC Axelar Celo",
token: "USDC",
addresses: [
RESERVE_MULTISIG_CELO,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: USDC_AXELAR_ADDRESS,
network: Network.CELO,
Expand All @@ -150,6 +152,7 @@ const ADDRESSES: ReserveCrypto[] = [
addresses: [
wallets.RESERVE_MULTISIG_ETH,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: tokensAddresses.SAVINGS_DAI,
network: Network.ETH,
Expand All @@ -162,6 +165,7 @@ const ADDRESSES: ReserveCrypto[] = [
addresses: [
CURVE_FACTORY_POOL_ADDRESS,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
network: Network.CELO,
shouldDisplay: true,
Expand All @@ -174,6 +178,7 @@ const ADDRESSES: ReserveCrypto[] = [
addresses: [
RESERVE_MULTISIG_CELO,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: tokensAddresses.GLO_ON_CELO,
network: Network.CELO,
Expand All @@ -189,6 +194,7 @@ const ADDRESSES: ReserveCrypto[] = [
wallets.CUSTODIAN_ETH,
wallets.RESERVE_MULTISIG_ETH,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
network: Network.ETH,
shouldDisplay: false,
Expand All @@ -201,6 +207,7 @@ const ADDRESSES: ReserveCrypto[] = [
"0x16B34Ce9A6a6F7FC2DD25Ba59bf7308E7B38E186",
wallets.RESERVE_MULTISIG_ETH,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: "0x6b175474e89094c44da98b954eedeac495271d0f",
decimals: 18,
Expand All @@ -216,6 +223,7 @@ const ADDRESSES: ReserveCrypto[] = [
wallets.RESERVE_MULTISIG_ETH,
wallets.CUSTODIAN_ETH,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
network: Network.ETH,
Expand All @@ -230,6 +238,7 @@ const ADDRESSES: ReserveCrypto[] = [
wallets.RESERVE_MULTISIG_ETH,
wallets.CUSTODIAN_ETH,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
network: Network.ETH,
Expand All @@ -243,6 +252,7 @@ const ADDRESSES: ReserveCrypto[] = [
wallets.RESERVE_MULTISIG_ETH,
wallets.CUSTODIAN_ETH,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: tokensAddresses.WETH_ON_ETH,
network: Network.ETH,
Expand All @@ -258,6 +268,7 @@ const ADDRESSES: ReserveCrypto[] = [
wallets.CUSTODIAN_ETH,
wallets.RESERVE_MULTISIG_ETH,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: tokensAddresses.WBTC_ON_ETH,
network: Network.ETH,
Expand All @@ -272,6 +283,7 @@ const ADDRESSES: ReserveCrypto[] = [
addresses: [
RESERVE_MULTISIG_CELO,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: tokensAddresses.STEUR_ON_CELO,
network: Network.CELO,
Expand All @@ -285,6 +297,7 @@ const ADDRESSES: ReserveCrypto[] = [
addresses: [
wallets.RESERVE_MULTISIG_ETH,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: tokensAddresses.LIDO_STAKED_ETH,
network: Network.ETH,
Expand All @@ -299,11 +312,25 @@ const ADDRESSES: ReserveCrypto[] = [
RESERVE_MULTISIG_CELO,
RESERVE_ADDRESS,
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: tokensAddresses.USDT_ON_CELO,
network: Network.CELO,
shouldDisplay: false,
},
{
assetType: AssetType.ERC20,
label: "USDC Celo Native",
token: "nativeUSDC",
decimals: 6,
addresses: [
wallets.ALTERNATE_RESERVE_HOLDINGS_ADDRESS_1,
wallets.RESERVE_REBALANCING_ADDRESS,
],
tokenAddress: USDC_CELO_NATIVE_ADDRESS,
network: Network.CELO,
shouldDisplay: false,
},
];
// WHEN Adding new TOKENS also update the TokenColor enum in PieChart.tsx

Expand Down
1 change: 1 addition & 0 deletions src/service/Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type Tokens =
| "ETH"
| "cMCO2"
| "USDC"
| "nativeUSDC"
| "EUROC"
| "WBTC"
| "WETH"
Expand Down
3 changes: 3 additions & 0 deletions src/service/holdings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export async function getHoldingsOther() {
ethHeld,
daiHeld,
usdcHeld,
usdcHeldCelo,
eurocHeld,
wethHeld,
wbtcHeld,
Expand All @@ -272,6 +273,7 @@ export async function getHoldingsOther() {
ethBalance(),
erc20Balance("DAI", Network.ETH),
erc20Balance("USDC", Network.ETH),
erc20Balance("nativeUSDC", Network.CELO),
erc20Balance("EUROC", Network.ETH),
erc20Balance("WETH", Network.ETH),
erc20Balance("WBTC", Network.ETH),
Expand Down Expand Up @@ -307,6 +309,7 @@ export async function getHoldingsOther() {
btcHeld.value += wbtcHeld.value;
ethHeld.value += wethHeld.value;

usdcHeld.value += usdcHeldCelo.value;
usdcHeld.value += valueOrThrow(await getCurvePoolUSDC());
usdcHeld.value += valueOrThrow(await multisigUSDC());
usdcHeld.value += valueOrThrow(await reserveUSDC());
Expand Down
Loading