-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fully export aave and spark depositBorrow strategies
- Loading branch information
Showing
7 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import { aave } from './aave' | ||
import { ajna } from './ajna' | ||
import buckets from './ajna/earn/buckets.json' | ||
import { spark } from './spark' | ||
|
||
export const strategies: { | ||
aave: typeof aave | ||
ajna: typeof ajna | ||
spark: typeof spark | ||
} = { | ||
aave, | ||
ajna, | ||
spark, | ||
} | ||
|
||
export const ajnaBuckets = buckets |
8 changes: 8 additions & 0 deletions
8
packages/dma-library/src/strategies/spark/borrow/deposit-borrow/deposit-borrow.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { aaveLike } from '@dma-library/strategies/aave-like' | ||
|
||
import { SparkDepositBorrow } from './types' | ||
|
||
export const depositBorrow: SparkDepositBorrow = async (args, dependencies) => { | ||
const protocolType = 'Spark' as const | ||
return await aaveLike.borrow.depositBorrow(args, { ...dependencies, protocolType }) | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/dma-library/src/strategies/spark/borrow/deposit-borrow/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { depositBorrow } from './deposit-borrow' | ||
export { SparkDepositBorrow } from './types' |
19 changes: 19 additions & 0 deletions
19
packages/dma-library/src/strategies/spark/borrow/deposit-borrow/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as Strategies from '@dma-library/types/strategies' | ||
import * as StrategyParams from '@dma-library/types/strategy-params' | ||
|
||
export type SparkDepositBorrowArgs = StrategyParams.WithAaveLikeBorrowStrategyArgs & | ||
StrategyParams.WithAaveLikeEntryToken & | ||
StrategyParams.WithDepositCollateral & | ||
StrategyParams.WithBorrowDebt | ||
|
||
export type SparkDepositBorrowDependencies = StrategyParams.WithAaveLikeStrategyDependencies & | ||
StrategyParams.WithOptionalSwap | ||
|
||
export type IDepositBorrowStrategy = Strategies.IStrategy & { | ||
simulation: Strategies.IStrategy['simulation'] & Strategies.WithOptionalSwapSimulation | ||
} | ||
|
||
export type SparkDepositBorrow = ( | ||
args: SparkDepositBorrowArgs, | ||
dependencies: SparkDepositBorrowDependencies, | ||
) => Promise<IDepositBorrowStrategy> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { SparkDepositBorrow } from '@dma-library/strategies/spark/borrow/deposit-borrow/types' | ||
|
||
import { depositBorrow as sparkDepositBorrow } from './borrow/deposit-borrow' | ||
|
||
export const spark: { | ||
depositBorrow: SparkDepositBorrow | ||
} = { | ||
depositBorrow: sparkDepositBorrow, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters