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

Enable voting 🗳️ #15

Merged
merged 2 commits into from
Apr 17, 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
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<meta name="title" content="Symmetric" />
<meta
name="description"
content="A UI that supports core Symmetric protocol functionality. Explore & create pools, manage liquidity, swap tokens, get vTSYMM and claim incentives."
content="A UI that supports core Symmetric protocol functionality. Explore & create pools, manage liquidity, swap tokens, get vote escrow SYMM and claim incentives."
/>

<!-- Open Graph / Facebook -->
Expand All @@ -33,7 +33,7 @@
<meta property="og:title" content="Symmetric" />
<meta
property="og:description"
content="A UI that supports core Symmetric protocol functionality. Explore & create pools, manage liquidity, swap tokens, get vTSYMM and claim incentives."
content="A UI that supports core Symmetric protocol functionality. Explore & create pools, manage liquidity, swap tokens, get vote escrow SYMM and claim incentives."
/>
<meta
property="og:image"
Expand All @@ -46,7 +46,7 @@
<meta property="twitter:title" content="Symmetric" />
<meta
property="twitter:description"
content="A UI that supports core Symmetric protocol functionality. Explore & create pools, manage liquidity, swap tokens, get vTSYMM and claim incentives."
content="A UI that supports core Symmetric protocol functionality. Explore & create pools, manage liquidity, swap tokens, get vote escrow SYMM and claim incentives."
/>
<meta
property="twitter:image"
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@popperjs/core": "^2.9.2",
"@sentry/browser": "^7.17.4",
"@sentry/tracing": "^7.17.4",
"@symmetric-v3/sdk": "^1.2.16-beta.1",
"@symmetric-v3/sdk": "^1.2.17-beta.1",
"@tanstack/vue-query": "^4.22.0",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/vue": "^7.0.0",
Expand Down
11 changes: 1 addition & 10 deletions src/components/cards/MyWallet/MyWallet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { useI18n } from 'vue-i18n';

import useBreakpoints from '@/composables/useBreakpoints';
import { isMainnet } from '@/composables/useNetwork';
import { configService } from '@/services/config/config.service';
import useWeb3 from '@/services/web3/useWeb3';
import { AnyPool } from '@/services/pool/types';
Expand Down Expand Up @@ -59,10 +58,6 @@ const noNativeCurrencyMessage = computed(() => {
return t('noNativeCurrency', [nativeCurrency, networkName]);
});

const noNativeCurrencyMessageEthereum = computed(() => {
return t('noNativeCurrencyEthereum', [nativeCurrency, networkName]);
});

const noTokensMessage = computed(() => {
return t('noTokensInWallet', [networkName]);
});
Expand Down Expand Up @@ -108,11 +103,7 @@ const emit = defineEmits<{
{{ nativeBalance }} {{ nativeCurrency }}
<BalTooltip
v-if="isWalletReady"
:text="
isMainnet
? noNativeCurrencyMessageEthereum
: noNativeCurrencyMessage
"
:text="noNativeCurrencyMessage"
iconSize="sm"
:iconName="'alert-triangle'"
:iconClass="'text-red-500 hover:text-red-700 dark:hover:text-red-400 transition-colors'"
Expand Down
206 changes: 206 additions & 0 deletions src/components/contextual/pages/vebal/LMVoting/meter-voting-pools.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
import {
GqlChain,
GqlPoolMinimalType,
} from '@/services/api/graphql/generated/api-types';
import { ApiVotingPool } from '@/services/balancer/gauges/gauge-controller.decorator';

/*
Fake voting Pool data to test voting list UI in testnet networks
*/
export function meterVotingPools(network: 'meter'): ApiVotingPool[] {
const USDT_suUSD_USDC: ApiVotingPool = {
chain: network as GqlChain,
id: '0x1ff97abe4c5a4b7ff90949b637e71626bef0dcee000000000000000000000002',
address: '0x1ff97abe4c5a4b7ff90949b637e71626bef0dcee',
type: GqlPoolMinimalType.Stable,
symbol: 'USDT-USDC-suUSD',
tokens: [
{
address: '0x5fa41671c48e3c951afc30816947126ccc8c162e',
weight: null,
symbol: 'USDT.eth',
logoURI:
'https://raw.githubusercontent.com/meterio/token-list/master/generated/token-logos/meter/0x5fa41671c48e3c951afc30816947126ccc8c162e.png',
},
{
address: '0x8bf591eae535f93a242d5a954d3cde648b48a5a8',
weight: null,
symbol: 'suUSD',
logoURI:
'https://raw.githubusercontent.com/meterio/token-list/master/generated/token-logos/meter/0x8bf591eae535f93a242d5a954d3cde648b48a5a8.png',
},
{
address: '0xd86e243fc0007e6226b07c9a50c9d70d78299eb5',
weight: null,
symbol: 'USDC.eth',
logoURI:
'https://raw.githubusercontent.com/meterio/token-list/master/generated/token-logos/meter/0xd86e243fc0007e6226b07c9a50c9d70d78299eb5.png',
},
],
gauge: {
address: '0x59f5a4c2d848c172c88118010019cf9297aacee6',
isKilled: false,
addedTimestamp: 1701860941,
relativeWeightCap: '0.1',
},
};

const USDT_suUSD_USDC_MTRG: ApiVotingPool = {
chain: network as GqlChain,
id: '0xd9fe77653c2b75cf3442c365a3f1f9c7ed1612c7000200000000000000000003',
address: '0xd9fe77653c2b75cf3442c365a3f1f9c7ed1612c7',
type: GqlPoolMinimalType.Weighted,
symbol: '50ETH-50wstMTRG',
tokens: [
{
address: '0x1ff97abe4c5a4b7ff90949b637e71626bef0dcee',
weight: '0.5',
symbol: 'USDT-USDC-suUSD',
logoURI:
'https://raw.githubusercontent.com/centfinance/tokenlists/main/src/assets/images/tokens/0x1ff97abe4c5a4b7ff90949b637e71626bef0dcee.png',
},
{
address: '0x228ebbee999c6a7ad74a6130e81b12f9fe237ba3',
weight: '0.5',
symbol: 'MTRG',
logoURI:
'https://raw.githubusercontent.com/meterio/token-list/master/generated/token-logos/meter/0x228ebbee999c6a7ad74a6130e81b12f9fe237ba3.png',
},
],
gauge: {
address: '0x63f9d4a03a58d1a329a3a1393a9a1e5525eb65a1',
isKilled: false,
addedTimestamp: 1701860941,
relativeWeightCap: '0.1',
},
};

const MST_MTRG: ApiVotingPool = {
chain: network as GqlChain,
id: '0xc4187382305ea2c953f0a164f02b4d27c9957db5000200000000000000000005',
address: '0xc4187382305ea2c953f0a164f02b4d27c9957db5',
type: GqlPoolMinimalType.Weighted,
symbol: '50MTRG-50MST',
tokens: [
{
address: '0x5647f6cc997e45b81d786baa9ecd8a1ad40ef25f',
weight: '0.5',
symbol: 'MST',
logoURI:
'https://raw.githubusercontent.com/meterio/token-list/master/generated/token-logos/meter/0x5647f6cc997e45b81d786baa9ecd8a1ad40ef25f.png',
},
{
address: '0x228ebbee999c6a7ad74a6130e81b12f9fe237ba3',
weight: '0.5',
symbol: 'MTRG',
logoURI:
'https://raw.githubusercontent.com/meterio/token-list/master/generated/token-logos/meter/0x228ebbee999c6a7ad74a6130e81b12f9fe237ba3.png',
},
],
gauge: {
address: '0xedf47a2de3adf4a0d91864e1b9d377b46c8172dc',
isKilled: false,
addedTimestamp: 1701860941,
relativeWeightCap: '0.1',
},
};

const ETH_wstMTRG: ApiVotingPool = {
chain: network as GqlChain,
id: '0x6e1be32644975613212db00bb9762fb6755ab921000200000000000000000007',
address: '0x6e1be32644975613212db00bb9762fb6755ab921',
type: GqlPoolMinimalType.Weighted,
symbol: '50ETH-50wstMTRG',
tokens: [
{
address: '0x983147fb73a45fc7f8b4dfa1cd61bdc7b111e5b6',
weight: '0.5',
symbol: 'ETH',
logoURI:
'https://raw.githubusercontent.com/meterio/token-list/master/generated/token-logos/meter/0x983147fb73a45fc7f8b4dfa1cd61bdc7b111e5b6.png',
},
{
address: '0xe2de616fbd8cb9180b26fcfb1b761a232fe56717',
weight: '0.5',
symbol: 'wstMTRG',
logoURI:
'https://raw.githubusercontent.com/meterio/token-list/master/generated/token-logos/meter/0xe2de616fbd8cb9180b26fcfb1b761a232fe56717.png',
},
],
gauge: {
address: '0x8be2035d45f31b9827af789f6d4f8ce460372b2c',
isKilled: false,
addedTimestamp: 1701860941,
relativeWeightCap: '0.1',
},
};

const MTRG_wstMTRG: ApiVotingPool = {
chain: network as GqlChain,
id: '0x2077a828fd58025655335a8756dbcfeb7e5bec46000000000000000000000008',
address: '0x2077a828fd58025655335a8756dbcfeb7e5bec46',
type: GqlPoolMinimalType.Stable,
symbol: 'MTRG-wstMTRG',
tokens: [
{
address: '0x228ebbee999c6a7ad74a6130e81b12f9fe237ba3',
weight: 'null',
symbol: 'MTRG',
logoURI:
'https://raw.githubusercontent.com/meterio/token-list/master/generated/token-logos/meter/0x228ebbee999c6a7ad74a6130e81b12f9fe237ba3.png',
},
{
address: '0xe2de616fbd8cb9180b26fcfb1b761a232fe56717',
weight: 'null',
symbol: 'wstMTRG',
logoURI:
'https://raw.githubusercontent.com/meterio/token-list/master/generated/token-logos/meter/0xe2de616fbd8cb9180b26fcfb1b761a232fe56717.png',
},
],
gauge: {
address: '0x0e533ff0486f8372096e889efdf71b323ed4f545',
isKilled: false,
addedTimestamp: 1701860941,
relativeWeightCap: '0.1',
},
};

const MSYMM_wstMTRG: ApiVotingPool = {
chain: network as GqlChain,
id: '0xabbcd1249510a6afb5d1e6d055bf86637e7dad63000200000000000000000009',
address: '0xabbcd1249510a6afb5d1e6d055bf86637e7dad63',
type: GqlPoolMinimalType.Weighted,
symbol: '80mSYMM-20wstMTRG',
tokens: [
{
address: '0x663345e09f4f4437f3d5df39ba5c2b5690532206',
weight: '0.8',
symbol: 'mSYMM',
logoURI:
'https://raw.githubusercontent.com/centfinance/tokenlists/main/src/assets/images/tokens/mSYMM.png',
},
{
address: '0xe2de616fbd8cb9180b26fcfb1b761a232fe56717',
weight: '0.2',
symbol: 'wstMTRG',
logoURI:
'https://raw.githubusercontent.com/meterio/token-list/master/generated/token-logos/meter/0xe2de616fbd8cb9180b26fcfb1b761a232fe56717.png',
},
],
gauge: {
address: '0x2b61c7b6b0bd087043d822c35d8f7d28d6ce0b4b',
isKilled: false,
addedTimestamp: 1701860941,
relativeWeightCap: '1.0',
},
};

return [
USDT_suUSD_USDC,
USDT_suUSD_USDC_MTRG,
MST_MTRG,
ETH_wstMTRG,
MTRG_wstMTRG,
MSYMM_wstMTRG,
];
}
2 changes: 1 addition & 1 deletion src/composables/queries/useVotingEscrowQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function useVotingEscrowLocksQuery(
return false;
}

if (networkId === Network.MAINNET) {
if (networkId === Network.TELOS || networkId === Network.METER) {
return true;
}

Expand Down
6 changes: 5 additions & 1 deletion src/composables/queries/useVotingPoolsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import {
VotingPoolWithVotes,
} from '@/services/balancer/gauges/gauge-controller.decorator';
import useWeb3 from '@/services/web3/useWeb3';
import { isTestnet, isMainnet } from '@/composables/useNetwork';
import { isTestnet, isMainnet, isMeter } from '@/composables/useNetwork';
import { VeBalGetVotingListQuery } from '@/services/api/graphql/generated/api-types';
import { Network } from '@/lib/config/types';
import { PoolType } from '@/services/pool/types';
import {
telosVotingPools,
testnetVotingPools,
} from '@/components/contextual/pages/vebal/LMVoting/testnet-voting-pools';
import { meterVotingPools } from '@/components/contextual/pages/vebal/LMVoting/meter-voting-pools';
import { mapApiChain, mapApiPoolType } from '@/services/api/graphql/mappers';

/**
Expand Down Expand Up @@ -54,10 +55,13 @@ export default function useVotingPoolsQuery(
const queryFn = async (): Promise<VotingPool[]> => {
try {
let apiVotingPools: ApiVotingPools;
console.log(isMeter.value);
if (isTestnet.value) {
apiVotingPools = testnetVotingPools('GOERLI');
} else if (isMainnet.value) {
apiVotingPools = telosVotingPools('telos');
} else if (isMeter.value) {
apiVotingPools = meterVotingPools('meter');
} else {
const api = getApi();
console.log(api);
Expand Down
1 change: 1 addition & 0 deletions src/composables/useNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const isMainnet = computed(
networkId.value === Network.TELOS ||
networkId.value === Network.TELOSTESTNET
);
export const isMeter = computed(() => networkId.value === Network.METER);
export const isPolygon = computed(() => networkId.value === Network.POLYGON);
export const isZkevm = computed(() => networkId.value === Network.ZKEVM);
export const isOptimism = computed(() => networkId.value === Network.OPTIMISM);
Expand Down
3 changes: 1 addition & 2 deletions src/constants/pools.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { isMainnet } from '@/composables/useNetwork';
import { Pools } from '@/types/pools';
import { configService } from '@/services/config/config.service';

export const MIN_FIAT_VALUE_POOL_MIGRATION = isMainnet.value ? 100_000 : 1; // 100K USD or $1 for other networks
export const MIN_FIAT_VALUE_POOL_MIGRATION = 1; // 100K USD or $1 for other networks

// Do not display APR values greater than this amount; they are likely to be nonsensical
// These can arise from pools with extremely low balances (e.g., completed LBPs)
Expand Down
10 changes: 5 additions & 5 deletions src/lib/config/meter/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ const contracts: Contracts = {
balancerQueries: meter.BalancerQueries,
batchRelayer: meter.BalancerRelayer,
veBAL: meter.VotingEscrow,
gaugeController: '',
gaugeFactory: '',
balancerMinter: '',
tokenAdmin: '',
veDelegationProxy: '',
gaugeController: meter.GaugeController,
gaugeFactory: meter.LiquidityGaugeFactory,
balancerMinter: meter.BalancerMinter,
tokenAdmin: meter.MSYMMTokenAdmin,
veDelegationProxy: meter.VotingEscrowDelegationProxy,
veBALHelpers: '',
feeDistributor: '',
feeDistributorDeprecated: '',
Expand Down
3 changes: 2 additions & 1 deletion src/lib/config/meter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const config: Config = {
'https://graph-meter.voltswap.finance/subgraphs/name/symmetric-meter',
],
aave: '',
gauge: '',
gauge:
'https://graph-meter.voltswap.finance/subgraphs/name/symmetric-meter-gauges',
blocks: '',
},
bridgeUrl: 'https://passport.meter.io/',
Expand Down
Loading
Loading