Giter Club home page Giter Club logo

defillama-server's People

Contributors

0xmichalis avatar 0xngmi avatar 0xsambugs avatar 0xstrobe avatar 0xtawa avatar ashar2shahid avatar define101 avatar devnodereact avatar dtmkeng avatar g1nt0ki avatar hatskier avatar jakub-wojciechowski avatar jo-chemla avatar ksdumont avatar llama0x avatar mariobern avatar mattgurbiel avatar miker808 avatar mintdart avatar nemusonaneko avatar realdealshaman avatar sakulstra avatar shinitakunai avatar slasher125 avatar sleezyggg avatar usr-icon-foundation avatar vrtnd avatar waynebruce0x avatar zero-goliath avatar zkswapfinance 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  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  avatar

defillama-server's Issues

Adding Supra's Oracle to Mirakle Defi

Hi,
We would like to add the use of Supra's Oracle to Mirakle Defi. Their dynamic pricing is supported by SupraOracles.

Materials
-> https://mirakle.gitbook.io/home/

Rationale
Mirakle Defi uses Supra's oracle for dynamic pricing of the following assets: btc/usdt, eth/usdt, and fuse/usdt

Thank you in advance.

Best,
Keith

Specific tokens break prices API

This call fails and doesn't return anything:

https://coins.llama.fi/prices/current/coingecko:boringdao-[old]

Could be the brackets?

How to run the defillama server on my local dev env

Hi awesome defillama team, I have clone the defillama-server repo and want to run the server on my local env, but it didn't work. Could you provide a guide how to run the defillama-server on local dev env? Thanks!

Here's what I have done:

  1. Clone the defillama-server and the submodules

  2. run yarn in both the defillama-server and Defillama-Adapters repo to install the npm packages

In these step I got the following error

nfo To upgrade, run the following command:
$ curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
$ cp patches/geturl.js node_modules/@ethersproject/providers/node_modules/@ethersproject/web/lib.esm/geturl.js
cp: node_modules/@ethersproject/providers/node_modules/@ethersproject/web/lib.esm/geturl.js: No such file or directory
error Command failed with exit code 1.
  1. Created a .env file and added the required env variables

And here's the my .env file content

ETHEREUM_RPC=https://eth-mainnet.gateway.pokt.network/v1/5f3453978e354ab992c4da79
BSC_RPC=https://bsc-dataseed.binance.org/
POLYGON_RPC=https://polygon-rpc.com/
ARBITRUM_RPC=https://arb-mainnet.g.alchemy.com/v2/your-api-key
FANTOM_RPC=https://rpc.ftm.tools/
OPTIMISM_RPC=https://mainnet.optimism.io
XDAI_RPC=https://rpc.xdaichain.com/
OUTDATED_WEBHOOK=xxx
HARMONY_RPC=https://api.harmony.one
SPIKE_WEBHOOK=https://hooks.spike.sh/:token/push-events
MOCK_DYNAMODB_ENDPOINT=http://localhost:8000

  1. Install dynamodb and start the dynamodb

  2. Run yarn server to start the defillama-server (Failed)

And here's part of the error messages

WARNING in ./DefiLlama-Adapters/node_modules/@defillama/sdk/node_modules/node-fetch/lib/index.js 163:11-38
Module not found: Error: Can't resolve 'encoding' in '/Users/xxx/defillama-server/DefiLlama-Adapters/node_modules/@defillama/sdk/node_modules/node-fetch/lib'

Module not found: Error: Can't resolve 'encoding' in '/Users/xxx/defillama-server/node_modules/cross-fetch/node_modules/node-fetch/lib'

ERROR in ./DefiLlama-Adapters/projects/pole/index.js 7:4-57
Module not found: Error: Can't resolve '@port.finance/port-sdk/lib/models/WalletId' in '/Users/xxx/defillama-server/DefiLlama-Adapters/projects/pole'

Inconsistencies with Fees/Revenue endpoints

The summary/fees/{protocol} endpoint has some inconsistencies that I believe should be improved. I have not checked this behavior against the other fees/revenue endpoints, so it may also apply to those.

  1. https://api.llama.fi/summary/fees/ethereum?dataType=dailyFees and https://api.llama.fi/summary/fees/ethereum?dataType=dailyRevenue both work as I would expect, but for dataType=totalFees and dataType=totalRevenue configs, I get a response with both totalDataChart and totalDataChartBreakdown returning null values. Based on the data I see in the dashboard, this shouldn't be the case. For Lyra, dailyFees is the only config that produces non-null results.

  2. Volume endpoints include excludeTotalDataChart and excludeTotalDataChartBreakdown flags. Given that volume and fees/revenue are given in the same format, I believe that the fees/revenue endpoints should include this same behavior even if it has virtually no effect on final usage of this data.

variables to run

trying to run server and missing some env variables. would this work with infura?

 Cannot resolve variable at "provider.environment.ETHEREUM_RPC": Value not found at "file" source,
  - Cannot resolve variable at "provider.environment.BSC_RPC": Value not found at "file" source,
  - Cannot resolve variable at "provider.environment.POLYGON_RPC": Value not found at "file" source,
  - Cannot resolve variable at "provider.environment.OUTDATED_WEBHOOK": Value not found at "file" source

Issue with Umee USDT not showing

We currently have ~$900k of usdt supplied to umee. It was added 2 weeks ago in #2878 and i have double checked that the IBC denom is correct. Further more I don't believe any of the assets on this PR are showing up on umee's defillama tvl

Dimensions api v2

todo:

  • new api for dimensions data
  • publish to api2 server
  • test that api works
  • fork front end to test new api
  • stress test api2 server

Adding Wrapped Staked Ether (wstETH) on Starknet

Currently, only 5 starknet tokens are supported:

"starknet": {
"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8": {
"name": "usd-coin",
"decimals": "6",
"symbol": "USDC",
"to": "coingecko#usd-coin"
},
"0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8": {
"name": "tether",
"decimals": "6",
"symbol": "USDT",
"to": "coingecko#tether"
},
"0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac": {
"name": "wrapped-bitcoin",
"decimals": "8",
"symbol": "WBTC",
"to": "coingecko#wrapped-bitcoin"
},
"0x00da114221cb83fa859dbdb4c44beeaa0bb37c7537ad5ae66fe5e0efd20e6eb3": {
"name": "dai",
"decimals": "18",
"symbol": "DAI",
"to": "coingecko#dai"
},
"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7": {
"name": "ethereum",
"decimals": "18",
"symbol": "ETH",
"to": "coingecko#ethereum"
}
},

You can verify it by sending a request to:

https://coins.llama.fi/prices/current/starknet:0x00da114221cb83fa859dbdb4c44beeaa0bb37c7537ad5ae66fe5e0efd20e6eb3,starknet:0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8,starknet:0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8,starknet:0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac,starknet:0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7

However I want support for starknet:0x042b8f0484674ca266ac5d08e4ac6a3fe65bd3129795def2dca5c34ecc5f96d2 to be added, which is wstETH on Starknet.

But what I cannot understand is that I have tried to read https://docs.llama.fi/coin-prices-api and follow the direction there, but how come some starknet tokens are already supported despite the absence of coins/src/adapters/bridges/starknet.ts? From what I understood, I should create coins/src/adapters/bridges/starknet.ts and define export default async function bridge that would get the list of tokens from starknet.

Anyway, if you find it easier to just add a support for it directly, that would be great too, otherwise please let me know if what I think I should do is right.

Store protocols tokens locked up

This is a feature request.

I identified some steps to accomplish the request:

1- Changing computeTVL in @defillama/sdk to return the tokens locked up. Here is one suggestion of the output format for REN protocol

{
  total: 1021225134.1998382,
  tokens: [
    {
      usdAmount: 219793000,
      tokenSymbol: 'REN',
      amount: 184700000,
      price: 1.19
    },
    {
      usdAmount: 801432134.1998382,
      tokenSymbol: 'USDT',
      amount: 801661409.362916,
      price: 0.999714
    }
  ]
}

2- Adapting storeNewTvl to store the protocol's tokens TVL in dynamo DB (https://github.com/DefiLlama/defillama-server/blob/master/src/utils/storeNewTvl.ts)

Coins API does not return the price of Renzo's ezETH properly.

Hello,

The price for Renzo ezETH on Linea does not seem to load up properly even though the address and asset is tracked on CoinGecko.

The endpoint https://coins.llama.fi/prices/current/linea:0x2416092f143378750bb29b79ed961ab195cceea5

Returns a blank response

{
"coins": {}
}

On CoinGecko you can verify that the address for ezETH is properly set 0x2416092f143378750bb29b79ed961ab195cceea5.

CoinGecko: https://www.coingecko.com/en/coins/renzo-restaked-eth

Unsure if this has anything to do with CG returning null for the decimals for the above asset.

https://api.coingecko.com/api/v3/coins/linea/contract/0x2416092f143378750bb29b79ed961ab195cceea5

image

python requests json encoding error

solution: pip install brotli

curl https://api.llama.fi/protocols -H "Accept: application/json" -vvvvv curl | brotli -d -

for the next poor soul

Suggestion to locally cache these frequent light-weight calls

Recently discovered defi-llama. Hovering over the sidebar menu seems to make api calls to the server. It is not very noticeable however I ended up making over 150+ calls just by hovering my cursor across the page.

Not sure about the best approach here, maybe there is some benefit to this approach however, it seems redundant to make so many same calls.

image

Add utility to compute old tvl.

Start point: src/cli/recomputeDaily.ts

The function storeTvl in src/storeTvlInterval/getAndStoreTvl.ts already accepts the block and the timestamp associated with the block. The utility job should be to find the desired blocks and execute the storeTvl to store the old tvls.

Update the docs about slugs

The defillama API already responds with the slug for each DeFi protocol, however the documentation makes no mention of it. Where can I contribute to make that change?

I think the documentation should also include the Protocol interface. Anyone using TypeScript would greatly appreciate it.

export interface Protocol {
id: string;
name: string;
address: string;
symbol: string;
url: string;
description: string;
chain: string;
logo: null | string;
audits: null | "0" | "1" | "2" | "3";
audit_note: null;
gecko_id: string;
cmcId: string;
category: string;
chains: string[];
module: string;
twitter: string;
}

Improvement idea

https://github.com/DefiLlama/defillama-server/blob/5e89df1354b7e9f16444be27895dd29149db0606/defi/src/getOracles.ts#L55..L61

in the above you calculate the TVS for each oracle which is great

the only caveat is the "Internal" one which is misleading because it's an accumulation of a few separate ones

potential improvement is doing something like this:
https://github.com/007vasy/007vasy.github.io/blob/main/docs/index.html#L46..L48

which I am doing to avoid create false clusters:
https://007vasy.github.io/

image

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.