Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/curvy-games-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'backend': patch
---

remove provider from config
7 changes: 0 additions & 7 deletions apps/api/gql/resolvers/beets.resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ const beetsResolvers: Resolvers = {
},
},
Mutation: {
beetsSyncFbeetsRatio: async (parent, {}, context) => {
isAdminRoute(context);

await beetsService.syncFbeetsRatio();

return 'success';
},
beetsPoolLoadReliquarySnapshotsForAllFarms: async (parent, { chain }, context) => {
isAdminRoute(context);

Expand Down
2 changes: 0 additions & 2 deletions apps/api/gql/schema/beets.gql
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ extend type Query {
}

extend type Mutation {
beetsSyncFbeetsRatio: String!

beetsPoolLoadReliquarySnapshotsForAllFarms(chain: GqlChain!): String!
}

Expand Down
10 changes: 3 additions & 7 deletions apps/api/rest-routes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { Express } from 'express';
import {
beetsGetCirculatingSupply,
beetsGetCirculatingSupplySonic,
beetsGetTotalSupplySonic,
} from '../../modules/beets/lib/beets';
import { beetsGetCirculatingSupply, beetsGetTotalSupply } from '../../modules/beets/lib/beets';

export function loadRestRoutes(app: Express) {
app.use('/health', (_, res) => res.sendStatus(200));
Expand All @@ -13,12 +9,12 @@ export function loadRestRoutes(app: Express) {
});
});
app.use('/circulating_supply_sonic', (_, res) => {
beetsGetCirculatingSupplySonic('SONIC').then((result) => {
beetsGetCirculatingSupply('SONIC').then((result) => {
res.send(result);
});
});
app.use('/total_supply_sonic', (_, res) => {
beetsGetTotalSupplySonic('SONIC').then((result) => {
beetsGetTotalSupply('SONIC').then((result) => {
res.send(result);
});
});
Expand Down
5 changes: 0 additions & 5 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ const files = {
documents: 'modules/subgraphs/balancer-subgraph/balancer-subgraph-queries.graphql',
...defaults.types,
},
['modules/subgraphs/masterchef-subgraph/generated/masterchef-subgraph-types.ts']: {
schema: config.FANTOM.subgraphs.masterchef,
documents: 'modules/subgraphs/masterchef-subgraph/masterchef-subgraph-queries.graphql',
...defaults.types,
},
['modules/subgraphs/reliquary-subgraph/generated/reliquary-subgraph-types.ts']: {
schema: config.FANTOM.subgraphs.reliquary,
documents: 'modules/subgraphs/reliquary-subgraph/reliquary-subgraph-queries.graphql',
Expand Down
4 changes: 1 addition & 3 deletions config/fantom.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { BigNumber } from 'ethers';
import { env } from '../apps/env';
import { DeploymentEnv, NetworkData } from '../modules/network/network-config-types';
import { NetworkData } from '../modules/network/network-config-types';

export default <NetworkData>{
chain: {
Expand All @@ -15,7 +14,6 @@ export default <NetworkData>{
startDate: '2021-10-08',
balancer: `https://gateway-arbitrum.network.thegraph.com/api/${env.THEGRAPH_API_KEY_FANTOM}/deployments/id/Qme9r1RTFZ6hEZ4ebPSmo3J81FNHhjeNZs5nBaSGTzb2hb`,
beetsBar: `https://gateway-arbitrum.network.thegraph.com/api/${env.THEGRAPH_API_KEY_FANTOM}/deployments/id/QmXcxzZioHXV5ts2UcG6gNNEayoaZ9ip7D9JvPS88K2HXe`,
masterchef: `https://gateway-arbitrum.network.thegraph.com/api/${env.THEGRAPH_API_KEY_FANTOM}/deployments/id/QmZQJu1rxMEDwzZb5TSqDXjcFiS1DN8BRKCLKRv6ifEBhA`,
reliquary: `https://gateway-arbitrum.network.thegraph.com/api/${env.THEGRAPH_API_KEY_FANTOM}/deployments/id/QmQB4iZpeX9eYgLUaiBt2HwkobqE3NzVUiupXF6Ha9Nzbk`,
sftmx: `https://gateway-arbitrum.network.thegraph.com/api/${env.THEGRAPH_API_KEY_FANTOM}/deployments/id/QmaD9zWMc6kQrBVbtjXNjNjbhpGWUHQFQdxABBEaVJqK5s`,
},
Expand Down
1 change: 0 additions & 1 deletion modules/actions/pool/staking/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './sync-gauge-staking.service';
export * from './sync-master-chef-staking.service';
export * from './sync-reliquary-staking.service';
export * from './sync-staking';
3 changes: 2 additions & 1 deletion modules/actions/pool/staking/sync-gauge-staking.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type { JsonFragment } from '@ethersproject/abi';
import { getInflationRate } from '../../../vebal/balancer-token-admin.service';
import _ from 'lodash';
import { Multicaller3Viem } from '../../../web3/multicaller-viem';
import { formatEther } from 'viem';

interface GaugeRewardData {
[address: string]: {
Expand Down Expand Up @@ -305,7 +306,7 @@ const getOnchainRewardTokensData = async (
const rewardsDataV2 = (await rewardsMulticallerV2.execute()) as GaugeRewardData;
const rewardsData = { ...rewardsDataV1, ...rewardsDataV2 };

const totalBalRate = parseFloat(formatUnits(await getInflationRate(chain)));
const totalBalRate = parseFloat(formatEther(await getInflationRate(chain)));
const now = Math.floor(Date.now() / 1000);

// Format onchain rates for all the rewards
Expand Down
138 changes: 0 additions & 138 deletions modules/actions/pool/staking/sync-master-chef-staking.service.ts

This file was deleted.

13 changes: 0 additions & 13 deletions modules/actions/pool/staking/sync-staking.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Chain, PrismaPoolStakingType } from '@prisma/client';
import { MasterchefSubgraphService } from '../../../subgraphs/masterchef-subgraph/masterchef.service';
import { ReliquarySubgraphService } from '../../../subgraphs/reliquary-subgraph/reliquary.service';
import { GaugeSubgraphService } from '../../../subgraphs/gauge-subgraph/gauge-subgraph.service';
import { AuraSubgraphService } from '../../../sources/subgraphs/aura/aura.service';
import { deleteMasterchefStakingForAllPools, syncMasterchefStakingForPools } from './sync-master-chef-staking.service';
import {
deleteReliquaryStakingForAllPools,
syncReliquaryStakingForPools,
Expand All @@ -17,16 +15,6 @@ import config from '../../../../config';
export const syncStaking = async (chains: Chain[]) => {
for (const chain of chains) {
const networkconfig = config[chain];
if (networkconfig.subgraphs.masterchef) {
await syncMasterchefStakingForPools(
chain,
new MasterchefSubgraphService(networkconfig.subgraphs.masterchef),
networkconfig.masterchef?.excludedFarmIds || [],
networkconfig.fbeets?.address || '',
networkconfig.fbeets?.farmId || '',
networkconfig.fbeets?.poolId || '',
);
}
if (networkconfig.subgraphs.reliquary) {
await syncReliquaryStakingForPools(
chain,
Expand Down Expand Up @@ -55,7 +43,6 @@ export const syncStaking = async (chains: Chain[]) => {

export const reloadStakingForAllPools = async (stakingTypes: PrismaPoolStakingType[], chain: Chain): Promise<void> => {
const networkconfig = config[chain];
await deleteMasterchefStakingForAllPools(stakingTypes, chain);
await deleteReliquaryStakingForAllPools(stakingTypes, chain);
await deleteGaugeStakingForAllPools(stakingTypes, chain);
await deleteAuraStakingForAllPools(stakingTypes, chain);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { prisma } from '../../../../../prisma/prisma-client';
import config from '../../../../../config';
import { getEvents } from '../../../../web3/events';
import _ from 'lodash';
import ERC20Abi from '../../../../web3/abi/ERC20.json';
import ERC20Abi from '../../../../web3/abi/ERC20';
import { formatEther, parseAbi, zeroAddress } from 'viem';
import { multicallViem } from '../../../../web3/multicaller-viem';
import { balancesToDb } from './balances-to-db';
Expand Down
Loading