From 5ba26ee85239038ce596a400a7752b7f9d0bbf25 Mon Sep 17 00:00:00 2001 From: whichghost Date: Sat, 21 Sep 2024 22:23:16 +0800 Subject: [PATCH 1/3] add polter base --- fees/polter/index.ts | 107 +++++++++++++++++++++++++++---------------- 1 file changed, 67 insertions(+), 40 deletions(-) diff --git a/fees/polter/index.ts b/fees/polter/index.ts index 63443e8231..7e97bad2f0 100644 --- a/fees/polter/index.ts +++ b/fees/polter/index.ts @@ -15,49 +15,66 @@ const headers: THeader = { const RECORDS_PER_PAGE = 1000 const endpoints: any = { [CHAIN.FANTOM]: "https://api.studio.thegraph.com/query/71811/polter/version/latest", + [CHAIN.BASE]: "https://api.studio.thegraph.com/query/71811/polter-base/version/latest", }; const tokens: any = { - '0x5c725631fd299703d0a74c23f89a55c6b9a0c52f': { - gecko: 'polter-finance', - decimals: 18 - }, - '0xbbce4b1513d4285bd7a59c2c63835535151c8e7c': { - gecko: 'fantom', - decimals: 18 - }, - '0x5a75a5f3a637cc9394816efc553d102302d4cfcd': { - gecko: 'usd-coin', - decimals: 6 - }, - '0xa826b29d81caef8c9aa212f172ab3ef00566e91e': { - gecko: 'magic-internet-money', - decimals: 18 - }, - '0x4bf6f3210488091a0111daf7ab7cf840a3af8022': { - gecko: 'stader-sftmx', - decimals: 18 - }, - '0x0299553df0fa396c0f6f3456d293608e189c3cf3': { - gecko: 'solana', - decimals: 18 - }, - '0xb49da25f726451ba0e7c7e1c0b273322d2656514': { - gecko: 'layerzero-usdc', - decimals: 6 - }, - '0xc60f08059586849810d9c19c67919d2d99174ecf': { - gecko: 'axlusdc', - decimals: 6 - }, - '0xa37e0d5590436bd9abd2803c18c328a650b236ee': { - gecko: 'bitcoin', - decimals: 8 + fantom: { + '0x5c725631fd299703d0a74c23f89a55c6b9a0c52f': { + gecko: 'polter-finance', + decimals: 18 + }, + '0xbbce4b1513d4285bd7a59c2c63835535151c8e7c': { + gecko: 'fantom', + decimals: 18 + }, + '0x5a75a5f3a637cc9394816efc553d102302d4cfcd': { + gecko: 'usd-coin', + decimals: 6 + }, + '0xa826b29d81caef8c9aa212f172ab3ef00566e91e': { + gecko: 'magic-internet-money', + decimals: 18 + }, + '0x4bf6f3210488091a0111daf7ab7cf840a3af8022': { + gecko: 'stader-sftmx', + decimals: 18 + }, + '0x0299553df0fa396c0f6f3456d293608e189c3cf3': { + gecko: 'solana', + decimals: 18 + }, + '0xb49da25f726451ba0e7c7e1c0b273322d2656514': { + gecko: 'layerzero-usdc', + decimals: 6 + }, + '0xc60f08059586849810d9c19c67919d2d99174ecf': { + gecko: 'axlusdc', + decimals: 6 + }, + '0xa37e0d5590436bd9abd2803c18c328a650b236ee': { + gecko: 'bitcoin', + decimals: 8 + }, + '0x328c7a684f160c089ebff07ff1b5a417f024979e': { + gecko: 'bridged-wrapped-ether-stargate', + decimals: 18 + } }, - '0x328c7a684f160c089ebff07ff1b5a417f024979e': { - gecko: 'bridged-wrapped-ether-stargate', - decimals: 18 - } + base: { + '0x4200000000000000000000000000000000000006': { + gecko: 'ethereum', + decimals: 18 + }, + '0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf': { + gecko: 'coinbase-wrapped-btc', + decimals: 8 + }, + '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913': { + gecko: 'usd-coin', + decimals: 6 + } + } } @@ -99,7 +116,7 @@ const fetch: FetchV2 = async ({ chain, startTimestamp, endTimestamp, createBalan rewardsPaids.push(...rewardsPaid) } rewardsPaids.forEach((reward: RewardsPaid) => { - const {gecko, decimals} = tokens[reward.rewardsToken] + const {gecko, decimals} = tokens[chain][reward.rewardsToken] if (!gecko) { return } @@ -126,6 +143,16 @@ const adapter: Adapter = { } } }, + [CHAIN.BASE]: { + fetch: fetch, + start: 19746482, // Sep-14-2024 02:51:51 AM +UTC + meta: { + methodology: { + Fees: "lockers' revenue = stakers' revenue + 50% penalty from early exit", + Revenue: "depositors' revenue from borrow interests", + } + } + }, }, } From b010de238376bcd9b8eb6a375d2f3e2307edbc59 Mon Sep 17 00:00:00 2001 From: whichghost Date: Sat, 21 Sep 2024 22:31:01 +0800 Subject: [PATCH 2/3] update ptoken address --- fees/polter/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fees/polter/index.ts b/fees/polter/index.ts index 7e97bad2f0..22d73f7355 100644 --- a/fees/polter/index.ts +++ b/fees/polter/index.ts @@ -62,15 +62,15 @@ const tokens: any = { } }, base: { - '0x4200000000000000000000000000000000000006': { + '0xCa0d0CDAf75681be68Cb581301F282cbb82e7df1': { gecko: 'ethereum', decimals: 18 }, - '0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf': { + '0x2E8775d68dE5D7b5D296d2640469c322aDe06C18': { gecko: 'coinbase-wrapped-btc', decimals: 8 }, - '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913': { + '0x7D5c272E6ef7c21bF3D684A8F6C30eE4A8572bb3': { gecko: 'usd-coin', decimals: 6 } From c4d45856a1a0db283a6d97cdcf2d7d91b52b457f Mon Sep 17 00:00:00 2001 From: whichghost Date: Sat, 21 Sep 2024 22:58:14 +0800 Subject: [PATCH 3/3] add polter and replace token proxy --- fees/polter/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fees/polter/index.ts b/fees/polter/index.ts index 22d73f7355..ac993537d8 100644 --- a/fees/polter/index.ts +++ b/fees/polter/index.ts @@ -62,15 +62,19 @@ const tokens: any = { } }, base: { - '0xCa0d0CDAf75681be68Cb581301F282cbb82e7df1': { + '0xa0820613976b441e2c6a90e4877e2fb5f7d72552': { + gecko: 'polter-finance', + decimals: 18 + }, + '0xca4e076c6d8a84a990986a3c405093087991a8fe': { gecko: 'ethereum', decimals: 18 }, - '0x2E8775d68dE5D7b5D296d2640469c322aDe06C18': { + '0x2a96e27e204ef366671232df28f147fa30e735ce': { gecko: 'coinbase-wrapped-btc', decimals: 8 }, - '0x7D5c272E6ef7c21bF3D684A8F6C30eE4A8572bb3': { + '0x1ddaeebbd69dccc92f5cf76593104976b9c62434': { gecko: 'usd-coin', decimals: 6 }