Skip to content

Commit

Permalink
Merge pull request #5 from morpho-labs/feat/morpho-compound
Browse files Browse the repository at this point in the history
Feat/morpho compound
  • Loading branch information
tomrpl authored Dec 13, 2023
2 parents 06f3408 + e0244ea commit 5189fc1
Show file tree
Hide file tree
Showing 77 changed files with 49,683 additions and 89 deletions.
149 changes: 63 additions & 86 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"dependencies": {
"dotenv": "^16.3.1",
"ethers": "^6.7.1",
"pino": "^8.15.0",
"evm-maths": "^6.0.0",
"pino": "^8.15.0"
"zod": "^3.22.4"
}
}
26 changes: 26 additions & 0 deletions src/adapters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ import { GMXGlpAdapter } from './gmx/products/glp/gmxGlpAdapter'
import { LidoStEthAdapter } from './lido/products/st-eth/lidoStEthAdapter'
import { LidoWstEthAdapter } from './lido/products/wst-eth/lidoWstEthAdapter'
import { SDaiAdapter } from './maker/products/yield/sDaiAdapter'
import { MorphoAaveV2OptimizerBorrowAdapter } from './morpho-aave-v2/products/optimizer-borrow/morphoAaveV2OptimizerBorrowAdapter'
import { MorphoAaveV2OptimizerSupplyAdapter } from './morpho-aave-v2/products/optimizer-supply/morphoAaveV2OptimizerSupplyAdapter'
import { MorphoAaveV3ETHOptimizerBorrowAdapter } from './morpho-aave-v3-eth/products/optimizer-borrow/morphoAaveV3ETHOptimizerBorrowAdapter'
import { MorphoAaveV3ETHOptimizerSupplyAdapter } from './morpho-aave-v3-eth/products/optimizer-supply/morphoAaveV3ETHOptimizerSupplyAdapter'
import { MorphoCompoundV2OptimizerBorrowAdapter } from './morpho-compound-v2/products/optimizer-borrow/morphoCompoundV2OptimizerBorrowAdapter'
import { MorphoCompoundV2OptimizerSupplyAdapter } from './morpho-compound-v2/products/optimizer-supply/morphoCompoundV2OptimizerSupplyAdapter'
import { PricesUSDAdapter } from './prices/products/usd/pricesUSDAdapter'
import { Protocol } from './protocols'
import { StargatePoolAdapter } from './stargate/products/pool/stargatePoolAdapter'
Expand All @@ -34,6 +40,24 @@ export const supportedProtocols: Record<
Record<Chain, (new (input: ProtocolAdapterParams) => IProtocolAdapter)[]>
>
> = {
[Protocol.MorphoAaveV3ETHOptimizer]: {
[Chain.Ethereum]: [
MorphoAaveV3ETHOptimizerSupplyAdapter,
MorphoAaveV3ETHOptimizerBorrowAdapter,
],
},
[Protocol.MorphoAaveV2]: {
[Chain.Ethereum]: [
MorphoAaveV2OptimizerBorrowAdapter,
MorphoAaveV2OptimizerSupplyAdapter,
],
},
[Protocol.MorphoCompoundV2]: {
[Chain.Ethereum]: [
MorphoCompoundV2OptimizerSupplyAdapter,
MorphoCompoundV2OptimizerBorrowAdapter,
],
},
[Protocol.Stargate]: {
[Chain.Ethereum]: [StargatePoolAdapter, StargateVestingAdapter],
[Chain.Arbitrum]: [StargatePoolAdapter, StargateVestingAdapter],
Expand Down Expand Up @@ -132,6 +156,7 @@ export const supportedProtocols: Record<
[Protocol.Swell]: {
[Chain.Ethereum]: [SwellSwEthAdapter],
},

[Protocol.Convex]: {
[Chain.Ethereum]: [
ConvexPoolAdapter,
Expand All @@ -141,6 +166,7 @@ export const supportedProtocols: Record<
ConvexCvxcrvWrapperAdapter,
],
},

[Protocol.Prices]: {
[Chain.Ethereum]: [PricesUSDAdapter],
},
Expand Down
12 changes: 12 additions & 0 deletions src/adapters/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import { testCases as curveTestCases } from './curve/tests/testCases'
import { testCases as gMXTestCases } from './gmx/tests/testCases'
import { testCases as lidoTestCases } from './lido/tests/testCases'
import { testCases as makerTestCases } from './maker/tests/testCases'
import { testCases as morphoAaveV2TestCases } from './morpho-aave-v2/tests/testCases'
import { testCases as morphoAaveV3ETHOptimizerTestCases } from './morpho-aave-v3-eth/tests/testCases'
import { testCases as morphoCompoundV2OptimizerTestCases } from './morpho-compound-v2/tests/testCases'
import { testCases as pricesTestCases } from './prices/tests/testCases'
import { Protocol } from './protocols'
import { testCases as stargateTestCases } from './stargate/tests/testCases'
Expand All @@ -35,8 +38,17 @@ function runAllTests() {
runProtocolTests(Protocol.Maker, makerTestCases)
runProtocolTests(Protocol.GMX, gMXTestCases)
runProtocolTests(Protocol.Swell, swellTestCases)
runProtocolTests(Protocol.MorphoAaveV2, morphoAaveV2TestCases)
runProtocolTests(Protocol.Convex, convexTestCases)
runProtocolTests(Protocol.Prices, pricesTestCases)
runProtocolTests(
Protocol.MorphoCompoundV2,
morphoCompoundV2OptimizerTestCases,
)
runProtocolTests(
Protocol.MorphoAaveV3ETHOptimizer,
morphoAaveV3ETHOptimizerTestCases,
)
}

function runProtocolTests(protocolId: Protocol, testCases: TestCase[]) {
Expand Down
Loading

0 comments on commit 5189fc1

Please sign in to comment.