DIVA Protocol
  • 👋Welcome
  • 🔅Introduction
    • Derivative contracts
    • What is DIVA Protocol
      • What problem does it solve
      • How it works
        • Reference assets
        • Payoff curves
        • Collateral
        • Oracles
        • Settlement
          • Timelines
          • Challenge
          • Status
          • Fast settlement
          • Fallback data provider
        • Fees
        • Compliance feature
      • Vision
      • Terminology
    • What is DIVA Token
      • Owner election mechanism
      • Token distribution
    • DIVA Development Fund
    • FAQ
  • 🌈DIVA App
    • What is DIVA App
    • Overview
    • Create position tokens
    • Trade position tokens
    • Add liquidity
    • Remove liquidity
  • ⚙️Guides
    • DIVA App Training
      • Prepare
      • Testnet
      • Create
      • Trade
      • Add
      • Remove
      • Settle
      • Redeem
      • Fees
    • Quiz
  • 🪄Use cases
    • Overview
    • Insurance
      • Credit default protection
      • Agrarian insurance
      • DeFi Hack insurance
      • Peg insurance
    • Yield optimization
      • Bullish accumulation
      • Bearish accumulation
    • Risk management
      • Downside protection
      • Increasing cost protection
    • Directional bets
      • Downside bet
      • "Bottom-Is-In" bet
      • Upside bet
      • "Top-Is-In" bet
    • Leverage
  • 👨‍🎓Pricing derivatives
    • Introduction
    • Underlying value
    • Volatility
    • Time
  • ⚓Oracle integrations
    • Overview
    • Tellor
  • ⚒️For developers
    • Overview
    • Technical resources
    • Smart contracts
      • Functions
        • Core protocol functions
        • Getter functions
        • Setter functions
        • ABI
      • Contract addresses
      • Example scripts
    • TheGraph
      • DIVA subgraphs
      • Whitelist subgraph
    • Project ideas
  • 📱Contact & Media Links
    • Social media
  • 👨‍🎓Technical Blog
    • Flash loans in DIVA Protocol
    • NDVI outcome reporting guide for Tellor Reporters
    • Enabling capital efficiency in DeFi
Powered by GitBook
On this page
  • Introduction
  • Pool details
  • Reporting
  • 1 - Sourcing the NDVI value
  • 2 - Sourcing the USD rate of the collateral token (USDT)
  • 3 - Preparing the values for submission
  • 4 - Submitting to Tellor contract
  • 5 - Submitting to DIVA Protocol
  • Additional Notes
  • Reporting information summary
  • Questions?
  1. Technical Blog

NDVI outcome reporting guide for Tellor Reporters

How to report the outcome for the third DIVA Donate campaign

PreviousFlash loans in DIVA ProtocolNextEnabling capital efficiency in DeFi

Last updated 11 months ago

Introduction

The on DIVA Donate, which uses Tellor Protocol for outcome reporting, will expire and open for reporting on Monday, June 10, 2024, at 6:00 PM UTC (unix timestamp: 1718042400). This article provides a guide for Tellor reporters on how to participate in the outcome reporting and verify the accuracy of reported values.

Pool details

This campaign is linked to the following poolId on DIVA Protocol: .

To access the pool parameters, visit (Etherscan for EIP-2535 based contracts) and input the poolId into the getPoolParameters function. The detailed description of the reference asset can be found via the link in the referenceAsset field:

Accessing the IPFS link in your browser will display the following:

Reporting

The reporting process consists of the following four steps which are described in detail in the subsequent sections:

  1. Sourcing the NDVI value

  2. Sourcing the USD rate of the collateral token (USDT)

  3. Preparing the values for submission

  4. Submitting to Tellor contract

  5. Submitting to DIVA Protocol

1 - Sourcing the NDVI value

To manually source the NDVI value:

  1. Double-click on “NDVI eVIIRs” in the Dataset panel on the left.

  1. Locate and select "Kenya Kajiado" on the map.

  1. Ensure the year 2024 curve is selected.

  1. Read the value on 31th May 2024.

2 - Sourcing the USD rate of the collateral token (USDT)

The reference asset description does not specify whether the observation date for the USD rate should be May 31, 2024, or June 10, 2024, at 6:00 PM UTC. For consistency, use the same time as the observation timepoint for the reference asset, which is May 31, 2024. Use the end-of-day price at 11:59:59 PM UTC, round to two decimal places. It is anticipated that the USD value of USDT will be 1.00, thereby minimizing any potential for ambiguity or dispute.

3 - Preparing the values for submission

Prepare the two values as per below and encode them as bytes:

  1. NDVI value

    • Shift the observed NDVI value by +1 and round it to two decimal places, which is the default precision in the NDVI chart. For instance, an NDVI value of 0.75 becomes 1.75.

    • Convert the adjusted NDVI value into an unsigned integer with 18 decimals. Thus, 1.75 becomes 1750000000000000000.

  2. USD value of the collateral token (USDT)

    • Convert the value into an unsigned integer with 18 decimals. Thus, 1.00 becomes 1000000000000000000.

Encode the values

encodeOracleValue = (finalReferenceValue, collateralToUSDRate) => {
  return new ethers.utils.AbiCoder().encode(
    ["uint256", "uint256"],
    [finalReferenceValue, collateralToUSDRate]
  );
};

Example: With finalReferenceValue = 1750000000000000000 and collateralToUSDRate = 1000000000000000000, the encoded oracle value will be:

0x00000000000000000000000000000000000000000000000018493fba64ef00000000000000000000000000000000000000000000000000000de0b6b3a7640000

4 - Submitting to Tellor contract

  • _queryId: 0xf5b0d276ce38d3776861fb978b066a0ade32227dd84c282dbdda40d31fbda068

  • _nonce: 0

  • _queryData: 0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000c4449564150726f746f636f6c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000608c85108a28a163d1722c2140eea57f9d1cb7f83f69dfc04eb0d9e51298dea2b60000000000000000000000002c9c47e7d254e493f02acfb410864b9a86c28e1d0000000000000000000000000000000000000000000000000000000000000089

Additional comments

  • Please note that values submitted to the Tellor contract before campaign expiration (Monday, June 10, 2024, at 6:00 PM UTC) will be ignored.

5 - Submitting to DIVA Protocol

When executing the function setFinalReferenceFunction, set _tippingTokens to an empty array and _claimDIVAReward to true. This will transfer the data provider reward from DIVA Protocol to the original Tellor reporter, amounting to 0.05% of the deposited funds, approximately $4.30.

Additional Notes

The NDVI value is updated every five days and historical values are subject to slight variations due to a smoothing algorithm applied to the data. It is recommended that reporters read the NDVI value for May 31th shortly after the campaign expiration on June 10th, as this timing makes the May 31th value less likely to change. Additionally, it is advisable to record a video of your value reading from the chart as proof should your reported value be disputed later.

Reporting information summary

Network

Polygon

poolId

Tellor contract address (old version)

DIVA Tellor adapter contract

queryId

0xf5b0d276ce38d3776861fb978b066a0ade32227dd84c282dbdda40d31fbda068

queryData

0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000c4449564150726f746f636f6c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000608c85108a28a163d1722c2140eea57f9d1cb7f83f69dfc04eb0d9e51298dea2b60000000000000000000000002c9c47e7d254e493f02acfb410864b9a86c28e1d0000000000000000000000000000000000000000000000000000000000000089

Questions?

Reach out to us on:

Visit .

In addition to the NDVI value, the reporter must also submit the USD rate of the collateral token, USDT, which is utilized to calculate the reporter's reward. You can confirm that (at address 0xc2132D05D31c914a87C6611C10748AEb04B58e8F) is the pool's collateral token by checking the getPoolParameters .

The USD rate can be obtained from price aggregators like or , or exchanges.

Use the following function to encode your values. Check out for reference.

To submit the encoded value to the Tellor contract, use the function on the (old) Tellor contract at the address . Enter the encoded value into the _value field and include the following parameters that are independent of the NDVI value / collateral USD value:

To verify that the provided queryId and queryData are indeed correct, refer to .

Ensure that you have staked TRB tokens to be eligible for reporting. For detailed instructions on how to become a reporter, refer to the official (note that these documents may reference the newer, gas-optimized Tellor contracts, whereas the DIVA Tellor adapter used in this campaign is still linked to the older version).

If you prefer to submit the value via a script, refer to . Make sure to update the script setting const tellorVersion = TELLOR_VERSION.PLAYGROUND to const tellorVersion = TELLOR_VERSION.ACTUAL to reflect the mainnet environment.

If the reported NDVI value remains undisputed for at least 12 hours, anyone can execute the function on the DIVA Tellor adapter contract on the Polygon chain at address . This action pulls the value from the Tellor contract into DIVA Protocol and determines the payouts for each leg of the market.

Below table summarizes the key information required for reporting. The mentioned contract addresses can be found in the official on Github.

👨‍🎓
USGS Early Warning Site
Coingecko
Coinmarketcap
this example
submitValue
0xD9157453E2668B2fc45b7A803D3FEF3642430cC0
this script
Tellor docs
this example
setFinalReferenceValue
0x7950db13cc37774614b0aa406e42a4c4f0bf26a6
DIVA Tellor oracle adapter docs
Discord (DIVA)
Twitter (DIVA)
Discord (Tellor)
USDT
output
0x8c85108a28a163d1722c2140eea57f9d1cb7f83f69dfc04eb0d9e51298dea2b6
0xD9157453E2668B2fc45b7A803D3FEF3642430cC0
0x7950db13cc37774614b0aa406e42a4c4f0bf26a6
third parametric conditional donation campaign
0x8c85108a28a163d1722c2140eea57f9d1cb7f83f69dfc04eb0d9e51298dea2b6
louper.dev
IPFS