Skip to content

Commit

Permalink
Add support for AAVE_V3 protocol and refactor imports
Browse files Browse the repository at this point in the history
The code was updated to support the AAVE_V3 protocol, in addition to the existing AAVE3 protocol. Additionally, unnecessary line breaks in the import statement were removed to improve the readability of the code.
  • Loading branch information
jakubswierczek committed Apr 16, 2024
1 parent 1710aa7 commit 069112c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions summerfi-api/setup-trigger-function/src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ import { Logger } from '@aws-lambda-powertools/logger'
import {
AaveAutoBuyEventBody,
AaveAutoSellEventBody,
SetupTriggerEventBody,
AavePartialTakeProfitEventBody,
AaveStopLossEventBody,
SparkStopLossEventBody,
AaveTrailingStopLossEventBody,
SetupTriggerEventBody,
SparkAutoBuyEventBody,
SparkAutoSellEventBody,
SparkTrailingStopLossEventBody,
AavePartialTakeProfitEventBody,
SparkPartialTakeProfitEventBody,
SparkStopLossEventBody,
SparkTrailingStopLossEventBody,
} from '~types'
import type { GetTriggersResponse } from '@summerfi/triggers-shared/contracts'
import fetch from 'node-fetch'
import memoize from 'just-memoize'
import {
getRpcGatewayEndpoint,
IRpcConfig,
} from '@summerfi/serverless-shared/getRpcGatewayEndpoint'
import { getRpcGatewayEndpoint, IRpcConfig } from '@summerfi/serverless-shared'
import { ServiceContainer } from './service-container'
import { TriggerType } from '@oasisdex/automation'
import { getAaveAutoBuyServiceContainer } from './get-aave-auto-buy-service-container'
Expand Down
2 changes: 1 addition & 1 deletion summerfi-api/setup-trigger-function/src/types/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export type SupportedTriggersSchema =

export const getBodySchema = (pathParams: PathParams): SupportedTriggersSchema | undefined => {
const { trigger, chainId, protocol } = pathParams
if (protocol === ProtocolId.AAVE3) {
if (protocol === ProtocolId.AAVE3 || protocol === ProtocolId.AAVE_V3) {
if (trigger === SupportedTriggers.AutoBuy) {
return eventBodyAaveBasicBuySchema
}
Expand Down

0 comments on commit 069112c

Please sign in to comment.