Skip to content

Add Echo LSD/Strategy fees #3506

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

Closed
wants to merge 1 commit into from
Closed
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
48 changes: 48 additions & 0 deletions fees/echo-lsd/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Adapter, FetchResultV2, FetchV2 } from '../../adapters/types';
import { CHAIN } from '../../helpers/chains';
import fetchURL from '../../utils/fetchURL';

const echoStakingApiURL = 'https://vault.echo-protocol.xyz/external/v1/defillama/get_fee_revenue';

interface EchoStakingStats {
data:{
fee: string;
revenue: string;
}
}

const methodology = {
Fees: 'Staking rewards earned by all staked APT',
ProtocolRevenue: 'Staking rewards',
};

const fetchEchoStakingStats: FetchV2 = async ({
startTimestamp,
endTimestamp,
}): Promise<FetchResultV2> => {
const url = `${echoStakingApiURL}?type=lsd&startTimestamp=${startTimestamp}&endTimestamp=${endTimestamp}`;
const { data }: EchoStakingStats = await fetchURL(url);
const dailyFees = data.fee;
const dailyRevenue = data.revenue;
return {
dailyFees: dailyFees,
dailyRevenue: dailyRevenue,
dailyProtocolRevenue: dailyRevenue,
};
};

const adapter: Adapter = {
version: 2,
adapter: {
[CHAIN.APTOS]: {
fetch: fetchEchoStakingStats,
start: '2025-04-06',
meta: {
methodology,
},
},
},
};

export default adapter;

48 changes: 48 additions & 0 deletions fees/echo-strategy/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Adapter, FetchResultV2, FetchV2 } from '../../adapters/types';
import { CHAIN } from '../../helpers/chains';
import fetchURL from '../../utils/fetchURL';

const echoStrategyApiURL = 'https://vault.echo-protocol.xyz/external/v1/defillama/get_fee_revenue';

interface EchoStrategyStats {
data:{
fee: string;
revenue: string;
}
}

const methodology = {
Fees: 'Strategy rewards earned by all staked APT',
ProtocolRevenue: 'Strategy rewards',
};

const fetchEchoStrategyStats: FetchV2 = async ({
startTimestamp,
endTimestamp,
}): Promise<FetchResultV2> => {
const url = `${echoStrategyApiURL}?type=strategy&startTimestamp=${startTimestamp}&endTimestamp=${endTimestamp}`;
const { data }: EchoStrategyStats = await fetchURL(url);
const dailyFees = data.fee;
const dailyRevenue = data.revenue;
return {
dailyFees: dailyFees,
dailyRevenue: dailyRevenue,
dailyProtocolRevenue: dailyRevenue,
};
};

const adapter: Adapter = {
version: 2,
adapter: {
[CHAIN.APTOS]: {
fetch: fetchEchoStrategyStats,
start: '2025-04-06',
meta: {
methodology,
},
},
},
};

export default adapter;

Loading