Skip to content

Conversation

giantHound
Copy link
Contributor

Hello, DefiLama Team!
This PR is a fix/upgrade to the previous PuppyFun Connector. We now rely on in built function (addTokensReceived) in fees & revenue metic. The idea is that fees == all income to the fee wallet. Daily Fees are collected by specifying the fromBlock method in options manually (to collect all transfers from a specific block).

Thank you

@llamabutler
Copy link

The puppyfun adapter exports:

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

🦙 Running PUPPYFUN adapter 🦙
---------------------------------------------------
Start Date:	Mon, 13 Oct 2025 06:04:57 GMT
End Date:	Tue, 14 Oct 2025 06:04:57 GMT
---------------------------------------------------

Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
{
  totalIncome: '1101944802716288400',
  dailyIncome: '1101944802716288400'
}
[Error: Request failed with status code 403] {
  url: 'https://bd-fun-defilama-ts-backend-main.puppy.fun/lama-api/volume',
  method: 'GET',
  axiosError: 'Forbidden',
  chain: 'bsc'
}

@treeoflife2 treeoflife2 self-assigned this Oct 14, 2025
@llamabutler
Copy link

The puppyfun adapter exports:

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

🦙 Running PUPPYFUN adapter 🦙
---------------------------------------------------
Start Date:	Mon, 13 Oct 2025 07:48:27 GMT
End Date:	Tue, 14 Oct 2025 07:48:27 GMT
---------------------------------------------------

Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
[Error: Request failed with status code 403] {
  url: 'https://bd-fun-defilama-ts-backend-main.puppy.fun/lama-api/volume',
  method: 'GET',
  axiosError: 'Forbidden',
  chain: 'bsc'
}

@llamabutler
Copy link

The puppyfun adapter exports:

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

🦙 Running PUPPYFUN adapter 🦙
---------------------------------------------------
Start Date:	Mon, 13 Oct 2025 07:49:02 GMT
End Date:	Tue, 14 Oct 2025 07:49:02 GMT
---------------------------------------------------

Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
[Error: Request failed with status code 403] {
  url: 'https://bd-fun-defilama-ts-backend-main.puppy.fun/lama-api/volume',
  method: 'GET',
  axiosError: 'Forbidden',
  chain: 'bsc'
}

@treeoflife2
Copy link
Member

@giantHound i've refactored the adapter code, we like to keep it clean, and we don't support totalvolume/fee/revenue dimensions, as it redundant metric(as we can directly do calculation from our db).

for volume we get the 403 error can you check?

@giantHound
Copy link
Contributor Author

giantHound commented Oct 14, 2025

Huge Thanks to you! I will check it. Hmm, this code runs with no errors (like 403) on my local machine

@treeoflife2
Copy link
Member

Huge Thanks to you! I will check it. Hmm, this code runs with no errors (like 403) on my local machine

check this run result
#4443 (comment)

@llamabutler
Copy link

The puppyfun adapter exports:

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

🦙 Running PUPPYFUN adapter 🦙
---------------------------------------------------
Start Date:	Mon, 13 Oct 2025 09:12:11 GMT
End Date:	Tue, 14 Oct 2025 09:12:11 GMT
---------------------------------------------------

Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
[Error: Request failed with status code 403] {
  url: 'https://bd-fun-defilama-ts-backend-main.puppy.fun/lama-api/volume',
  method: 'GET',
  axiosError: 'Forbidden',
  chain: 'bsc'
}

@llamabutler
Copy link

The puppyfun adapter exports:

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

🦙 Running PUPPYFUN adapter 🦙
---------------------------------------------------
Start Date:	Mon, 13 Oct 2025 10:25:13 GMT
End Date:	Tue, 14 Oct 2025 10:25:13 GMT
---------------------------------------------------

Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
Token transfers: Failed to use indexer, falling back to logs bsc Llama Indexer v2 URL/api key is not set
Error: Allium API Key is required[Ignore this error for github bot]
    at _queryAllium (/home/runner/work/dimension-adapters/dimension-adapters/helpers/allium.ts:47:11)
    at /home/runner/work/dimension-adapters/dimension-adapters/helpers/allium.ts:9:71
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:23:31
    at run (/home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:23:43)
    at /home/runner/work/dimension-adapters/dimension-adapters/node_modules/p-limit/index.js:45:20 {
  chain: 'bsc'
}

@giantHound
Copy link
Contributor Author

Hello again! Could you please tell me, is it obligatory to use a Allium API key in my case here& (I want to query Native coin income too) using "getETHReceived" method. The error says: Ignore the error in github bot. Does it mean, that you can test it somehow on your end with the required API key?

About the 403 issue
I have just tested it again locally, everything works as it should, the link is the same as yesterday (before the PR fixes)

The response locally is the following (before inserting the Allium query)

BSC 👇
Daily volume: 129.50 k
Daily fees: 1.28 k
Daily revenue: 1.28 k
End timestamp: 1760436787 (2025-10-14T10:13:07.000Z)

Thank you for help!

@giantHound
Copy link
Contributor Author

Снимок экрана 2025-10-14 в 16 04 45 This is the same query executed in POSTman (as you can see, the response is correct)

@treeoflife2
Copy link
Member

@giantHound i believe puppy.fun is restricated for many regions, i tried using VPN

@giantHound
Copy link
Contributor Author

Hmm. Okay I will try to figure out another solution (maybe using getLogs and etc)
Thank you

@giantHound
Copy link
Contributor Author

Perhaps there is an issue with fetchUrl method? The httpGet methow worker for that query just fine in the past (until todays morning)

@treeoflife2
Copy link
Member

Perhaps there is an issue with fetchUrl method? The httpGet methow worker for that query just fine in the past (until todays morning)

that's not a issue, can you use vpn and check different locations, you would get the error, just by visiting the puppy.fun, most regions are geo-blocked for your site.

@giantHound
Copy link
Contributor Author

I guess the puppy.fun dapp is locked in several locations, however the Lama Connector with the same API route worked until the latest update (today) with no 403 issues. You can see that the URL is the same. It could not be possible with IP restrictions. Moreover the backend does not have any geo-locks at all (tried with VPN and without).

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