LogoLogo
  • The Basics
    • Welcome
    • Fundamentals
    • Contracts Overview
    • Contracts Reference
    • Tutorials
  • Getting Data
    • Introduction
    • Solidity Integration
    • User Checklists
    • Local Testing
    • Testnet
    • Creating a Query
    • Funding a Feed
    • Tellor Functions
    • DataSpecs Registry
    • SnapShot Vote Results
  • Reporting Data
    • Introduction
    • Becoming a Reporter
    • Getting Paid
  • Disputing Data
    • Introduction
    • Monitoring
    • How to Dispute
    • Voting/Resolution
  • Vulnerability Disclosure
Powered by GitBook
On this page
  • One time tips
  • Recurring data feeds

Was this helpful?

  1. Reporting Data

Getting Paid

PreviousBecoming a ReporterNextIntroduction

Last updated 2 years ago

Was this helpful?

The payments for Tellor feeds are not held in the main tellor contract. Technically you can pay for Tellor feeds however you want (off-chain, recurring, hand shake agreements, etc.), however the trustless way to do this on-chain is to use the

The autopay contract allows parties to schedule and fund recurring data feeds or submit one-time tips to Tellor queryIDs.

For most Tellor queryIDs, the Tellor token on the network will be the tipped token.

There is a 12 hour waiting period after reporting data before tips can be claimed. This helps ensure that, if a value gets disputed, another reporter will be incentivized to submit the data and the user can still retrieve their requested data. Also note that tips must be claimed within 3 months of the original data submission.

One time tips

Finding - Autopay contracts will emit an event:

event TipAdded(
        bytes32 indexed _queryId,
        uint256 indexed _amount,
        bytes _queryData,
        address _tipper
    );

To see the current tip for any queryId, check:

/**
 * @dev Getter function to current oneTime tip by queryId
 * @param _queryId id of reported data
 * @return amount of tip
 */
function getCurrentTip(bytes32 _queryId) public view returns (uint256);

Getting Payment - To get the payment for a one time tip, run:

/**
 * @dev Function to claim singular tip
 * @param _queryId id of reported data
 * @param _timestamps ID of timestamps you reported for
 */
function claimOneTimeTip(
    bytes32 _queryId,
    uint256[] calldata _timestamps
) external;

Note the timestamp array is so you can submit for many one time tips and just claim all of those tips at once.

Recurring data feeds

Finding - When a new feed is funded, the following event will emit:

event DataFeedFunded(
        bytes32 indexed _queryId,
        bytes32 indexed _feedId,
        uint256 indexed _amount,
        address _feedFunder,
        FeedDetails _feedDetails
    );

To see all data feeds for a given queryID, check:

/**
 * @dev Getter function to read current data feeds
 * @param _queryId id of reported data
 * @return feedIds array for queryId
 */
function getCurrentFeeds(bytes32 _queryId)
    external
    view
    returns (bytes32[] memory);

Getting Payment - to claim payments from a data feed, run:

/**
* @dev Allows Tellor reporters to claim their tips in batches
* @param _feedId unique feed identifier
* @param _queryId ID of reported data
* @param _timestamps batch of timestamps array of reported data eligible for reward
*/
function claimTip(
    bytes32 _feedId,
    bytes32 _queryId,
    uint256[] calldata _timestamps
) external {

The _feedId is simply the keccak256 has of the variables defined in setupFeed:

bytes32 _feedId = keccak256(
        abi.encode(
            _queryId,
            _reward,
            _startTime,
            _interval,
            _window,
            _priceThreshold,
            _rewardIncreasePerSecond
        )
    );
Autopay contract.
For information on how to fund a queryID once or as a feed.