Skip to content

add revenue endpoint #2878

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

Merged
merged 3 commits into from
Apr 30, 2025
Merged

add revenue endpoint #2878

merged 3 commits into from
Apr 30, 2025

Conversation

0xd1esel
Copy link
Contributor

No description provided.

@llamabutler
Copy link

The thalaswap-v2 adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts dexs thalaswap-v2

🦙 Running THALASWAP-V2 adapter 🦙
---------------------------------------------------
Start Date:	Sat, 12 Apr 2025 00:00:00 GMT
End Date:	Sun, 13 Apr 2025 00:00:00 GMT
---------------------------------------------------

APTOS 👇
Backfill start time: 4/4/2023
Total volume: 1.17 B
Daily volume: 14.41 M
Total fees: 696.40 k
Daily fees: 8.98 k
Total revenue: 348.18 k
Daily revenue: 4.49 k
End timestamp: 1744502399 (2025-04-12T23:59:59.000Z)

1 similar comment
@llamabutler
Copy link

The thalaswap-v2 adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts dexs thalaswap-v2

🦙 Running THALASWAP-V2 adapter 🦙
---------------------------------------------------
Start Date:	Sat, 12 Apr 2025 00:00:00 GMT
End Date:	Sun, 13 Apr 2025 00:00:00 GMT
---------------------------------------------------

APTOS 👇
Backfill start time: 4/4/2023
Total volume: 1.17 B
Daily volume: 14.41 M
Total fees: 696.40 k
Daily fees: 8.98 k
Total revenue: 348.18 k
Daily revenue: 4.49 k
End timestamp: 1744502399 (2025-04-12T23:59:59.000Z)


const totalRevenueQuery = (await fetchURL(revenueEndpoint(0, "ALL")))?.data;
const totalRevenue = totalRevenueQuery.reduce(
(partialSum: number, a: IVolumeall) => partialSum + a.value,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a filter here to ignore datapoints with a.timestamp > timestamp

this way, we avoid setting setting incorrect total revenue for past records while refilling, same check for volume

Copy link
Member

@g1nt0ki g1nt0ki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@g1nt0ki g1nt0ki mentioned this pull request Apr 14, 2025
@g1nt0ki g1nt0ki self-assigned this Apr 14, 2025
@llamabutler
Copy link

The thalaswap-v2 adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts dexs thalaswap-v2

🦙 Running THALASWAP-V2 adapter 🦙
---------------------------------------------------
Start Date:	Tue, 29 Apr 2025 00:00:00 GMT
End Date:	Wed, 30 Apr 2025 00:00:00 GMT
---------------------------------------------------

APTOS 👇
Backfill start time: 4/4/2023
Daily volume: 35.42 M
Daily fees: 24.41 k
Daily revenue: 12.21 k

@g1nt0ki g1nt0ki merged commit 928bf19 into DefiLlama:master Apr 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants