Skip to content

Commit

Permalink
Extend config with navigation specific data (#38)
Browse files Browse the repository at this point in the history
* Extend config with navigation specific data

* split config into smaller pieces

* convert getNavigation to function

* undo changes in gitignore

* undo changes in gitignore
  • Loading branch information
piekczyk authored Sep 22, 2023
1 parent 10ffecb commit a69b302
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 47 deletions.
36 changes: 36 additions & 0 deletions configs/oasis-borrow/getFeatures.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { ConfigHelperType } from "⌨️";

export const getFeatures = ({ isStaging }: Pick<ConfigHelperType, 'isStaging'>) => ({
AaveV3ArbitrumBorrow: true,
AaveV3ArbitrumEarn: false,
AaveV3EarncbETHeth: false,
AaveV3EarnrETHeth: false,
AaveV3History: false,
AaveV3OptimismBorrow: true,
AaveV3OptimismEarn: false,
AaveV3Protection: true,
AaveV3ProtectionWrite: true,
AjnaPoolFinder: true,
AjnaReusableDPM: false,
AjnaSafetySwitch: true,
AjnaSuppressValidation: false,
AnotherTestFeature: true, // used in unit tests
ConstantMultipleReadOnly: false,
DaiSavingsRate: true,
DisableSidebarScroll: false,
FollowAAVEVaults: false,
NewNavigation: false,
ProxyCreationDisabled: false,
ProxyReveal: false,
ReadOnlyAutoTakeProfit: false,
ReadOnlyBasicBS: false,
Referrals: true,
Sillyness: false,
StopLossOpenFlow: false,
StopLossRead: true,
StopLossWrite: true,
TestFeature: false, // used in unit tests
UseNetworkSwitcherForks: false,
UseNetworkSwitcherTestnets: false,
SparkProtocolStopLoss: isStaging,
})
124 changes: 124 additions & 0 deletions configs/oasis-borrow/getNavigation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
export const getNavigation= () => ({
protocols: {
ajna: {
borrow: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '/',
},
},
multiply: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '/',
},
},
earn: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '/',
},
},
},
aave: {
borrow: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '/',
},
},
multiply: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '',
},
},
earn: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '/',
},
},
},
maker: {
borrow: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '',
},
},
multiply: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '',
},
},
earn: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '',
},
},
},
spark: {
borrow: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '',
},
},
multiply: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '',
},
},
earn: {
tokens: ['ETH', 'WBTC', 'DAI'],
extra: {
title: 'Amplify sDAI up to 35x.',
description:
'Use Summer.fi multiply to increase your exposure to sDAI yield seamlessly.',
url: '',
},
},
},
},
tokens: {
popular: ['ETH, STETH', 'RETH', 'CBETH', 'DAI'],
new: ['SDAI', 'GHO', 'TBTC'],
},
})
14 changes: 14 additions & 0 deletions configs/oasis-borrow/getParameters.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {ConfigHelperType} from "⌨️";

export const getParameters = ({notProduction}: Pick<ConfigHelperType, 'notProduction'>) => ({
topBanner: {
name: 'rebranding',
url: 'https://blog.summer.fi/oasis-app-rebrands-to-summer-fi/',
message: 'Oasis.app is now Summer.fi! Read the announcement',
},
aaveLike: {
orderInformation: {
showFlashloanInformation: notProduction,
},
},
})
54 changes: 7 additions & 47 deletions configs/oasis-borrow/index.ts
Original file line number Diff line number Diff line change
@@ -1,56 +1,16 @@
import { ConfigHelperType } from "⌨️";
import { getFeatures } from "./getFeatures";
import { getNavigation } from "./getNavigation";
import { getParameters } from "./getParameters";

export default function ({
isDevelopment: _isDevelopment,
notProduction,
isStaging,
}: ConfigHelperType) {
return {
features: {
AaveV3ArbitrumBorrow: true,
AaveV3ArbitrumEarn: false,
AaveV3EarncbETHeth: false,
AaveV3EarnrETHeth: false,
AaveV3History: false,
AaveV3OptimismBorrow: true,
AaveV3OptimismEarn: false,
AaveV3Protection: true,
AaveV3ProtectionWrite: true,
AjnaPoolFinder: true,
AjnaReusableDPM: false,
AjnaSafetySwitch: true,
AjnaSuppressValidation: false,
AnotherTestFeature: true, // used in unit tests
ConstantMultipleReadOnly: false,
DaiSavingsRate: true,
DisableSidebarScroll: false,
FollowAAVEVaults: false,
NewNavigation: false,
ProxyCreationDisabled: false,
ProxyReveal: false,
ReadOnlyAutoTakeProfit: false,
ReadOnlyBasicBS: false,
Referrals: true,
Sillyness: false,
StopLossOpenFlow: false,
StopLossRead: true,
StopLossWrite: true,
TestFeature: false, // used in unit tests
UseNetworkSwitcherForks: false,
UseNetworkSwitcherTestnets: false,
SparkProtocolStopLoss: isStaging,
},
parameters: {
topBanner: {
name: "rebranding",
url: "https://blog.summer.fi/oasis-app-rebrands-to-summer-fi/",
message: "Oasis.app is now Summer.fi! Read the announcement",
},
aaveLike: {
orderInformation: {
showFlashloanInformation: notProduction,
},
},
},
};
features: getFeatures({ isStaging }),
parameters: getParameters({ notProduction }),
navigation: getNavigation(),
}
}

0 comments on commit a69b302

Please sign in to comment.