From cab6f59fc760889eedf187da2cf9666f06f00b46 Mon Sep 17 00:00:00 2001 From: 0xfoobar <0xfoobar1@gmail.com> Date: Fri, 11 Mar 2022 12:53:25 -0500 Subject: [PATCH 1/3] Add alUSD as borrowable asset --- helpers/types.ts | 5 ++++- markets/aave/commons.ts | 4 ++++ markets/aave/index.ts | 4 ++++ markets/aave/reservesConfigs.ts | 17 +++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/helpers/types.ts b/helpers/types.ts index 4ea1ab06f..fc99d3050 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -183,6 +183,7 @@ export interface iAssetCommon { [key: string]: T; } export interface iAssetBase { + ALUSD: T; WETH: T; DAI: T; TUSD: T; @@ -213,6 +214,7 @@ export type iAssetsWithoutUSD = Omit, 'USD'>; export type iAavePoolAssets = Pick< iAssetsWithoutUSD, + | 'ALUSD' | 'DAI' | 'TUSD' | 'USDC' @@ -243,6 +245,7 @@ export type iAavePoolTokens = Omit, 'ETH'>; export type iAssetAggregatorBase = iAssetsWithoutETH; export enum TokenContractId { + ALUSD = 'ALUSD', DAI = 'DAI', AAVE = 'AAVE', TUSD = 'TUSD', @@ -264,7 +267,7 @@ export enum TokenContractId { YFI = 'YFI', UNI = 'UNI', ENJ = 'ENJ', - xSUSHI = 'xSUSHI' + xSUSHI = 'xSUSHI', } export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams { diff --git a/markets/aave/commons.ts b/markets/aave/commons.ts index 6833e67f2..5a1e16435 100644 --- a/markets/aave/commons.ts +++ b/markets/aave/commons.ts @@ -4,6 +4,7 @@ import { ICommonConfiguration, EthereumNetwork, eEthereumNetwork } from '../../h const MOCK_CHAINLINK_AGGREGATORS_PRICES = { AAVE: oneEther.multipliedBy('0.003620948469').toFixed(), + ALUSD: oneEther.multipliedBy('0.00364714136416').toFixed(), BAT: oneEther.multipliedBy('0.00137893825230').toFixed(), BUSD: oneEther.multipliedBy('0.00736484').toFixed(), DAI: oneEther.multipliedBy('0.00369068412860').toFixed(), @@ -77,6 +78,9 @@ export const CommonsConfig: ICommonConfiguration = { AAVE: { borrowRate: oneRay.multipliedBy(0.03).toFixed(), }, + ALUSD: { + borrowRate: oneRay.multipliedBy(0.03).toFixed(), + }, LINK: { borrowRate: oneRay.multipliedBy(0.03).toFixed(), }, diff --git a/markets/aave/index.ts b/markets/aave/index.ts index d60db80fd..2021c5f68 100644 --- a/markets/aave/index.ts +++ b/markets/aave/index.ts @@ -3,6 +3,7 @@ import { IAaveConfiguration, EthereumNetwork, eEthereumNetwork } from '../../hel import { CommonsConfig } from './commons'; import { + strategyALUSD, strategyBUSD, strategyDAI, strategySUSD, @@ -34,6 +35,7 @@ export const AaveConfig: IAaveConfiguration = { MarketId: 'Aave genesis market', ProviderId: 1, ReservesConfig: { + ALUSD: strategyALUSD, AAVE: strategyAAVE, BAT: strategyBAT, BUSD: strategyBUSD, @@ -106,6 +108,7 @@ export const AaveConfig: IAaveConfiguration = { }, [EthereumNetwork.main]: { AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9', + ALUSD: '0xBC6DA0FE9aD5f3b0d58160288917AA56653660E9', BAT: '0x0d8775f648430679a709e98d2b0cb6250d2887ef', BUSD: '0x4Fabb145d64652a948d72533023f6E7A623C7C53', DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F', @@ -129,6 +132,7 @@ export const AaveConfig: IAaveConfiguration = { }, [EthereumNetwork.tenderlyMain]: { AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9', + ALUSD: '0xBC6DA0FE9aD5f3b0d58160288917AA56653660E9', BAT: '0x0d8775f648430679a709e98d2b0cb6250d2887ef', BUSD: '0x4Fabb145d64652a948d72533023f6E7A623C7C53', DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F', diff --git a/markets/aave/reservesConfigs.ts b/markets/aave/reservesConfigs.ts index 30f094ace..eadaa6b63 100644 --- a/markets/aave/reservesConfigs.ts +++ b/markets/aave/reservesConfigs.ts @@ -2,6 +2,23 @@ import BigNumber from 'bignumber.js'; import { oneRay } from '../../helpers/constants'; import { eContractid, IReserveParams } from '../../helpers/types'; +export const strategyALUSD: IReserveParams = { + optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(), + baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(), + variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(), + variableRateSlope2: new BigNumber(0.75).multipliedBy(oneRay).toFixed(), + stableRateSlope1: new BigNumber(0.02).multipliedBy(oneRay).toFixed(), + stableRateSlope2: new BigNumber(0.75).multipliedBy(oneRay).toFixed(), + baseLTVAsCollateral: '0', + liquidationThreshold: '0', + liquidationBonus: '0', + borrowingEnabled: true, + stableBorrowRateEnabled: true, + reserveDecimals: '18', + aTokenImpl: eContractid.AToken, + reserveFactor: '2000', +}; + export const strategyBUSD: IReserveParams = { optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(), baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(), From 29c292f24abdf527019634cffa5af70849f665ae Mon Sep 17 00:00:00 2001 From: 0xfoobar <0xfoobar1@gmail.com> Date: Fri, 11 Mar 2022 12:55:29 -0500 Subject: [PATCH 2/3] Remove trailing comma From b9dfd861de645280b2f32c6cf1bd66758f7302f4 Mon Sep 17 00:00:00 2001 From: 0xfoobar <0xfoobar1@gmail.com> Date: Fri, 11 Mar 2022 12:57:16 -0500 Subject: [PATCH 3/3] Remove trailing comma