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

Neutral.trade adapter #12674

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Neutral.trade adapter #12674

wants to merge 8 commits into from

Conversation

NeutralTrade
Copy link

@NeutralTrade NeutralTrade commented Dec 12, 2024

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):

Neutral Trade

Twitter Link:

https://x.com/TradeNeutral

List of audit links if any:

Neutral Trade uses Drift vault program ; see all drifts audits:

Website Link:

https://www.neutral.trade/

Logo (High resolution, will be shown with rounded borders):

neutral-trade-logo

Current TVL:

13,561,777

Treasury Addresses (if the protocol has treasury)

N/A

Chain:

Solana

Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)

N/A

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)

N/A

Short Description (to be shown on DefiLlama):

Neutral Trade is the on-chain multi-strategy hedge fund, built by experienced quants and traders from Goldman Sachs and Top Global Hedge Funds.

Token address and ticker if any:

N/A

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.):

Pyth

Implementation Details: Briefly describe how the oracle is integrated into your project:

Fetch asset prices for rebalancing

Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage:

N/A

forkedFrom (Does your project originate from another project):

N/A

methodology (what is being counted as tvl, how is tvl being calculated):

The Total Value Locked (TVL) is calculated as the sum of all deposits across public and private vaults, combined with their respective profit and loss (PnL).

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

https://github.com/neutral-trade

@llamatester
Copy link

The adapter at projects/neutral-trade exports TVL:

solana                    11.97 M

total                    11.97 M 

@llamatester
Copy link

The adapter at projects/neutral-trade exports TVL:

solana                    11.98 M

total                    11.98 M 

@NeutralTrade NeutralTrade marked this pull request as draft December 12, 2024 04:05
use last recorded entry in case a specific date in missing
@llamatester
Copy link

The adapter at projects/neutral-trade exports TVL:

solana                    13.18 M

total                    13.18 M 

@NeutralTrade NeutralTrade marked this pull request as ready for review December 12, 2024 04:30
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.

@NeutralTrade thanks for the PR but can you compute it using on chain data instead?

@g1nt0ki g1nt0ki self-assigned this Dec 12, 2024
@NeutralTrade
Copy link
Author

NeutralTrade commented Dec 12, 2024

@NeutralTrade thanks for the PR but can you compute it using on chain data instead?

Sure can do. But would it work with timetravel: true ?

I thought it would be OK to use the historical data we're recording along with our vault keepers like some other protocols listed on defillama are doing, it seems easier than doing a ton of rpc calls. I understand your concern is transparency, all our vaults are using Drift Vault Program, you can find most of our vaults listed on drift UI here https://app.drift.trade/vaults, it's all transparent, can't cheat the numbers :)

let me know, thanks 🙏

@g1nt0ki
Copy link
Member

g1nt0ki commented Dec 12, 2024

unfortunately no, we cant fetch historical data from atm.

Maybe you do re-use vectis code? Think they are using drift vaults as well: https://github.com/DefiLlama/DefiLlama-Adapters/pull/12564/files

*maybe move the common code to helper file to avoid code duplication

@NeutralTrade
Copy link
Author

unfortunately no, we cant fetch historical data from atm.

Maybe you do re-use vectis code? Think they are using drift vaults as well: https://github.com/DefiLlama/DefiLlama-Adapters/pull/12564/files

*maybe move the common code to helper file to avoid code duplication

Ok got it. So i will revamp the code to compute everything from the chain directly.
I'd like to still figure out if there's a way to use our historical data, eg. use our historical data for dates prior to defillama listing, direct computation from chain from defillama listing onwards. Is this technically possible by using timetravel: true and doing a simple check on api.timestamp passed in tvl(api) function ?

Please let me know, thanks 🙏

@llamabutler
Copy link

The adapter at projects/neutral-trade exports TVL:

solana                    16.14 M

total                    16.14 M 

@llamabutler
Copy link

The adapter at projects/neutral-trade exports TVL:

solana                    16.14 M

total                    16.14 M 

@llamabutler
Copy link

Error while running adapter at projects/neutral-trade:

Error: Cannot find module '@drift-labs/sdk'
Require stack:
- /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/neutral-trade/helpers.js
- /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/neutral-trade/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/neutral-trade/helpers.js:3:25)
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 :

Please revert changes to package.json / package-lock.json

@NeutralTrade NeutralTrade requested a review from g1nt0ki December 15, 2024 07:09
@NeutralTrade
Copy link
Author

Error while running adapter at :

Please revert changes to package.json / package-lock.json

Hi @g1nt0ki , I'd like to request to add the drift sdk to your repo, this will be a big help for all future projects building on top of Drift.

@g1nt0ki
Copy link
Member

g1nt0ki commented Dec 20, 2024

Error while running adapter at :

Please revert changes to package.json / package-lock.json

Hi @g1nt0ki , I'd like to request to add the drift sdk to your repo, this will be a big help for all future projects building on top of Drift.

sorry for the late reply, sorry but no. I am trying to keep the # dependencies to an absolute minimum.

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.

4 participants