NFT Floor Price Feeds
Chainlink NFT Floor Price Feeds provide a conservative and risk averse floor price estimate for an NFT collection. These feeds operate the same way as other Chainlink Data Feeds. NFT Floor Price Feeds are supported by Coinbase Cloud's aggregation algorithm and Chainlink’s oracle infrastructure to help eliminate extreme price outliers and make these feeds resistant to market manipulation. You can use NFT Floor Price Feeds for use cases that rely on high-quality NFT data, including lending and borrowing, onchain derivatives, dynamic NFTs, gaming guilds, CeFi products, prediction markets, and more.
Find the list of testnet feeds on the Contract Addresses page. To sign up for access to NFT Floor Price feeds on Ethereum Mainnet, use this TypeForm.
Using NFT Floor Price Feeds
Read answers from NFT Floor Price Feeds the same way that you read other Data Feeds. Specify the NFT Floor Price Feed Address that you want to read instead of specifying a Price Feed address. See the Using Data Feeds page to learn more.
Using Solidity, your smart contract should reference AggregatorV3Interface
, which defines the external functions implemented by Data Feeds.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";
contract NFTFloorPriceConsumerV3 {
AggregatorV3Interface internal nftFloorPriceFeed;
/**
* Network: Mumbai Testnet
* Aggregator: Azuki Floor Price
* Address: 0x16c74d1f6986c6Ffb48540b178fF8Cb0ED9F13b0
*/
constructor() {
nftFloorPriceFeed = AggregatorV3Interface(
0x16c74d1f6986c6Ffb48540b178fF8Cb0ED9F13b0
);
}
/**
* Returns the latest price
*/
function getLatestPrice() public view returns (int) {
// prettier-ignore
(
/*uint80 roundID*/,
int nftFloorPrice,
/*uint startedAt*/,
/*uint timeStamp*/,
/*uint80 answeredInRound*/
) = nftFloorPriceFeed.latestRoundData();
return nftFloorPrice;
}
}