This crate contain a library of banksea oracle which providers NFT price evaluation service on-chain.
Add the library to your Cargo.toml:
rust
[dependencies]
banksea-oracle-client="<version>"
You can find the latest version of the library in crate.io
You can call the get_feed_info
in your program on-chain.
rust
let feed_info = banksea_oracle::get_feed_info(feed_account)?;
It will return a struct of FeedInfo
.
The details of FeedInfo
:
| Field Name | Description |
| -------------------- | ------------------------------------------------------------ |
| oracle | The oracle handle which save configure of the oracle. |
| code | The collection code which identify a collection. |
| unit | The unit of price. |
| decimals | The decimals of price. |
| aggregatetime | The latest aggregation time. |
| aggregatenodecount | The number of nodes at the latest aggregation. |
| floorprice | Minimum listing price of this collection on marketplace |
| aifloorprice | The minimum AI valuation of this collection |
| avg_price | The 24 hour average price of the collection |
You can find example on github