Skip to content

Commit

Permalink
Add Velocimeter FVM (#1177)
Browse files Browse the repository at this point in the history
* Add Velocimeter FVM

* Adjust token imports
  • Loading branch information
shatterproof authored Jul 26, 2023
1 parent edb9fe1 commit c584bf8
Show file tree
Hide file tree
Showing 14 changed files with 333 additions and 22 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"fantom:spirits:add": "ts-node scripts/add-solidly.ts --network fantom --project spiritStable --newFee true",
"fantom:equalizer:add": "ts-node scripts/add-solidly.ts --network fantom --project equalizer --newFee true --lp",
"fantom:sushi:add": "ts-node scripts/add-sushi.ts --network fantom --project sushiFtm",
"fantom:solidly:add": "ts-node scripts/add-solidly.ts --network fantom --project solidly --newFee true",
"fantom:fvm:add": "ts-node scripts/add-solidly.ts --network fantom --project fvm --newFee true --lp",
"polygon:quick:add": "ts-node scripts/add-quick.ts --network polygon --project quick",
"polygon:quick:gamma:add": "ts-node scripts/add-sushi.ts --network polygon --project quick --newFee true --pool",
"polygon:sushi:add": "ts-node scripts/add-sushi.ts --network polygon --project sushiPoly",
Expand All @@ -57,7 +59,6 @@
"fuse:sushi:add": "ts-node scripts/add-sushi.ts --network fuse --project sushiFuse",
"metis:netswap:add": "ts-node scripts/add-farm.ts --network metis --project netswap",
"metis:tethys:add": "ts-node scripts/add-farm.ts --network metis --project tethys",
"fantom:solidly:add": "ts-node scripts/add-solidly.ts --network fantom --project solidly --newFee true",
"polygon:dystopia:add": "ts-node scripts/add-solidly.ts --network polygon --project dystopia --newFee true",
"polygon:uniswap:add": "ts-node scripts/add-univ3.ts --network polygon --project uniswap_polygon --strategy",
"op:velodrome:add": "ts-node scripts/add-solidly.ts --network optimism --project velodrome --newFee true --lp",
Expand Down
2 changes: 2 additions & 0 deletions packages/address-book/address-book/fantom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { solidly } from './platforms/solidly';
import { tombswap } from './platforms/tombswap';
import { solace } from './platforms/solace';
import { equalizer } from './platforms/equalizer';
import { fvm } from './platforms/fvm';
import { tokens } from './tokens/tokens';
import { convertSymbolTokenMapToAddressTokenMap } from '../../util/convertSymbolTokenMapToAddressTokenMap';
import Chain from '../../types/chain';
Expand All @@ -23,6 +24,7 @@ const _fantom = {
tombswap,
solace,
equalizer,
fvm,
},
tokens,
tokenAddressMap: convertSymbolTokenMapToAddressTokenMap(tokens),
Expand Down
4 changes: 4 additions & 0 deletions packages/address-book/address-book/fantom/platforms/fvm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const fvm = {
router: '0x2E14B53E2cB669f3A974CeaF6C735e134F3Aa9BC',
voter: '0xc9Ea7A2337f27935Cd3ccFB2f725B0428e731FBF',
} as const;
53 changes: 53 additions & 0 deletions packages/address-book/address-book/fantom/tokens/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,7 @@ const _tokens = {
address: '0xcc1b99dDAc1a33c201a742A1851662E87BC7f22C',
chainId: 250,
decimals: 6,
logoURI: '',
website: 'https://tether.to/en/transparency/#usdt',
bridge: 'layer-zero',
description:
Expand Down Expand Up @@ -1899,6 +1900,58 @@ const _tokens = {
'Wrapped Bitcoin (WBTC) is an ERC20 token backed 1:1 with Bitcoin, which brings greater liquidity to the Ethereum ecosystem including decentralized exchanges and financial applications. It allows Bitcoin holders to use their Bitcoin on the Ethereum network and participate in the DeFi ecosystem.',
documentation: 'https://layerzero.gitbook.io/docs/',
},
frxETH: {
name: 'Frax Ether',
symbol: 'frxETH',
address: '0x9E73F99EE061C8807F69f9c6CCc44ea3d8c373ee',
chainId: 250,
decimals: 18,
logoURI: '',
website: 'https://app.frax.finance/frxeth/mint',
bridge: 'frax',
description:
'frxETH acts as a stablecoin loosely pegged to ETH, so that 1 frxETH always represents 1 ETH and the amount of frxETH in circulation matches the amount of ETH in the Frax ETH system. When ETH is sent to the frxETHMinter, an equivalent amount of frxETH is minted. Holding frxETH on its own is not eligible for staking yield and should be thought of as analogous as holding ETH.',
documentation: 'https://docs.frax.finance/frax-ether/frxeth-and-sfrxeth',
},
axlETH: {
name: 'Axelar Wrapped ETH',
symbol: 'axlETH',
address: '0xfe7eDa5F2c56160d406869A8aA4B2F365d544C7B',
chainId: 250,
decimals: 18,
logoURI: '',
website: 'https://axelar.network/',
bridge: 'axelar',
description:
'Axelar Wrapped ETH (axlETH) is an ERC-20 token that represents a wrapped version of native Ethereum (ETH) cryptocurrency, allowing for cross-chain transfers and compatibility with the Ethereum ecosystem.',
documentation: 'https://docs.axelar.dev/',
},
FVM: {
name: 'Fantom Velocimeter',
symbol: 'FVM',
address: '0x07BB65fAaC502d4996532F834A1B7ba5dC32Ff96',
chainId: 250,
decimals: 18,
logoURI: '',
website: 'https://www.fvm.exchange',
bridge: 'native',
description:
'FVM is the native token for Velocimeter on Fantom (FVM), a project providing liquidity on the chain where it is needed most. The FVM token can be staked as or locked to earn rewards on the FVM platform.',
documentation: 'https://docs.velocimeter.xyz/FVMtokenomics',
},
oFVM: {
name: 'Option to buy FVM',
symbol: 'oFVM',
address: '0xF9EDdca6B1e548B0EC8cDDEc131464F462b8310D',
chainId: 250,
decimals: 18,
logoURI: '',
website: 'https://www.fvm.exchange',
bridge: 'native',
description:
'oFVM is a new options token that helps to reduce sell pressure on the native FVM token. It is earned by liquidity providers (LPs) who provide liquidity to the FVM-FTM pool. oFVM can be redeemed for FVM at a discount, or it can be locked up for a period of time as veFVM. veFVM is a governance token that allows holders to vote on the distribution of emissions, as well as receive weekly bribes and fees.',
documentation: 'https://docs.velocimeter.xyz/oFVMmech',
},
} as const;

export const tokens: ConstRecord<typeof _tokens, Token> = _tokens;
8 changes: 7 additions & 1 deletion scripts/add-solidly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { addressBook } from '../packages/address-book/address-book';
import ISolidlyPair from '../src/abis/ISolidlyPair';
const {
fantom: {
platforms: { spiritswap, equalizer },
platforms: { spiritswap, equalizer, fvm },
},
optimism: {
platforms: { velodrome },
Expand Down Expand Up @@ -94,6 +94,12 @@ const projects = {
volatileFile: '../src/data/fantom/equalizerV2LpPools.json',
voter: equalizer.voter,
},
fvm: {
prefix: 'fvm',
stableFile: '../src/data/fantom/fvmStableLpPools.json',
volatileFile: '../src/data/fantom/fvmLpPools.json',
voter: fvm.voter,
},
solidly: {
prefix: 'monolith',
stableFile: '../src/data/ethereum/solidlyStableLpPools.json',
Expand Down
26 changes: 26 additions & 0 deletions src/api/stats/fantom/getFvmApys.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const { FANTOM_CHAIN_ID: chainId } = require('../../../constants');
const { getSolidlyGaugeApys } = require('../common/getSolidlyGaugeApys');

const stablePools = require('../../../data/fantom/fvmStableLpPools.json');
const volatilePools = require('../../../data/fantom/fvmLpPools.json');
import { addressBook } from '../../../../packages/address-book/address-book';
const {
fantom: {
tokens: { FVM },
},
} = addressBook;

const pools = [...stablePools, ...volatilePools];
const getFvmApys = async () =>
getSolidlyGaugeApys({
chainId: chainId,
pools: pools,
oracleId: 'oFVM',
oracle: 'tokens',
decimals: '1e18',
reward: FVM.address,
boosted: false,
// log: true,
});

module.exports = getFvmApys;
9 changes: 9 additions & 0 deletions src/api/stats/fantom/getFvmStablePrices.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const getSolidlyStablePrices = require('../common/getSolidlyStablePrices');
const pools = require('../../../data/fantom/fvmStableLpPools.json');
const { FANTOM_CHAIN_ID } = require('../../../constants');

const getFvmStablePrices = async tokenPrices => {
return await getSolidlyStablePrices(FANTOM_CHAIN_ID, pools, tokenPrices);
};

module.exports = getFvmStablePrices;
2 changes: 2 additions & 0 deletions src/api/stats/fantom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ const getSpiritV2Apys = require('./getSpiritV2Apys');
const getMaiCurveApys = require('./getMaiCurveApys');
const getEqualizerApys = require('./getEqualizerApys');
const getMmyApys = require('./getMmyApys');
const getFvmApys = require('./getFvmApys');

const getApys = [
getFvmApys,
getMmyApys,
getEqualizerApys,
getSpiritV2Apys,
Expand Down
2 changes: 2 additions & 0 deletions src/api/stats/getAmmPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ import pearlPools from '../../data/matic/pearlLpPools.json';
import velocorePools from '../../data/zksync/velocoreLpPools.json';
import soliSnekPools from '../../data/avax/soliSnekLpPools.json';
import veSyncPools from '../../data/zksync/veSyncLpPools.json';
import fvmPools from '../../data/fantom/fvmLpPools.json';
import { fetchVaultPrices } from '../../utils/fetchVaultPrices';
import { addressBookByChainId } from '../../../packages/address-book/address-book';
import { sleep } from '../../utils/time';
Expand All @@ -286,6 +287,7 @@ const REFRESH_INTERVAL = 5 * 60 * 1000;
// FIXME: if this list grows too big we might hit the ratelimit on initialization everytime
// Implement in case of emergency -> https://github.com/beefyfinance/beefy-api/issues/103
const pools = normalizePoolOracleIds([
...fvmPools,
...veSyncPools,
...soliSnekPools,
...velocorePools,
Expand Down
2 changes: 2 additions & 0 deletions src/api/stats/getNonAmmPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import getUniswapArbitrumPrices from './arbitrum/getUniswapPositionPrices';
import getQuickGammaPrices from './matic/getQuickGammaPrices';
import getChronosStablePrices from './arbitrum/getChronosStablePrices';
import getQuickGammaZkPrices from './zkevm/getQuickGammaPrices';
import getFvmStablePrices from './fantom/getFvmStablePrices';

export type NonAmmPrices = {
prices: Record<string, number>;
Expand Down Expand Up @@ -165,6 +166,7 @@ export async function getNonAmmPrices(tokenPrices: Record<string, number>): Prom
getQuickGammaPrices(tokenPrices),
getQuickGammaZkPrices(tokenPrices),
getChronosStablePrices(tokenPrices),
getFvmStablePrices(tokenPrices),
];

// Setup error logs
Expand Down
2 changes: 0 additions & 2 deletions src/api/stats/zksync/getveSyncApys.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { zksyncWeb3: web3 } = require('../../../utils/web3');
const { ZKSYNC_CHAIN_ID: chainId } = require('../../../constants');
const { getSolidlyGaugeApys } = require('../common/getSolidlyGaugeApys');

Expand All @@ -13,7 +12,6 @@ const {
const pools = [...volatilePools];
const getveSyncApys = async () =>
getSolidlyGaugeApys({
web3: web3,
chainId: chainId,
pools: pools,
oracleId: 'VSzk',
Expand Down
18 changes: 0 additions & 18 deletions src/data/archive/oldLpPools.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
[
{
"name": "fvm-lzweth-lzwbtc",
"address": "0x04636D31Be7a53BB91E48166B2458C6c35cC7BF2",
"decimals": "1e18",
"chainId": 250,
"lp0": {
"address": "0x695921034f0387eAc4e11620EE91b1b15A6A09fE",
"oracle": "tokens",
"oracleId": "lzWETH",
"decimals": "1e18"
},
"lp1": {
"address": "0xf1648C50d2863f780c57849D812b4B7686031A3D",
"oracle": "tokens",
"oracleId": "lzWBTC",
"decimals": "1e8"
}
},
{
"name": "boo-lzusdc-lzweth",
"address": "0xf2610511493473379d76Bfee07B673D0cB4Ed3E7",
Expand Down
122 changes: 122 additions & 0 deletions src/data/fantom/fvmLpPools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
[
{
"name": "fvm-wftm-sftmx",
"address": "0xAC8909fB68C33fFBf977E55b07b5Fe85552Ef97d",
"gauge": "0x7f244DAA7aE845a20D621d876896530b58D0a681",
"decimals": "1e18",
"chainId": 250,
"beefyFee": 0.095,
"lp0": {
"address": "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",
"oracle": "tokens",
"oracleId": "WFTM",
"decimals": "1e18"
},
"lp1": {
"address": "0xd7028092c830b5C8FcE061Af2E593413EbbC1fc1",
"oracle": "tokens",
"oracleId": "sFTMX",
"decimals": "1e18"
}
},
{
"name": "fvm-wftm-ofvm",
"address": "0x9b014996cfA03BE2584c6E3f0e48E7c998032AD6",
"gauge": "0x3921c989D757B970e88f7a7a08eAa93b7bF6c84f",
"decimals": "1e18",
"chainId": 250,
"beefyFee": 0.095,
"lp0": {
"address": "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",
"oracle": "tokens",
"oracleId": "WFTM",
"decimals": "1e18"
},
"lp1": {
"address": "0xF9EDdca6B1e548B0EC8cDDEc131464F462b8310D",
"oracle": "tokens",
"oracleId": "oFVM",
"decimals": "1e18"
}
},
{
"name": "fvm-lzweth-lzwbtc",
"address": "0x04636D31Be7a53BB91E48166B2458C6c35cC7BF2",
"gauge": "0x3900EE825056dcd49B5aE4BDF2d16F38B764bfe7",
"decimals": "1e18",
"chainId": 250,
"beefyFee": 0.095,
"lp0": {
"address": "0x695921034f0387eAc4e11620EE91b1b15A6A09fE",
"oracle": "tokens",
"oracleId": "lzWETH",
"decimals": "1e18"
},
"lp1": {
"address": "0xf1648C50d2863f780c57849D812b4B7686031A3D",
"oracle": "tokens",
"oracleId": "lzWBTC",
"decimals": "1e8"
}
},
{
"name": "fvm-fvm-wftm",
"address": "0x0E8f117a563Be78Eb5A391A066d0d43Dd187a9E0",
"gauge": "0xa3643a5d5B672a267199227CD3E95eD0B41DBD52",
"decimals": "1e18",
"chainId": 250,
"beefyFee": 0.095,
"lp0": {
"address": "0x07BB65fAaC502d4996532F834A1B7ba5dC32Ff96",
"oracle": "tokens",
"oracleId": "FVM",
"decimals": "1e18"
},
"lp1": {
"address": "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",
"oracle": "tokens",
"oracleId": "WFTM",
"decimals": "1e18"
}
},
{
"name": "fvm-wftm-lzusdc",
"address": "0x1a35C7357BC8D0eB9342d73D4f13c4a6f64AC1d6",
"gauge": "0x78751a5577fb9875acCeDe0965691D46960C1216",
"decimals": "1e18",
"chainId": 250,
"beefyFee": 0.095,
"lp0": {
"address": "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",
"oracle": "tokens",
"oracleId": "WFTM",
"decimals": "1e18"
},
"lp1": {
"address": "0x28a92dde19D9989F39A49905d7C9C2FAc7799bDf",
"oracle": "tokens",
"oracleId": "lzUSDC",
"decimals": "1e6"
}
},
{
"name": "fvm-wftm-lzweth",
"address": "0x3A3F84b45f857DF60360b2B007eeF495576642DE",
"gauge": "0x30d0672C6E51F3169D8d19e2EAB12D0E7Aa16e17",
"decimals": "1e18",
"chainId": 250,
"beefyFee": 0.095,
"lp0": {
"address": "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",
"oracle": "tokens",
"oracleId": "WFTM",
"decimals": "1e18"
},
"lp1": {
"address": "0x695921034f0387eAc4e11620EE91b1b15A6A09fE",
"oracle": "tokens",
"oracleId": "lzWETH",
"decimals": "1e18"
}
}
]
Loading

0 comments on commit c584bf8

Please sign in to comment.