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, on-chain 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 "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
contract NFTFloorPriceConsumerV3 {
AggregatorV3Interface internal nftFloorPriceFeed;
/**
* Network: Goerli - No Sepolia feeds available at this time
* Aggregator: CryptoPunks
* Address: 0x5c13b249846540F81c093Bc342b5d963a7518145
*/
constructor() {
nftFloorPriceFeed = AggregatorV3Interface(
0x5c13b249846540F81c093Bc342b5d963a7518145
);
}
/**
* 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;
}
}