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 Adrena Adapter #12266

Merged
merged 6 commits into from
Nov 13, 2024
Merged

Add Adrena Adapter #12266

merged 6 commits into from
Nov 13, 2024

Conversation

adrena-orex
Copy link
Contributor

@adrena-orex adrena-orex commented Nov 13, 2024

Name (to be shown on DefiLlama):

Adrena Protocol

Twitter Link:

https://x.com/AdrenaProtocol

List of audit links if any:

https://docs.adrena.xyz/technical-documentation/audits

Website Link:

https://app.adrena.xyz/

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

adrena_logo

Current TVL:

$13M

Treasury Addresses (if the protocol has treasury)

None

Chain:

Solana

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

{"id":"adrena","symbol":"adx","name":"Adrena"}

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)

None

Short Description (to be shown on DefiLlama):

Solana Perps DEX. 100x Leverage. 0% Slippage. 100% Rev Share. Open Source. Community Owned.

Token address and ticker if any:
  • ADX: AuQaustGiaqxRvj2gtCdrd22PBzTn8kM3kEPEkZCtuDw (Adrena Governance Token)
  • ALP: 4yCLi5yWGzpTWMQ1iWHG5CrGYAdBkhyEdsuSugjDUqwj (Adrena Pool Token)
Category (full list at https://defillama.com/categories) *Please choose only one:

Dexes

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:

Pyth oracle accounts are bound to our pool and used within our onchain program for asset pricing.

Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage:
  1. You can see onchain in the anchor data of our jitoSOL custody, the address of Pyth oracle: https://explorer.solana.com/address/GZ9XfWwgTRhkma2Y91Q9r1XKotNXYjBnKKabj19rhT71
  2. You can contact Pyth team, well aware of Adrena usage of Pyth feeds.
forkedFrom (Does your project originate from another project):

Our program is a fork of open sources solana-labs/perpetuals: https://github.com/solana-labs/perpetuals, and inspired by GMX.

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

TVL is calculated by aggregating the value of all assets in the pool's token accounts.

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

https://github.com/AdrenaFoundation

@llamatester
Copy link

Error while running adapter at projects/adrena:

Error: Failed to post https://mainnet.helius-rpc.com/?api-key=0109717a-77b4-498a-bc3c-a0b31aa1b3bf
Truncated error stack:

    at Object.post (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/http.js:47:11)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:260:29
    at async runInChunks (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:383:22)
    at async sumTokens2 (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:209:18)
    at async Promise.all (index 0)
    at async tvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/adrena/index.js:9:26)
    at async getTvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:52:23)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:173:9
    at async Promise.all (index 0)

@adrena-orex adrena-orex marked this pull request as draft November 13, 2024 10:46
@g1nt0ki g1nt0ki self-assigned this Nov 13, 2024
@llamatester
Copy link

Error while running adapter at projects/adrena:

Error: Failed to post https://mainnet.helius-rpc.com/?api-key=0109717a-77b4-498a-bc3c-a0b31aa1b3bf
Truncated error stack:

    at Object.post (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/http.js:47:11)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:260:29
    at async runInChunks (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:383:22)
    at async sumTokens2 (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:209:18)
    at async Promise.all (index 0)
    at async tvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/adrena/index.js:29:26)
    at async getTvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:52:23)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:173:9
    at async Promise.all (index 0)

'solana:AuQaustGiaqxRvj2gtCdrd22PBzTn8kM3kEPEkZCtuDw': decodeAccount('tokenAccount', res[0]).amount.toString(),

// ALP
'solana:4yCLi5yWGzpTWMQ1iWHG5CrGYAdBkhyEdsuSugjDUqwj': decodeAccount('tokenAccount', res[1]).amount.toString(),
Copy link
Member

Choose a reason for hiding this comment

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

would skip this since the tokens backing it is already counted towards 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.

Hello, we have a staking system where people can stake theirs ALP (pool token) in the program for some time 90day, 180d etc.

Same for our governance token (ADX).

I guess it depends what defilama is doing with the data, will follow your recommendation.

wdyt?

(thanks for review!)

Copy link
Member

Choose a reason for hiding this comment

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

the reason is, when a user deposits 1 USDC into your protocol, it counts towards tvl, then they stake the ALP, now that same USDC is counted again under staking, do you see the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

understandable! done ✅

@llamatester
Copy link

Error while running adapter at projects/adrena:

Error: Failed to post https://mainnet.helius-rpc.com/?api-key=0109717a-77b4-498a-bc3c-a0b31aa1b3bf
Truncated error stack:

    at Object.post (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/http.js:47:11)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:260:29
    at async runInChunks (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:383:22)
    at async sumTokens2 (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:209:18)
    at async tvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/adrena/index.js:29:3)
    at async getTvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:52:23)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:173:9
    at async Promise.all (index 0)
    at async Promise.all (index 3)

projects/adrena/index.js Outdated Show resolved Hide resolved
@llamatester
Copy link

Error while running adapter at projects/adrena:

Error: Failed to post https://mainnet.helius-rpc.com/?api-key=0109717a-77b4-498a-bc3c-a0b31aa1b3bf
Truncated error stack:

    at Object.post (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/http.js:47:11)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:260:29
    at async runInChunks (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:383:22)
    at async sumTokens2 (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:209:18)
    at async tvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/adrena/index.js:29:3)
    at async getTvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:52:23)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:173:9
    at async Promise.all (index 0)
    at async Promise.all (index 2)

@adrena-orex adrena-orex marked this pull request as ready for review November 13, 2024 11:55
@llamatester
Copy link

Error while running adapter at projects/adrena:

Error: Failed to post https://mainnet.helius-rpc.com/?api-key=0109717a-77b4-498a-bc3c-a0b31aa1b3bf
Truncated error stack:

    at Object.post (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/http.js:47:11)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:260:29
    at async runInChunks (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:383:22)
    at async sumTokens2 (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:209:18)
    at async tvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/adrena/index.js:20:3)
    at async getTvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:52:23)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:173:9
    at async Promise.all (index 0)
    at async Promise.all (index 2)

@llamatester
Copy link

Error while running adapter at projects/adrena:

Error: Failed to post https://mainnet.helius-rpc.com/?api-key=0109717a-77b4-498a-bc3c-a0b31aa1b3bf
Truncated error stack:

    at Object.post (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/http.js:47:11)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:260:29
    at async runInChunks (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:383:22)
    at async sumTokens2 (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/helper/solana.js:209:18)
    at async tvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/projects/adrena/index.js:13:3)
    at async getTvl (/home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:52:23)
    at async /home/runner/work/DefiLlama-Adapters/DefiLlama-Adapters/test.js:173:9
    at async Promise.all (index 0)
    at async Promise.all (index 2)

@g1nt0ki g1nt0ki merged commit 085385e into DefiLlama:main Nov 13, 2024
1 check failed
tlatkdgus1 pushed a commit to bifrost-platform/DefiLlama-Adapters that referenced this pull request Nov 25, 2024
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