Skip to content
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

add justbet fees & volume aggregator #2706

Merged
merged 6 commits into from
Mar 31, 2025

Conversation

SirCreed
Copy link
Contributor

No description provided.

@llamabutler
Copy link

The justbet adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts aggregators justbet

🦙 Running JUSTBET adapter 🦙
---------------------------------------------------
Start Date:	Tue, 25 Mar 2025 07:44:52 GMT
End Date:	Wed, 26 Mar 2025 07:44:52 GMT
---------------------------------------------------

[Error: TypeError: Cannot read properties of null (reading 'call')] {
  _underlyingError: "TypeError: Cannot read properties of null (reading 'call')",
  _isCustomError: true,
  chain: 'winr'
}

@llamabutler
Copy link

The justbet adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees justbet

🦙 Running JUSTBET adapter 🦙
---------------------------------------------------
Start Date:	Tue, 25 Mar 2025 07:44:58 GMT
End Date:	Wed, 26 Mar 2025 07:44:58 GMT
---------------------------------------------------

[Error: TypeError: Cannot read properties of null (reading 'call')] {
  _underlyingError: "TypeError: Cannot read properties of null (reading 'call')",
  _isCustomError: true,
  chain: 'winr'
}

@llamabutler
Copy link

The justbet adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts aggregators justbet

🦙 Running JUSTBET adapter 🦙
---------------------------------------------------
Start Date:	Tue, 25 Mar 2025 07:46:30 GMT
End Date:	Wed, 26 Mar 2025 07:46:30 GMT
---------------------------------------------------

[Error: TypeError: Cannot read properties of null (reading 'call')] {
  _underlyingError: "TypeError: Cannot read properties of null (reading 'call')",
  _isCustomError: true,
  chain: 'winr'
}

@llamabutler
Copy link

The justbet adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees justbet

🦙 Running JUSTBET adapter 🦙
---------------------------------------------------
Start Date:	Tue, 25 Mar 2025 07:46:35 GMT
End Date:	Wed, 26 Mar 2025 07:46:35 GMT
---------------------------------------------------

[Error: TypeError: Cannot read properties of null (reading 'call')] {
  _underlyingError: "TypeError: Cannot read properties of null (reading 'call')",
  _isCustomError: true,
  chain: 'winr'
}

@SirCreed
Copy link
Contributor Author

I added winr rpc to .env file while running tests

@g1nt0ki g1nt0ki self-assigned this Mar 26, 2025

return {
revenue: amountUsd,
fees: (amountUsd * 60) / 100,
Copy link
Member

Choose a reason for hiding this comment

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

hi, how can the revenue be higher than the fees charged to the user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you’re right, the fee calculation should be revenue, and the revenue calculation should be a fee. I will change it.

@llamabutler
Copy link

The justbet adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts aggregators justbet

🦙 Running JUSTBET adapter 🦙
---------------------------------------------------
Start Date:	Tue, 25 Mar 2025 19:17:14 GMT
End Date:	Wed, 26 Mar 2025 19:17:14 GMT
---------------------------------------------------

WINR 👇
Backfill start time: 20/11/2024
Total volume: 90.53 M
Daily volume: -446781
End timestamp: 1743016633 (2025-03-26T19:17:13.000Z)

Copy link
Member

Choose a reason for hiding this comment

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

this is not an aggregator, closer to a dex?

Copy link
Member

Choose a reason for hiding this comment

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

also, any idea why I am getting negative value for today after the refactor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you’re right. I’ll start by moving to the DEX section first. The fromApi caches cause the returnEpochResultInUsdByAddress function to always calculate using the latest price of the vault token address. As a result, volume fluctuations appear negative due to price changes. To address this, we should use the returnEpochResultInActiveEpochByAddress function and convert the values to USD using the same price for both yesterday and today. I'll send updates

@llamabutler
Copy link

The justbet adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees justbet

🦙 Running JUSTBET adapter 🦙
---------------------------------------------------
Start Date:	Tue, 25 Mar 2025 19:17:19 GMT
End Date:	Wed, 26 Mar 2025 19:17:19 GMT
---------------------------------------------------

WINR 👇
Backfill start time: 20/11/2024
Daily revenue: 1.87 k
Total revenue: 516.04 k
Daily holders revenue: 374
Total holders revenue: 103.21 k
End timestamp: 1743016638 (2025-03-26T19:17:18.000Z)

@llamabutler
Copy link

The justbet adapter exports:

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

🦙 Running JUSTBET adapter 🦙
---------------------------------------------------
Start Date:	Thu, 27 Mar 2025 08:25:56 GMT
End Date:	Fri, 28 Mar 2025 08:25:56 GMT
---------------------------------------------------

WINR 👇
Backfill start time: 20/11/2024
Total volume: 88.95 M
Daily volume: 0
End timestamp: 1743150355 (2025-03-28T08:25:55.000Z)

@llamabutler
Copy link

The justbet adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees justbet

🦙 Running JUSTBET adapter 🦙
---------------------------------------------------
Start Date:	Thu, 27 Mar 2025 08:26:03 GMT
End Date:	Fri, 28 Mar 2025 08:26:03 GMT
---------------------------------------------------

WINR 👇
Backfill start time: 20/11/2024
Daily fees: -4344
Total fees: 500.04 k
Daily revenue: -2606
Total revenue: 300.02 k
Daily holders revenue: -869
Total holders revenue: 100.01 k
End timestamp: 1743150362 (2025-03-28T08:26:02.000Z)

@llamabutler
Copy link

The justbet adapter exports:

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

🦙 Running JUSTBET adapter 🦙
---------------------------------------------------
Start Date:	Sun, 30 Mar 2025 12:02:07 GMT
End Date:	Mon, 31 Mar 2025 12:02:07 GMT
---------------------------------------------------

WINR 👇
Backfill start time: 20/11/2024
Total volume: 86.14 M
Daily volume: 0
End timestamp: 1743422526 (2025-03-31T12:02:06.000Z)

@llamabutler
Copy link

The justbet adapter exports:

> [email protected] test
> ts-node --transpile-only cli/testAdapter.ts fees justbet

🦙 Running JUSTBET adapter 🦙
---------------------------------------------------
Start Date:	Sun, 30 Mar 2025 12:02:16 GMT
End Date:	Mon, 31 Mar 2025 12:02:16 GMT
---------------------------------------------------

WINR 👇
Backfill start time: 20/11/2024
Daily fees: -2141
Total fees: 480.88 k
Daily revenue: -1285
Total revenue: 288.53 k
Daily holders revenue: -428
Total holders revenue: 96.18 k
End timestamp: 1743422535 (2025-03-31T12:02:15.000Z)

@g1nt0ki g1nt0ki merged commit 0732eb8 into DefiLlama:master Mar 31, 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