Onchain Data
Available as of v0.4.x
DShareFactory
Our list of supported assets is provided by the DShareFactory contract.
function getDShares() external view returns (address[] memory, address[] memory)
The first array returns the list of dShare tokens. The second array is the list of wrapped dShare token vaults used to accrue the value of splits and dividends while maintaining compatibility with other decentralized finance protocols.
OrderProcessor
dShare price and volume data is provided by the OrderProcessor contract.
The most recent settlement price for a dShare and payment token can be queried for directly.
struct PricePoint {
// Price specified with 18 decimals
uint256 price;
uint64 blocktime;
}
function latestFillPrice(address assetToken, address paymentToken) external view returns (PricePoint memory)
For a quick USD price quote, pass the USD+ stablecoin address as the payment token in the latestFillPrice call.
Fill volume can be aggregated over time by listening to OrderFill events.
event OrderFill(
uint256 indexed id,
address indexed paymentToken,
address indexed assetToken,
address requester,
uint256 assetAmount,
uint256 paymentAmount,
uint256 feesTaken,
bool sell
)
Updated 8 days ago