Git Product home page Git Product logo

dimension-adapters's Introduction

Adapters

Find the instructions to list, write, test and submit an adapter here

Example: yarn test fees bitcoin

dimension-adapters's People

Contributors

0xngmi avatar 0xshad0w avatar 0xtawa avatar alphada avatar blablalf avatar define101 avatar dongminh1997 avatar dtmkeng avatar estebgonza avatar evmlord avatar ftm1337 avatar g1nt0ki avatar gte620v avatar henrystats avatar lemonpac avatar lvn-ryu avatar paulvaden avatar plays-jobim avatar realdealshaman avatar rohithkumar0369 avatar royvardhan avatar singhalhemant avatar srph avatar supakawaiidesu avatar tec05 avatar timongll avatar vladjito avatar vrtnd avatar waynebruce0x avatar yruej301 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dimension-adapters's Issues

[Q] Replacing Anyswap's Stablecoins

Recently, Multichain's (Anyswap) bridge collapsed and their tokens depegged to 1/15th of their previously perceived values.

Defillama uses a hard mapping on multiple chains that map mc's tokens like USDC or USDT to the real USDC or USDT on the Mainnet Ethereum. This results in a bugged calculation that inflates TVL, Volume, Fees, etc on these networks by upto 20x more in adapters that use offchain indexing like those that use their own subgraphs or custom APIs to feed data into DefiLlama.

A notable example is Fantom, where DAI is trading at 0.08, fUSDT at 0.13, USDC at 0.18 and so on.. The DEXes that use subgraphs are currently showing 5-15x more $ values in their TVL, Volume, Fees adapters.

Possible solution would be to identify other sources of stablecoin pricing and use that to calculate valuations. For example, on fantom, there are multiple native stablecoins like MIM & FRAX and multiple bridged tokens like axlUSDC that have been on the network since years and are still functioning properly, trading at $1.

I'm not sure about what and where we need to make the required changes in the DefiLlama repositories, so opening this thread in both repos (tvls & dimension).
One solution for Volume & Fees would be to use on-chain / event-based adapters like we have for solidly forks, but would be quite a bit laborious for 100s of projects..

edit:
On fantom, I noticed axlUSDC was showing up a price of $0, evident in adapters such as e3, equity, equalizer, spookyswap etc protocols that have majority usage of axlUSDC as primary stablecoin. (https://www.coingecko.com/en/coins/axelar-usdc)

Polygon fees pulls from stale subgraph

Wanted to flag that I think Polygon fees are off. Checked it with a few other sources (and an indexer I use) and results from subgraph are less than what I would expect.

https://github.com/DefiLlama/dimension-adapters/blob/master/fees/polygon.ts#L10

This subgraph relies on this Quickswap pool to quote WMATIC-USDC, which seems like it may be quoting stale prices relative to mkt spot w/ more volume.

I reached out to @dmihal, but haven't heard back, figured I would also flag to you all as well.

Defillama's Daily Volume Display Doesn't Match Our Real Trading Activity

Dear Defillama Team,

Defillama: https://defillama.com/protocol/zkswap-finance
Website: https://zkswap.finance/

We reviewed the data from the past few days and noticed a discrepancy between the reported volume and the actual figures.

Specifically, yesterday our trading volume exceeded 8 million, whereas Defillama indicated only 500k.

We have verified the accuracy of Defillama's code, and it appears to display the correct values. However, the website itself is showing incorrect information.

Could you please assist us in re-evaluating this matter?

defillama_vol

defillama_vol_web

Looking forward to hearing your response,
Best Regards,
Ryan

Subgraph endpoint update required

Hey team,

We've noticed that you're referencing a subgraph deployed on The Graph's hosted service in this repository. Just a heads-up: after June 12th, hosted service subgraph endpoints will no longer be available as the offering is being deprecated.

If you are the subgraph owner or maintainer, it's time to upgrade your subgraph to the network. This ensures everything keeps running smoothly and you get access to all the latest features and improvements. Here is a quick guide with all the upgrade steps.

If you're not the subgraph owner or maintainer, check Graph Explorer to see if the subgraph development team has already upgraded to the network. If you don’t find an upgraded subgraph, a friendly nudge to the subgraph development team would be greatly appreciated—it's a quick process that benefits everyone. Here's the upgrade guide with all the necessary steps for the subgraph development team.

Once the subgraph is upgraded to the network, you can create an API key and updated query URL in Subgraph Studio then update this repository to query from the new endpoint, https://api.studio.thegraph.com/query/<ID>/<SUBGRAPH_NAME>/<VERSION>

Need more support or have more questions? Feel free to reach out to [email protected]. We're here to help!

Cheers,

Paka

const sdk = require('@defillama/sdk');

const sdk = require('@defillama/sdk');
const MINT_TOKEN_CONTRACT = 0x2F27118E3D2332aFb7d165140Cf1bB127eA6975d
const GDX__CONTRACT = '0x2F27118E3D2332aFb7d165140Cf1bB127eA6975d';

async function tvl(_, _1, _2, { api }) {
const balances = {};

const collateralBalance = await api.call({
abi: 'erc20:balanceOf',
target: GDX_TOKEN_CONTRACT,
params: GDXT__CONTRACT],
});

await sdk.util.sumSingleBalance(balances, MINT_TOKEN_CONTRACT, collateralBalance, api.chain)

return balances;
}

module.exports = {
timetravel: true,
misrepresentedTokens: false,
methodology: 'counts the number of MINT tokens in the Club Bonding contract.',
start: 1000235,
bsc: {
tvl,
}
};

Originally posted by @qwertyuioppkgkf in #321 (comment)

Hi! I'm a bot, and I wanted to automerge your PR, but couldn't because of the following issue(s):

Hi! I'm a bot, and I wanted to automerge your PR, but couldn't because of the following issue(s):

 - eip-1485 state was changed from draft to stagnant
 - eip-1485.md is in state stagnant at the head commit, not draft or last call or review; an EIP editor needs to approve this change
 - This PR requires review from one of [@micahzoltu, @lightclient, @arachnid, @cdetrio, @souptacular, @vbuterin, @nicksavers, @wanderer, @gcolvin, @axic]
 - eip-1485.md requires approval from one of (trustfarm-dev, [email protected])

@MicahZoltu @lightclient @Arachnid @cdetrio @Souptacular @vbuterin @nicksavers @wanderer @gcolvin @axic @trustfarm-dev [email protected]

Originally posted by @eth-bot in ethereum/EIPs#3887 (comment)

Dexs for 18/3/2023 _______________________________________ ETHEREUM 👇 Backfill start time: 1/1/1970 NO METHODOLOGY SPECIFIED Daily volume: 0 Timestamp: 1679097600 POLYGON 👇 Backfill start time: 1/1/1970 NO METHODOLOGY SPECIFIED Daily volume: 5496.098910000001 Timestamp: 1679097600 ARBITRUM 👇 Backfill start time: 1/1/1970 NO METHODOLOGY SPECIFIED Daily volume: 1379168.1750577954 Timestamp: 1679097600 OPTIMISM 👇 Backfill start time: 1/1/1970 NO METHODOLOGY SPECIFIED Daily volume: 88446.48139935738 Timestamp: 1679097600 BSC 👇 Backfill start time: 1/1/1970 NO METHODOLOGY SPECIFIED Daily volume: 16486.85075782207 Timestamp: 1679097600

Stride: Evmos and Injective Fee History

There are two days where Stride's EVMOS and INJ fees were miscalculated (see here). In particular, I think the denoms were incorrectly calculated on April 14th and 15th. Is there a way to forward-fill fees for Evmos and Injective on those days for Stride? The router is correctly calculated now, see this PR, so I think we only need to adjust those fees backwards-looking. If it's easier, we can also throw out all fees for Evmos and Injective until now.

Apologies, I'm not very familiar with the DefiLlama codebase, but if you can point me to this part of the repo, I'm also happy to submit a PR!

Thanks so much for the help, please let me know if I can help clarify.

Limit of eth_getLogs exceeded

Dear, DeFiLama team

After recent refactoring that seems to improve performance of calculation, Zerion adapter stopped working.
Screenshot 2024-02-14 at 9 58 44 PM

Raising internal error with getLogs helper. Error: Invalid eth_getLogs request. 'fromBlock'-'toBlock' range too large. Max range: 800
Screenshot 2024-02-14 at 9 51 40 PM

May you provide suggestion what is the best way to fix this given error comes from internal libraries?

Aave V3 Fee Issue (potentially large deviations from the real value)

Hey defillama team,

I am over at messari and noticed a bug in how you are calculating the fees for aave v3 (likely other aave protocols and forks).

const dailyFee = feeBreakdown.depositorInterestUSD + feeBreakdown.outstandingTreasuryIncomeUSD + feeBreakdown.treasuryIncomeUSD

What is "outstanding treasury income"?
This is the accruedToTreasury field in the aave subgraph you use. And that coincides with accruedToTreasury in aave smart contracts.

What is accruedToTreasury?
"//the current treasury balance, scaled" - per comment in contracts

How does this field behave?
This is essentially a counter for reserve accrued interest, and once it is large enough a MintToTreasury event is emitted and the counter is reset to 0, and the value (in aTokens) is minted to the treasury.

Why is this wrong?

  1. This is not a strictly increasing field. So it is reset to 0, and when you subtract current value by yesterday's value it is possible to get negative values. Doesn't seem to be handled in the open source code, so I am guessing you do something internally to hide these values.
  2. This value is really just lifetimeReserveFactorAccrued or treasuryIncomeUSD (in the adapters). So it is double counting fees generated to the protocol from user interest sent to the treasury.

What are the effects?
There are pretty massive $1mm+ spikes, that don't coincide with the actual revenue.

Screenshot 2024-03-18 at 5 38 29 PM Source: https://defillama.com/protocol/aave-v3

The buffer adapter exports:

          The buffer adapter exports: 

Fees for 22/2/2023
_______________________________________

ARBITRUM 👇
Backfill start time: 29/1/2023
NO METHODOLOGY SPECIFIED
Timestamp: 1677110398
Daily fees: 8807.019625
Daily revenue: 8807.019625




Done in 5.44s.

Originally posted by @llamatester in #265 (comment)

<!--

The version of Ajv you are using

Operating system and node.js version

Package manager and its version

Link to (or contents of) package.json

Error messages

The output of npm ls

Originally posted by @crystalshay2es in ajv-validator/ajv#2245

The azuro adapter exports:

The azuro adapter exports:


Fees for 20/3/2023
_______________________________________

POLYGON 👇
Backfill start time: 1/1/2021
NO METHODOLOGY SPECIFIED
Timestamp: 1679356798
Daily fees: -1606.75
Daily revenue: -1606.75


XDAI 👇
Backfill start time: 1/1/2021
NO METHODOLOGY SPECIFIED
Timestamp: 1679356798
Daily fees: 807.46
Daily revenue: 807.46




Done in 4.14s.

Originally posted by @llamatester in #322 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.