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

nonDefaultExports #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 1 addition & 3 deletions packages/core/src/config/new/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,7 @@ ASSETS_42161.set(WETH, {
});


const ASSETS = new Map( [
export const ASSETS = new Map( [
[1, ASSETS_1],
[42161, ASSETS_42161],
])

export default ASSETS;
6 changes: 2 additions & 4 deletions packages/core/src/config/new/oracles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const NOTIONAL_MULTI_ORACLE = 'NotionalMultiOracle';
const ACCUMULATOR_ORACLE = 'AccumulatorOracle';

// map chain id to oracle info
const ORACLES = new Map<number, Map<string, Map<string, string>>>();
export const ORACLES = new Map<number, Map<string, Map<string, string>>>();

// map asset (quote) and other asset (base) to a specific oracle based on where there is relevant price info for the pair
const CHAIN_ID_1_ASSET_ORACLE_INFO = new Map<string, Map<string, string>>();
Expand Down Expand Up @@ -212,6 +212,4 @@ ORACLES.set(4, CHAIN_ID_1_ASSET_ORACLE_INFO);
ORACLES.set(5, CHAIN_ID_1_ASSET_ORACLE_INFO);
ORACLES.set(42, CHAIN_ID_1_ASSET_ORACLE_INFO);
ORACLES.set(42161, CHAIN_ID_421611_ASSET_ORACLE_INFO);
ORACLES.set(421611, CHAIN_ID_421611_ASSET_ORACLE_INFO);

export default ORACLES;
ORACLES.set(421611, CHAIN_ID_421611_ASSET_ORACLE_INFO);
62 changes: 28 additions & 34 deletions packages/core/src/config/new/series.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


const commonProperties = { version: '1', poolVersion: '1', decimals: 18 }

export interface ISeriesStatic {
Expand All @@ -23,39 +21,37 @@ export interface ISeriesStatic {
g2: string;
}

const USDC_2112 = '0x303230340000';
const USDC_2203 = '0x303230350000';
const USDC_2206 = '0x303230360000';
const USDC_2209 = '0x303230370000';
const USDC_2212 = '0x303230380000';
const USDC_2303 = '0x303230390000';

const DAI_2112 = '0x303130340000';
const DAI_2203 = '0x303130350000';
const DAI_2206 = '0x303130360000';
const DAI_2209 = '0x303130370000';
const DAI_2212 = '0x303130380000';
const DAI_2303 = '0x303130390000';

const WETH_2206 = '0x303030360000';
const WETH_2209 = '0x303030370000';
const WETH_2212 = '0x303030380000';
const WETH_2303 = '0x303030390000';

const FRAX_2206 = '0x303330360000';
const FRAX_2209 = '0x303330370000';
const FRAX_2212 = '0x313830380000';
const FRAX_2303 = '0x313830390000';
export const USDC_2112 = '0x303230340000';
export const USDC_2203 = '0x303230350000';
export const USDC_2206 = '0x303230360000';
export const USDC_2209 = '0x303230370000';
export const USDC_2212 = '0x303230380000';
export const USDC_2303 = '0x303230390000';

export const DAI_2112 = '0x303130340000';
export const DAI_2203 = '0x303130350000';
export const DAI_2206 = '0x303130360000';
export const DAI_2209 = '0x303130370000';
export const DAI_2212 = '0x303130380000';
export const DAI_2303 = '0x303130390000';

export const WETH_2206 = '0x303030360000';
export const WETH_2209 = '0x303030370000';
export const WETH_2212 = '0x303030380000';
export const WETH_2303 = '0x303030390000';

export const FRAX_2206 = '0x303330360000';
export const FRAX_2209 = '0x303330370000';
export const FRAX_2212 = '0x313830380000';
export const FRAX_2303 = '0x313830390000';

// 2306 - New Naming Structure
const USDC_2306 = '0x0032ff00028b';
const DAI_2306 = '0x0031ff00028b';
const WETH_2306 = '0x0030ff00028b';
const FRAX_2306 = '0x0138ff00028b';

export const USDC_2306 = '0x0032ff00028b';
export const DAI_2306 = '0x0031ff00028b';
export const WETH_2306 = '0x0030ff00028b';
export const FRAX_2306 = '0x0138ff00028b';


const SERIES = new Map<number, Map<string, ISeriesStatic>>();
export const SERIES = new Map<number, Map<string, ISeriesStatic>>();

SERIES.set(
1,
Expand Down Expand Up @@ -928,5 +924,3 @@ SERIES.set(
],
])
);

export default SERIES;
4 changes: 1 addition & 3 deletions packages/core/src/config/new/strategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface StrategyInfo {
}

// map each chain id to its corresponding strategies' data
const STRATEGIES = new Map<number, StrategyInfo[]>();
export const STRATEGIES = new Map<number, StrategyInfo[]>();

STRATEGIES.set(1, [
/* V1 strategies */
Expand Down Expand Up @@ -236,5 +236,3 @@ STRATEGIES.set(42161, [
version: '1',
},
]);

export default STRATEGIES;
2 changes: 1 addition & 1 deletion packages/core/src/config/new/validateSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BaseProvider } from '@ethersproject/providers';
import { Pool__factory, FYToken__factory, Cauldron__factory } from '@yield-protocol/ui-contracts';
// import { Cauldron__factory, FYToken__factory, Pool__factory } from '../contracts';

import SERIES, { ISeriesStatic } from './series';
import { SERIES, ISeriesStatic } from './series';

// TODO validate series
export const validateSeries = async (provider: BaseProvider, cauldronAddress: string) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/config/new/validateStrategies.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {BaseProvider} from "@ethersproject/providers";
import { Strategy__factory } from "@yield-protocol/ui-contracts";
import STRATEGIES, { StrategyInfo } from "./strategies";
import { STRATEGIES, StrategyInfo } from "./strategies";

export const validateStrategies = async (provider: BaseProvider) => {
const preText = '### STRATEGY VALIDATION ERROR ### ';
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ import * as yieldObservables from './observables';
import * as viewObservables from './viewObservables';


import ASSETS from './config/new/assets';
import SERIES from './config/new/series';
import ORACLES from './config/new/oracles';
import STRATEGIES from './config/new/strategies';
import { ASSETS } from './config/new/assets';
import { SERIES } from './config/new/series';
import { ORACLES } from './config/new/oracles';
import { STRATEGIES } from './config/new/strategies';


/**
Expand Down