OPEN-SOURCE SCRIPT

Price DEFI Categories against BTC & ETH

업데이트됨
/* Work in progress. The indicator is not finished. *\

The indicator shows the pricing of 3 DEFI categories against 2 possible baselines, BTC and ETH.

To do:
* Make a simple array in the source code to enter and remove new projects to the category. -> Maybe can also make it so that the source code does not have to be altered (projects can be added through input etc.)
* Adjust weightings depending on project data but this is not as important since weightings are being priced in by the market.
* Try to find a way to update input to string instead of booleans. As of currently, I could not seem to use input strings into plot functions because of an error.
* and more. Leave some feedback, that would be highly appreciated!
릴리즈 노트
V1.1

- Updated the title -> "DEFI against Majors" -> D.A.M 1.1
- Added subcategory 'Derivatives'
- Changed transparency (from 20 to 80) of the plot backgrounds
릴리즈 노트
- Changed baseline default value to Ethereum
- Changed boolean input for baseline to choice between strings.
릴리즈 노트
V1.2

- Updated user input. Added boolean (true/false) to give the option to disable certain categories.
- Added comments to the source code so it is easier to read for people that want to mess around with it.
릴리즈 노트
V1.3

* Eco system mode
- Added most of the big DEFI projects from two spaces: Ethereum & Solana. I used the maps that can be found here: (https:// pentacle .ai)
- I chose to leave some out of the equation due to maturity of the chart; I can't really average a chart on 30 day lookback if it has just been listed 14 days capiche?

ETH DEFI SUPPORTED PROJECTS:
Compound, Harvest Finance, Yearn Finance, 0x, Aave, Badger DAO, Alpha Finance, Bancor Network, Curve Finance, Maker, Numeraire

SOL DEFI SUPPORTED PROJECTS:
Bonfida, Serum, Hxro


* Changed user input:
- Added seperators for convencience of sight/vision. Still debating whether I should leave or delete again.
- Added lookback (in days) as a reference point. Minimum value of 1 and maximum value of 30 days. On a lookback of 1 it is quite hard to react but you can spot new trends faster. Choose 30 lookback for a good overview of the last month. I advise to use inbetween 7 and 14 for optimal results.
- Added eco system mode which can be toggled on or off. Default value is off. What do you think? Should the indicator work from categories as a base or ecosystem as a base?
릴리즈 노트
- Added new category 'liquid staking' containing LDO, FXS, AANKR, RPL & STAFI
- Added ALPACA to the 'lending/borrowing' category
- Added GMX and DYDX to the 'derivatives' category
- Added gradient coloring for better aesthetics :-)
- Fixed a bug where you could not disable single categories
릴리즈 노트
  • Added a new function: In the newer version of the code, a new function named getSecurityData was added. This function takes two parameters, base and quote, and calculates the percentage change of the security (price) based on the provided parameters. This function is used to abstract away some of the repetitive code in the category calculations.
  • Modified baseline calculation: The baseline calculation was simplified by using the getSecurityData function for ETH against BTC and USD pairs. Previously, the calculation was done manually using security calls, but now it's done more efficiently with the new function.
  • Modified category calculations: The category calculations (e.g., Oracles, DEX, Lending/Borrowing, Derivatives, Liquid Staking) were updated to use the getSecurityData function instead of the previous security calls. This change reduced code duplication and made it easier to add new projects.
  • Refactored color handling in f_c_gradientAdvDec: The function f_c_gradientAdvDec now uses a new function f_colorNew to handle color and transparency calculations. This simplifies the code and improves readability.
  • Removed Eco mode related code: The older version of the code had an "Eco mode" option for showing the ecosystem plots. However, in the newer version, the "Eco mode" related code was removed, and only the ETH DEFI and SOL DEFI ecosystem calculations remain.
  • Updated plot visibility condition: The visibility conditions for each plot have been updated. In the newer version, plots are shown only when the corresponding category is enabled and the category_mode is also true. This allows users to toggle the visibility of individual categories.
  • Updated version number: The version number in the code has been updated to VERSION 1.5.
  • Updated comments and notes: The comments and notes were updated to reflect the changes and provide better clarity and instructions.


Overall, the newer version of the code introduces more abstraction through functions and improves the flexibility and maintainability of the indicator by allowing easier addition of new projects and better control over category visibility.
릴리즈 노트

  • Upgraded to Pine Script v5: The script now takes advantage of the latest Pine Script features.
  • Baseline Security: The previous version only allowed for ETH or BTC as baseline securities. Now you can input any security as a baseline for comparison.
  • User-Selectable Categories: Enhanced user control over which categories to display. You can now toggle individual categories like Oracles, DEX, Lending/Borrowing, Derivatives, and Liquid Staking.
Bitcoin (Cryptocurrency)BTCdecentralizedfinanceDEFIETHEthereum (Cryptocurrency)SOLsolanaTrend Analysis

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?


또한 다음에서도:

면책사항