Skip to content

Add alUSD as borrowable asset #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: aave-v2-asset-listing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export interface iAssetCommon<T> {
[key: string]: T;
}
export interface iAssetBase<T> {
ALUSD: T;
WETH: T;
DAI: T;
TUSD: T;
Expand Down Expand Up @@ -213,6 +214,7 @@ export type iAssetsWithoutUSD<T> = Omit<iAssetBase<T>, 'USD'>;

export type iAavePoolAssets<T> = Pick<
iAssetsWithoutUSD<T>,
| 'ALUSD'
| 'DAI'
| 'TUSD'
| 'USDC'
Expand Down Expand Up @@ -243,6 +245,7 @@ export type iAavePoolTokens<T> = Omit<iAavePoolAssets<T>, 'ETH'>;
export type iAssetAggregatorBase<T> = iAssetsWithoutETH<T>;

export enum TokenContractId {
ALUSD = 'ALUSD',
DAI = 'DAI',
AAVE = 'AAVE',
TUSD = 'TUSD',
Expand All @@ -264,7 +267,7 @@ export enum TokenContractId {
YFI = 'YFI',
UNI = 'UNI',
ENJ = 'ENJ',
xSUSHI = 'xSUSHI'
xSUSHI = 'xSUSHI',
}

export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams {
Expand Down
4 changes: 4 additions & 0 deletions markets/aave/commons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
},
Expand Down
4 changes: 4 additions & 0 deletions markets/aave/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { IAaveConfiguration, EthereumNetwork, eEthereumNetwork } from '../../hel

import { CommonsConfig } from './commons';
import {
strategyALUSD,
strategyBUSD,
strategyDAI,
strategySUSD,
Expand Down Expand Up @@ -34,6 +35,7 @@ export const AaveConfig: IAaveConfiguration = {
MarketId: 'Aave genesis market',
ProviderId: 1,
ReservesConfig: {
ALUSD: strategyALUSD,
AAVE: strategyAAVE,
BAT: strategyBAT,
BUSD: strategyBUSD,
Expand Down Expand Up @@ -106,6 +108,7 @@ export const AaveConfig: IAaveConfiguration = {
},
[EthereumNetwork.main]: {
AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9',
ALUSD: '0xBC6DA0FE9aD5f3b0d58160288917AA56653660E9',
BAT: '0x0d8775f648430679a709e98d2b0cb6250d2887ef',
BUSD: '0x4Fabb145d64652a948d72533023f6E7A623C7C53',
DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
Expand All @@ -129,6 +132,7 @@ export const AaveConfig: IAaveConfiguration = {
},
[EthereumNetwork.tenderlyMain]: {
AAVE: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9',
ALUSD: '0xBC6DA0FE9aD5f3b0d58160288917AA56653660E9',
BAT: '0x0d8775f648430679a709e98d2b0cb6250d2887ef',
BUSD: '0x4Fabb145d64652a948d72533023f6E7A623C7C53',
DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
Expand Down
17 changes: 17 additions & 0 deletions markets/aave/reservesConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down