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

New nexion project added #13086

Merged
merged 20 commits into from
Jan 26, 2025
Merged

New nexion project added #13086

merged 20 commits into from
Jan 26, 2025

Conversation

Lefgk
Copy link
Contributor

@Lefgk Lefgk commented Jan 14, 2025

NOTE

Please enable "Allow edits by maintainers" while putting up the PR.


  • If you would like to add a volume adapter please submit the PR here.
  • If you would like to add a liquidations adapter, please refer to this readme document for details.
  1. Once your adapter has been merged, it takes time to show on the UI. If more than 24 hours have passed, please let us know in Discord.
  2. Sorry, We no longer accept fetch adapter for new projects, we prefer the tvl to computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
  3. Please fill the form below only if the PR is for listing a new protocol else it can be ignored/replaced with reason/details about the PR
  4. For updating listing info It is a different repo, you can find your listing in this file: https://github.com/DefiLlama/defillama-server/blob/master/defi/src/protocols/data2.ts, you can edit it there and put up a PR
  5. Do not edit/push package-lock.json file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CI
  6. No need to go to our discord and announce that you've created a PR, we monitor all PRs and will review it asap

Name (to be shown on DefiLlama):

Nexion

Twitter Link:

https://x.com/nexionpulse

List of audit links if any:
Website Link:

https://nexionpulse.com/

Logo (High resolution, will be shown with rounded borders):
Current TVL:
Treasury Addresses (if the protocol has treasury)
Chain:
Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed): (https://api.coinmarketcap.com/data-api/v3/map/all?listing_status=active,inactive,untracked&start=1&limit=10000)
Short Description (to be shown on DefiLlama):

NEXION — Built on PulseChain, powered by NEON
NEXION aims to become a widely used dApp ecosystem that offers users a variety of ways to participate and earn rewards!

Token address and ticker if any:

0xF2Da3942616880E52e841E5C504B5A9Fba23FFF0
NEON

Category (full list at https://defillama.com/categories) *Please choose only one:

Yield

Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.):
Implementation Details: Briefly describe how the oracle is integrated into your project:
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage:
forkedFrom (Does your project originate from another project):
methodology (what is being counted as tvl, how is tvl being calculated):

We add total value of Buy and Burn contract and the total assets in Holovault farm.

Github org/user (Optional, if your code is open source, we can track activity):

@llamabutler
Copy link

Error while running adapter at projects/nexion:

ReferenceError: ADDRESSES is not defined
Truncated error stack:

    at Object.<anonymous> (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/nexion/index.js:22:10)
    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:127:12
    at Object.<anonymous> (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:259:3)
Error saving cache: Error: ENOENT: no such file or directory, open '/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/node_modules/@defillama/sdk/build/util/local_cache/zlib-1.0/BlockCache.json'

@llamabutler
Copy link

Error while running adapter at projects/nexion:

TypeError: Cannot read properties of undefined (reading 'toLowerCase')
Truncated error stack:

    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/tokenMapping.js:143:50
    at Array.forEach (<anonymous>)
    at getUniqueAddresses (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/tokenMapping.js:143:13)
    at sumTokens2 (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/unwrapLPs.js:794:12)
    at tvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/nexion/index.js:30:10)
    at getTvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:52:29)
    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:173:15
    at Array.map (<anonymous>)
    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:161:29
    at Array.map (<anonymous>)
Error saving cache: Error: ENOENT: no such file or directory, open '/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/node_modules/@defillama/sdk/build/util/local_cache/zlib-1.0/BlockCache.json'

@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse                     15.85 k
pulse-staking             0
staking                   0

total                    15.84 k 

@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse                     15.85 k
pulse-staking             0
staking                   0

total                    15.84 k 

@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse                     15.85 k
pulse-staking             0
staking                   0

total                    15.84 k 

@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse                     15.85 k
pulse-staking             0
staking                   0

total                    15.84 k 

@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse                     15.85 k
pulse-staking             0
pulse-pool2               0
staking                   0
pool2                     0

total                    15.84 k 

@g1nt0ki g1nt0ki self-assigned this Jan 14, 2025

const plsin = await api.call({
target: contracts.NEONFarm,
abi: farmAbi.valueofthis,
Copy link
Member

Choose a reason for hiding this comment

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

hmm, what does this call return?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A portion of user deposits are sent to this farm contract. valueofthis() tracks the plsvalue received.

function valueofthis() external view returns (uint256 plsvalue) {
address[] memory path = new address;
path[0] = address(PLS);
path[1] = address(DAI);

    uint256 price = ISwapRouter(PULSEX_V2).getAmountsOut(10 ** 18, path)[1];
    plsvalue = (plsin * price) / 10 ** 18;
}

This is then used to buy DAI-PLS LP and the LP is burned. It stays there forever and rewards users. We rehypothecate on this farm.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, no. If the LP is burnt, it is not tvl, we can count what users can withdraw as tvl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, anywhere else i could add this value? As staking perhaps? If not thats ok , we'll leave it out thank you

Copy link
Member

Choose a reason for hiding this comment

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

sorry, yeah. you need to leave it out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok what about native token and LP?
We also have a staking where users stake NEON and earn NEON and INC token.
we also have around 9k $ in LP (NEON/PLS, NEON/DAI etc..all NEON pairs) Can i add these as tvl?

Copy link
Member

Choose a reason for hiding this comment

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

we can count staked NEON under staking
We can count staked NEON/PLS, etc LPS under pool2

But we can count these only if the user can withdraw their deposits, else no.

async function tvl(api) {
return sumTokens2({
api,
owner: contracts.NEONBuynBurn,
Copy link
Member

Choose a reason for hiding this comment

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

sorry, we can treat only the user deposits as tvl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A portion of user deposits go to buyNBurn contract. So these funds are from user deposits. Or am i missing something?

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 explain the mechanism, thought this comes from fees, that is usually the case when protocols use the term buyback and burn

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Users deposit PLS in auction and receive our token NEON. A portion of pls goes to this BB contract. Every 1 hour a function is triggered that uses PLS to buy NEON and burnt it.

Copy link
Member

Choose a reason for hiding this comment

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

yes, unless user can withdraw the deposited PLS, we treat this as a swap in a dex and not locked value.

sdk.util.sumSingleBalance(balances, contracts.NEONFarm, plsin2);
return balances;
}
const lps = ["0xE56043671df55dE5CDf8459710433C10324DE0aE"]
Copy link
Member

Choose a reason for hiding this comment

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

since this is DAI-PLS LP and has nothing to do with your protocol, you can count it as tvl instead of pool2 if you want

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

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.

.

@llamabutler
Copy link

Error while running adapter at projects/nexion:

TypeError: i.toLowerCase is not a function
Truncated error stack:

    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/tokenMapping.js:143:50
    at Array.forEach (<anonymous>)
    at getUniqueAddresses (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/tokenMapping.js:143:13)
    at sumTokens2 (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/unwrapLPs.js:795:12)
    at tvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/nexion/index.js:31:10)
    at getTvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:52:29)
    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:173:15
    at Array.map (<anonymous>)
    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:161:29
    at Array.map (<anonymous>)
Error saving cache: Error: ENOENT: no such file or directory, open '/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/node_modules/@defillama/sdk/build/util/local_cache/zlib-1.0/BlockCache.json'

@llamabutler
Copy link

Error while running adapter at projects/nexion:

TypeError: i.toLowerCase is not a function
Truncated error stack:

    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/tokenMapping.js:143:50
    at Array.forEach (<anonymous>)
    at getUniqueAddresses (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/tokenMapping.js:143:13)
    at sumTokens2 (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/unwrapLPs.js:795:12)
    at tvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/nexion/index.js:31:10)
    at getTvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:52:29)
    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:173:15
    at Array.map (<anonymous>)
    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:161:29
    at Array.map (<anonymous>)
Error saving cache: Error: ENOENT: no such file or directory, open '/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/node_modules/@defillama/sdk/build/util/local_cache/zlib-1.0/BlockCache.json'

@llamabutler
Copy link

Error while running adapter at projects/nexion:

TypeError: i.toLowerCase is not a function
Truncated error stack:

    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/tokenMapping.js:144:50
    at Array.forEach (<anonymous>)
    at getUniqueAddresses (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/tokenMapping.js:144:13)
    at sumTokens2 (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/unwrapLPs.js:795:12)
    at tvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/nexion/index.js:31:10)
    at getTvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:52:29)
    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:173:15
    at Array.map (<anonymous>)
    at /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:161:29
    at Array.map (<anonymous>)
Error saving cache: Error: ENOENT: no such file or directory, open '/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/node_modules/@defillama/sdk/build/util/local_cache/zlib-1.0/BlockCache.json'

@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse                     15.73 k
pulse-staking             0
staking                   0

total                    15.73 k 

@llamabutler
Copy link

Error while running adapter at projects/nexion:

[object Object]

@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse                     15.74 k

total                    15.74 k 

@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse                     15.69 k

total                    15.69 k 

@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse                     17.05 k

total                    17.05 k 

@Lefgk Lefgk requested a review from g1nt0ki January 15, 2025 09:12
@Lefgk
Copy link
Contributor Author

Lefgk commented Jan 15, 2025

.

I added back DAI-PLS LP as tvl

@g1nt0ki
Copy link
Member

g1nt0ki commented Jan 24, 2025

Havent approved this PR because, you are still counting the tvl in buyback and burn wallet

"
we can count staked NEON under staking
We can count staked NEON/PLS, etc LPS under pool2

But we can count these only if the user can withdraw their deposits, else no."

@Lefgk
Copy link
Contributor Author

Lefgk commented Jan 24, 2025

Havent approved this PR because, you are still counting the tvl in buyback and burn wallet

" we can count staked NEON under staking We can count staked NEON/PLS, etc LPS under pool2

But we can count these only if the user can withdraw their deposits, else no."

Hello,

i added staking for neon. Users can withdraw this anytime without fees.
I removed tvl buyback + burn wallet

im confused, let's just do these :

Staking : Users can stake NEON in our NEONStaking and withdraw at any time.
tvl : contracts has DAI-PLS LP from user deposits and it can be withdrawn after 500 days.

There is an error shown that is other project :
/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/listapie/index.js
13:3 error 'bal' is not defined no-undef

@llamabutler
Copy link

Error while running adapter at projects/nexion:

Error: Cannot find module './helper/staking'
Require stack:
- /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/nexion/index.js
- /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js
Truncated error stack:

    at Object.<anonymous> (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/nexion/index.js:6:21)
Error saving cache: Error: ENOENT: no such file or directory, open '/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/node_modules/@defillama/sdk/build/util/local_cache/zlib-1.0/BlockCache.json'

@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse                     59
pulse-staking             0
staking                   0

total                    59.454434653734936 

@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse                     59
pulse-staking             0
staking                   0

total                    59.454434653734936 

@g1nt0ki g1nt0ki merged commit 5eb02bc into DefiLlama:main Jan 26, 2025
1 check passed
@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse-staking             222.22 k
staking                   222.22 k
pulse                     135

total                    135.26253176291314 

1 similar comment
@llamabutler
Copy link

The adapter at projects/nexion exports TVL:

pulse-staking             222.22 k
staking                   222.22 k
pulse                     135

total                    135.26253176291314 

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