Skip to content

Commit

Permalink
Merge branch 'main' into add-pyusd-merit-campaign
Browse files Browse the repository at this point in the history
  • Loading branch information
NandyBa authored Dec 11, 2024
2 parents 452bab2 + 6922bd1 commit 4a15d1c
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 36 deletions.
25 changes: 2 additions & 23 deletions .github/workflows/update-prod-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ jobs:
domain: 'app.aave.com',
artifact: 'out',
build_path: 'out'
},
{
name: 'Staging',
domain: 'staging.aave.com',
artifact: 'out_staging',
build_path: 'out_staging'
}
]
environment:
Expand All @@ -39,18 +33,6 @@ jobs:
name: ${{ matrix.environment.artifact }}
path: ${{ matrix.environment.build_path }}

# Only for staging environment
- name: pinata
id: pinata
if: matrix.environment.name == 'Staging'
uses: aave/pinata-action@35662944e92cf082457973f10aa42e48df179b47
with:
PINATA_API_KEY: '${{ secrets.PINATA_API_KEY }}'
PINATA_SECRET_KEY: '${{ secrets.PINATA_SECRET_KEY }}'
PIN_ALIAS: 'app-aave-staging'
BUILD_LOCATION: './out_staging'
CID_VERSION: 1

- name: Pin to primary IPFS server
id: ipfs-primary
uses: ./.github/actions/ipfs-pin
Expand All @@ -60,25 +42,22 @@ jobs:
IPFS_SERVER: '${{ secrets.IPFS_PRIMARY_SERVER }}'
IPFS_SERVER_KEY: '${{ secrets.IPFS_PRIMARY_SERVER_KEY }}'
BUILD_PATH: ${{ matrix.environment.build_path }}
PINATA_HASH: ${{ matrix.environment.name == 'Production' && inputs.PINATA_HASH || steps.pinata.outputs.hash }}
PINATA_HASH: ${{ inputs.PINATA_HASH }}

- uses: aave/cloudflare-update-action@0f2084730a068fab162853c4e7cc40537233d34a
with:
CF_API_TOKEN: '${{ secrets.CF_API_TOKEN }}'
CF_ZONE_ID: '${{ secrets.CF_ZONE_ID }}'
HASH: ${{ matrix.environment.name == 'Production' && inputs.PINATA_HASH || steps.pinata.outputs.hash }}
HASH: ${{ inputs.PINATA_HASH }}
CF_DEPLOYMENT_DOMAIN: ${{ matrix.environment.domain }}

# Only for production environment
- name: prepare release
if: matrix.environment.name == 'Production'
run: |
cp .github/release-template.md ./release-notes.md
sed -i 's|<ipfs-hash>|${{ inputs.PINATA_HASH }}|g' ./release-notes.md
echo "TAG=release-$(date '+%Y-%m-%d_%H-%M')" >> ${GITHUB_ENV}
- name: Create GH release
if: matrix.environment.name == 'Production'
uses: ncipollo/release-action@4c75f0f2e4ae5f3c807cf0904605408e319dcaac # v1.10.0
with:
name: Production release
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ There's a github action commenting the appropriate IPFS hash embedded in the Clo

For ease of use:

- the DNS of [https://staging.aave.com](https://staging.aave.com) will always point to the latest main IPFS hash with all networks enabled
- the DNS of [https://app.aave.com](https://app.aave.com) will always point to the latest main IPFS hash with disabled test networks
- the DNS of [https://app.aave.com](https://app.aave.com) will always point to the latest main IPFS hash.

### Testnet Networks Access
The interface now includes a feature toggle for testnet networks. Users can enable test networks by:
1. Opening the Settings menu
2. Toggling the "Testnet mode" switch
3. Once enabled, testnet networks (like Sepolia, Mumbai, etc.) will become available in the network selection menu

### Links known to work at some point:

Expand Down
5 changes: 5 additions & 0 deletions src/components/incentives/IncentivesTooltipContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ const IncentivesSymbolMap: {
symbol: 'aPYUSD',
aToken: true,
},
aAvaSAVAX: {
tokenIconSymbol: 'sAVAX',
symbol: 'asAVAX',
aToken: true,
},
};

interface IncentivesTooltipContentProps {
Expand Down
46 changes: 44 additions & 2 deletions src/hooks/useMeritIncentives.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ProtocolAction } from '@aave/contract-helpers';
import { ReserveIncentiveResponse } from '@aave/math-utils/dist/esm/formatters/incentive/calculate-reserve-incentives';
import { AaveV3Base, AaveV3Ethereum } from '@bgd-labs/aave-address-book';
import { AaveV3Avalanche, AaveV3Base, AaveV3Ethereum } from '@bgd-labs/aave-address-book';
import { useQuery } from '@tanstack/react-query';
import { CustomMarket } from 'src/ui-config/marketsConfig';

Expand All @@ -12,12 +12,16 @@ export enum MeritAction {
BASE_SUPPLY_CBBTC = 'base-supply-cbbtc',
BASE_SUPPLY_USDC = 'base-supply-usdc',
BASE_BORROW_USDC = 'base-borrow-usdc',
AVALANCHE_SUPPLY_BTCB = 'avalanche-supply-btcb',
AVALANCHE_SUPPLY_USDC = 'avalanche-supply-usdc',
AVALANCHE_SUPPLY_USDT = 'avalanche-supply-usdt',
AVALANCHE_SUPPLY_SAVAX = 'avalanche-supply-savax',
}

type MeritIncentives = {
totalAPR: number;
actionsAPR: {
[key in MeritAction]: number;
[key in MeritAction]: number | null | undefined;
};
};

Expand Down Expand Up @@ -120,6 +124,40 @@ const MERIT_DATA_MAP: Record<string, Record<string, MeritReserveIncentiveData[]>
},
],
},
[CustomMarket.proto_avalanche_v3]: {
['BTC.b']: [
{
action: MeritAction.AVALANCHE_SUPPLY_BTCB,
rewardTokenAddress: AaveV3Avalanche.ASSETS.BTCb.A_TOKEN,
rewardTokenSymbol: 'aAvaSAVAX',
protocolAction: ProtocolAction.supply,
},
],
USDC: [
{
action: MeritAction.AVALANCHE_SUPPLY_USDC,
rewardTokenAddress: AaveV3Avalanche.ASSETS.USDC.A_TOKEN,
rewardTokenSymbol: 'aAvaSAVAX',
protocolAction: ProtocolAction.supply,
},
],
USDt: [
{
action: MeritAction.AVALANCHE_SUPPLY_USDT,
rewardTokenAddress: AaveV3Avalanche.ASSETS.USDt.A_TOKEN,
rewardTokenSymbol: 'aAvaSAVAX',
protocolAction: ProtocolAction.supply,
},
],
sAVAX: [
{
action: MeritAction.AVALANCHE_SUPPLY_SAVAX,
rewardTokenAddress: AaveV3Avalanche.ASSETS.sAVAX.A_TOKEN,
rewardTokenSymbol: 'aAvaSAVAX',
protocolAction: ProtocolAction.supply,
},
],
},
};

export const useMeritIncentives = ({
Expand Down Expand Up @@ -156,6 +194,10 @@ export const useMeritIncentives = ({

const APR = data.actionsAPR[incentive.action];

if (!APR) {
return null;
}

return {
incentiveAPR: (APR / 100).toString(),
rewardTokenAddress: incentive.rewardTokenAddress,
Expand Down
7 changes: 4 additions & 3 deletions src/layouts/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import { AppHeader } from './AppHeader';
import TopBarNotify from './TopBarNotify';

export function MainLayout({ children }: { children: ReactNode }) {
const APP_BANNER_VERSION = '4.0.0';
const APP_BANNER_VERSION = '5.0.0';

return (
<>
<TopBarNotify
learnMoreLink="/markets/?marketName=proto_base_v3"
notifyText="Merit incentives are available for users who both supply cbBTC and borrow USDC."
learnMoreLink="https://oh7vm38ynd2.typeform.com/to/Fnw3rMyw"
notifyText="Looking to provide product feedback? We'd love to hear from you! 👉"
bannerVersion={APP_BANNER_VERSION}
buttonText="Share feedback"
/>
<AppHeader />
<Box component="main" sx={{ display: 'flex', flexDirection: 'column', flex: 1 }}>
Expand Down
2 changes: 1 addition & 1 deletion src/locales/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: de\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-11 18:06\n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"Last-Translator: \n"
"Language-Team: German\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand Down
2 changes: 1 addition & 1 deletion src/locales/el/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: el\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-11 18:06\n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"Last-Translator: \n"
"Language-Team: Greek\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand Down
2 changes: 1 addition & 1 deletion src/locales/es/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: es\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-11 18:06\n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"Last-Translator: \n"
"Language-Team: Spanish\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand Down
2 changes: 1 addition & 1 deletion src/locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: fr\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-11 18:06\n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"Last-Translator: \n"
"Language-Team: French\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
Expand Down
2 changes: 1 addition & 1 deletion src/locales/ru/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: ru\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-11 18:06\n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"Last-Translator: \n"
"Language-Team: Russian\n"
"Plural-Forms: nplurals=4; plural=((n%10==1 && n%100!=11) ? 0 : ((n%10 >= 2 && n%10 <=4 && (n%100 < 12 || n%100 > 14)) ? 1 : ((n%10 == 0 || (n%10 >= 5 && n%10 <=9)) || (n%100 >= 11 && n%100 <= 14)) ? 2 : 3));\n"
Expand Down
2 changes: 1 addition & 1 deletion src/locales/zh/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Language: zh\n"
"Project-Id-Version: aave-interface\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-11 18:06\n"
"PO-Revision-Date: 2024-11-27 18:06\n"
"Last-Translator: \n"
"Language-Team: Chinese Simplified\n"
"Plural-Forms: nplurals=1; plural=0;\n"
Expand Down

0 comments on commit 4a15d1c

Please sign in to comment.