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

Ve activation #12

Merged
merged 2 commits into from
Dec 6, 2023
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
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 @@ -75,7 +75,7 @@
"@popperjs/core": "^2.9.2",
"@sentry/browser": "^7.17.4",
"@sentry/tracing": "^7.17.4",
"@symmetric-v3/sdk": "^1.2.0-beta.1",
"@symmetric-v3/sdk": "^1.2.4-beta.1",
"@tanstack/vue-query": "^4.22.0",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/vue": "^7.0.0",
Expand Down
9 changes: 9 additions & 0 deletions src/assets/data/contracts/telos.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
"Authorizer": "0x00EDdD9621Fb08436d0331c149D1690909a5906d",
"AuthorizerAdaptor": "0xAF27669B65161ef323B2Ec8314ddF30e8d51c4a8",
"BalancerHelpers": "0xc2a0d530e57B1275fbce908031DA636f95EA1E38",
"BalancerMinter": "0xbb3c49aD5Acea9B3E1145DfC6F4Ed20f2224a14F",
"BalancerQueries": "0x1b13728ea3C90863990aC0e05987CfeC1888908c",
"BalancerRelayer": "0x12b89478C9ab7C38579Cfbb90CD3afb40d2762e2",
"BatchRelayerLibrary": "0x698fEa3Aa7DBD323D8D896993fD1EC556D308615",
"CircuitBreakerLib": "0xfff23CDf2e98b6ea6f0ae856e8DeF6Fdb3141dF1",
"ComposableStablePoolFactory": "0x98add7DC34a382e188be709a72Ca8fCDF7e548db",
"ExternalWeightedMath": "0x2320243925EBb4616F4a95319f83cdbEA63bF1a1",
"FeeDistributor": "0x75d71288F0181a5c1C9f8c81755846954C37433A",
"GaugeController": "0x7ac8CF03C7c48d1E1eEB2Cb2B3A50B1B1430ae7b",
"LiquidityGaugeFactory": "0x2564fA7CaFe82c527Ee788265FD4Dc863F65D2D1",
"LiquidityGaugeV5": "0xea04bB2254b7Eee6547F963c2D56C06d50e3A8eB",
"ManagedPoolAddRemoveTokenLib": "0x4fE18fde71267c46d6DDeecc412cd498e88b39Cb",
"ManagedPoolAmmLib": "0x611b8E5c7ec8ee0c7bD5f2B6E9DfD44fbED8A427",
"ManagedPoolFactory": "0x4eD870363d69F0f2c565332342eFC68ca82b544b",
Expand All @@ -21,10 +25,15 @@
"ProtocolFeePercentagesProvider": "0x4e4131dC27ed9501ac5fEb76F94572fDAe9f0fD0",
"ProtocolFeesCollector": "0x61497C44c7Cb9C3eab99Ef20f58863414A5665d2",
"RecoveryModeHelper": "0x45a2992e1bFdCF9b9AcE0a84A238f2E56F481816",
"SingleRecipientGauge": "0xc0A740cDd1C647d9c77367E47f0D0c253140E6e3",
"SingleRecipientGaugeFactory": "0xa025369dfC8280CC7e88451a0fbe33fE7138eD31",
"SmartWalletChecker": "0x434a833edbe4A88AD48ddf99e72ed4b148960B6E",
"SymmToken": "0xd5f2a24199C3DFc44C1Bf8B1C01aB147809434Ca",
"TestBalancerToken": "0xFEF39453770fF2C6b2F453D1b6D075623a79e3Eb",
"TSYMMTokenAdmin": "0x48Bd633f4B9128a38Ebb4a48b6975EB3Eaf1931b",
"Vault": "0xbccc4b4c6530F82FE309c5E845E50b5E9C89f2AD",
"VotingEscrow": "0x0D0b7efc6e20b96841f37b28219a595a81c4615A",
"VotingEscrowDelegation": "0x10F85b7322B6A150844DA4e422FdC1a251734de8",
"VotingEscrowDelegationProxy": "0x3152246f3CD4dD465292Dd4Ffd792E2Cf602e332",
"WeightedPoolFactory": "0xdd58D43a829067129B8C37f1924D31B1896ac0C6"
}
185 changes: 159 additions & 26 deletions src/components/contextual/pages/vebal/LMVoting/testnet-voting-pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,189 @@ import { ApiVotingPool } from '@/services/balancer/gauges/gauge-controller.decor
export function testnetVotingPools(
testnet: 'SEPOLIA' | 'GOERLI'
): ApiVotingPool[] {
const veBal: ApiVotingPool = {
const STLOS_WTLOS: ApiVotingPool = {
chain: testnet as GqlChain,
id: '0xf8a0623ab66f985effc1c69d05f1af4badb01b00000200000000000000000060',
address: '0xf8a0623ab66F985EfFc1C69D05F1af4BaDB01b00',
id: '0x9a77bd2edbbb68173275cda967b76e9213949ace000000000000000000000008',
address: '0x9A77BD2edbBB68173275Cda967B76E9213949aCe',
type: GqlPoolMinimalType.Stable,
symbol: 'vTSYMM',
symbol: 'STLOS-WTLOS',
tokens: [
{
address: '0x33A99Dcc4C85C014cf12626959111D5898bbCAbF',
address: '0xB4B01216a5Bc8F1C8A33CD990A1239030E60C90',
weight: null,
symbol: 'vTSYMM',
symbol: 'STLOS',
logoURI:
'https://raw.githubusercontent.com/balancer/assets/master/assets/0x5c6ee304399dbdb9c8ef030ab642b10820db8f56.png',
'https://raw.githubusercontent.com/telosnetwork/token-list/main/logos/stlos.png',
},
{
address: '0xD102cE6A4dB07D247fcc28F366A623Df0938CA9E',
weight: null,
symbol: 'WTLOS',
logoURI:
'https://raw.githubusercontent.com/telosnetwork/token-list/main/logos/telos.png',
},
],
gauge: {
address: '0xec678e92afe25bc5ba4bc2e1ff386c775270e49e',
isKilled: false,
addedTimestamp: 1701860941,
relativeWeightCap: '0.2',
},
};

const USDC_USDT: ApiVotingPool = {
chain: testnet as GqlChain,
id: '0x058d4893efa235d86cceed5a7eef0809b76c8c66000000000000000000000004',
address: '0x058d4893efa235d86cceed5a7eef0809b76c8c66',
type: GqlPoolMinimalType.Stable,
symbol: 'USDC-USDT',
tokens: [
{
address: '0x8D97Cea50351Fb4329d591682b148D43a0C3611b',
weight: null,
symbol: 'USDC',
logoURI:
'https://assets-cdn.trustwallet.com/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png',
},
{
address: '0x975Ed13fa16857E83e7C493C7741D556eaaD4A3f',
weight: null,
symbol: 'USDT',
logoURI:
'https://assets-cdn.trustwallet.com/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png',
},
],
gauge: {
address: '0xe4c412962fab7f2d406c43a8da95c68f9d60f24e',
isKilled: false,
addedTimestamp: 1701860941,
relativeWeightCap: '0.2',
},
};

const WTLOS_USDT: ApiVotingPool = {
chain: testnet as GqlChain,
id: '0x2d714951f7165a51e8bd61f92d8a979ab0ed4b59000200000000000000000006',
address: '0x2d714951f7165a51e8bd61f92d8a979ab0ed4b59',
type: GqlPoolMinimalType.Weighted,
symbol: '20USDT-80WTLOS',
tokens: [
{
address: '0xD102cE6A4dB07D247fcc28F366A623Df0938CA9E',
weight: '0.8',
symbol: 'WTLOS',
logoURI:
'https://raw.githubusercontent.com/telosnetwork/token-list/main/logos/telos.png',
},
{
address: '0x975Ed13fa16857E83e7C493C7741D556eaaD4A3f',
weight: '0.2',
symbol: 'USDT',
logoURI:
'https://assets-cdn.trustwallet.com/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png',
},
],
gauge: {
address: '0xa9d436ab58989354a5c3705f24a5130779055e47',
isKilled: false,
relativeWeightCap: '0.6',
addedTimestamp: 1701860941,
},
};

return [STLOS_WTLOS, USDC_USDT, WTLOS_USDT];
}

export function telosVotingPools(testnet: 'telos'): ApiVotingPool[] {
const STLOS_WTLOS: ApiVotingPool = {
chain: testnet as GqlChain,
id: '0x9a77bd2edbbb68173275cda967b76e9213949ace000000000000000000000008',
address: '0x9A77BD2edbBB68173275Cda967B76E9213949aCe',
type: GqlPoolMinimalType.Stable,
symbol: 'STLOS-WTLOS',
tokens: [
{
address: '0xB4B01216a5Bc8F1C8A33CD990A1239030E60C905',
weight: null,
symbol: 'STLOS',
logoURI:
'https://raw.githubusercontent.com/telosnetwork/token-list/main/logos/stlos.png',
},
{
address: '0xD102cE6A4dB07D247fcc28F366A623Df0938CA9E',
weight: null,
symbol: 'WTLOS',
logoURI:
'https://raw.githubusercontent.com/telosnetwork/token-list/main/logos/telos.png',
},
],
gauge: {
address: '0xF2ca6F8961e91F1ee0D688F9926183314D866f1E',
address: '0xec678e92afe25bc5ba4bc2e1ff386c775270e49e',
isKilled: false,
addedTimestamp: 1654312627,
relativeWeightCap: null,
addedTimestamp: 1701860941,
relativeWeightCap: '0.2',
},
};

const weightedPool: ApiVotingPool = {
const USDC_USDT: ApiVotingPool = {
chain: testnet as GqlChain,
id: '0x16faf9f73748013155b7bc116a3008b57332d1e600020000000000000000005b',
address: '0x16faF9f73748013155B7bC116a3008b57332D1e6',
id: '0x058d4893efa235d86cceed5a7eef0809b76c8c66000000000000000000000004',
address: '0x058d4893efa235d86cceed5a7eef0809b76c8c66',
type: GqlPoolMinimalType.Stable,
symbol: 'USDC-USDT',
tokens: [
{
address: '0x8D97Cea50351Fb4329d591682b148D43a0C3611b',
weight: null,
symbol: 'USDC',
logoURI:
'https://assets-cdn.trustwallet.com/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png',
},
{
address: '0x975Ed13fa16857E83e7C493C7741D556eaaD4A3f',
weight: null,
symbol: 'USDT',
logoURI:
'https://assets-cdn.trustwallet.com/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png',
},
],
gauge: {
address: '0xe4c412962fab7f2d406c43a8da95c68f9d60f24e',
isKilled: false,
addedTimestamp: 1701860941,
relativeWeightCap: '0.2',
},
};

const WTLOS_USDT: ApiVotingPool = {
chain: testnet as GqlChain,
id: '0x2d714951f7165a51e8bd61f92d8a979ab0ed4b59000200000000000000000006',
address: '0x2d714951f7165a51e8bd61f92d8a979ab0ed4b59',
type: GqlPoolMinimalType.Weighted,
symbol: 'B-50WBTC-50WETH',
symbol: '20USDT-80WTLOS',
tokens: [
{
address: '0x37f03a12241E9FD3658ad6777d289c3fb8512Bc9',
weight: '0.5',
symbol: 'WBTC',
logoURI: '',
address: '0xD102cE6A4dB07D247fcc28F366A623Df0938CA9E',
weight: '0.8',
symbol: 'WTLOS',
logoURI:
'https://raw.githubusercontent.com/telosnetwork/token-list/main/logos/telos.png',
},
{
address: '0xdFCeA9088c8A88A76FF74892C1457C17dfeef9C1',
weight: '0.5',
symbol: 'WETH',
logoURI: '',
address: '0x975Ed13fa16857E83e7C493C7741D556eaaD4A3f',
weight: '0.2',
symbol: 'USDT',
logoURI:
'https://assets-cdn.trustwallet.com/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png',
},
],
gauge: {
address: '0xf0f572ad66baacDd07d8c7ea3e0E5EFA56a76081',
address: '0xa9d436ab58989354a5c3705f24a5130779055e47',
isKilled: false,
relativeWeightCap: null,
addedTimestamp: 1654312702,
relativeWeightCap: '0.6',
addedTimestamp: 1701860941,
},
};

return [veBal, weightedPool];
return [STLOS_WTLOS, USDC_USDT, WTLOS_USDT];
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ onUnmounted(() => resetTxState());
<div class="p-3 -mt-2">
Your vote directs liquidity mining emissions for the future periods
starting next Thursday at 0:00 UTC. Voting power is set at the time
of a vote. If you get more veBAL later, resubmit your vote to use
of a vote. If you get more vtSYMM later, resubmit your vote to use
your increased power. Votes are timelocked for 10 days. If you vote
now, no edits can be made until {{ voteLockedUntilText() }}.
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const { handleFailed, handleSuccess, txState, votingActions } =
block
class="mt-2"
>
Return to veBAL list
Return to vtSYMM list
</BalBtn>
</div>
</transition>
Expand Down
2 changes: 1 addition & 1 deletion src/components/navs/AppNav/AppSidebar/SidebarContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const navLinks = [
label: t('claim'),
path: `/${networkSlug}/claim`,
goal: Goals.ClickNavClaim,
hide: true,
hide: !isVeBalSupported,
},
{
label: t('portfolio'),
Expand Down
11 changes: 5 additions & 6 deletions src/composables/queries/useProtocolRewardsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ type QueryOptions = UseQueryOptions<ProtocolRewardsQueryResponse>;
/**
* SERVICES
*/
const feeDistributorV1 = new FeeDistributor(
configService.network.addresses.feeDistributorDeprecated
);
// const feeDistributorV1 = new FeeDistributor(
// configService.network.addresses.feeDistributorDeprecated
// );
const feeDistributorV2 = new FeeDistributor(
configService.network.addresses.feeDistributor
);
Expand Down Expand Up @@ -64,11 +64,10 @@ export default function useProtocolRewardsQuery(options: QueryOptions = {}) {
*/
const queryFn = async () => {
try {
const [v1, v2] = await Promise.all([
feeDistributorV1.getClaimableBalances(account.value),
const [v2] = await Promise.all([
feeDistributorV2.getClaimableBalances(account.value),
]);
return { v1, v2 };
return { v2 };
} catch (error) {
console.error('Failed to fetch claimable protocol balances', error);
return {};
Expand Down
13 changes: 10 additions & 3 deletions src/composables/queries/useVotingPoolsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import {
VotingPoolWithVotes,
} from '@/services/balancer/gauges/gauge-controller.decorator';
import useWeb3 from '@/services/web3/useWeb3';
import { isTestnet } from '@/composables/useNetwork';
import { isTestnet, isMainnet } 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 { testnetVotingPools } from '@/components/contextual/pages/vebal/LMVoting/testnet-voting-pools';
import {
telosVotingPools,
testnetVotingPools,
} from '@/components/contextual/pages/vebal/LMVoting/testnet-voting-pools';
import { mapApiChain, mapApiPoolType } from '@/services/api/graphql/mappers';

/**
Expand Down Expand Up @@ -53,12 +56,16 @@ export default function useVotingPoolsQuery(
let apiVotingPools: ApiVotingPools;
if (isTestnet.value) {
apiVotingPools = testnetVotingPools('GOERLI');
} else if (isMainnet.value) {
apiVotingPools = telosVotingPools('telos');
} else {
const api = getApi();
console.log(api);
const { veBalGetVotingList } = await api.VeBalGetVotingList();
console.log(veBalGetVotingList);
apiVotingPools = veBalGetVotingList;
}

console.log(apiVotingPools);
const pools = await new GaugeControllerDecorator().decorateWithVotes(
apiVotingPools,
account.value
Expand Down
Loading
Loading