Object: ggCrypto
Schema
Json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CryptoAssetProfile",
"description": "A profile detailing a cryptocurrency's market presence, including historical market data structured with timestamps as keys.",
"type": "object",
"properties": {
"assetSymbol": {
"description": "Cryptocurrency symbol.",
"type": "string"
},
"assetName": {
"description": "Full name of the cryptocurrency.",
"type": "string"
},
"currentPrice": {
"description": "Current trading price of the cryptocurrency.",
"type": "number",
"minimum": 0
},
"marketCap": {
"description": "Total market value of the cryptocurrency.",
"type": "number",
"minimum": 0
},
"volume24h": {
"description": "Total trading volume of the cryptocurrency in the last 24 hours.",
"type": "number",
"minimum": 0
},
"circulatingSupply": {
"description": "Total number of coins currently in circulation.",
"type": "number",
"minimum": 0
},
"historicalData": {
"description": "Dictionary of historical market data, keyed by timestamps.",
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"oneMinute": {
"description": "Data for the 1-minute candle.",
"type": "object",
"properties": {
"open": {"type": "number"},
"high": {"type": "number"},
"low": {"type": "number"},
"close": {"type": "number"},
"volume": {"type": "number", "minimum": 0}
},
"required": ["open", "high", "low", "close", "volume"]
},
"fiveMinute": {
"description": "Optional data for the 5-minute candle.",
"type": "object",
"properties": {
"open": {"type": "number"},
"high": {"type": "number"},
"low": {"type": "number"},
"close": {"type": "number"},
"volume": {"type": "number", "minimum": 0}
},
"required": ["open", "high", "low", "close", "volume"]
}
},
"required": ["oneMinute"]
}
}
},
"required": ["assetSymbol", "assetName", "currentPrice", "historicalData"],
"additionalProperties": false
}
Yang
module crypto-asset-profile {
namespace "http://example.com/crypto-asset-profile";
prefix cap;
organization "Example Organization";
description "Describes a crypto asset, including historical data keyed by timestamps.";
container cryptoAssetProfile {
leaf symbol {
type string;
description "Symbol of the crypto asset.";
}
leaf name {
type string;
description "Name of the crypto asset.";
}
leaf marketCap {
type decimal64 {
fraction-digits 2;
}
description "Market capitalization of the crypto asset.";
}
leaf volume24h {
type decimal64 {
fraction-digits 2;
}
description "Trading volume of the crypto asset in the last 24 hours.";
}
container historicalData {
description "Dictionary of historical data for the crypto asset, keyed by timestamps.";
list candleData {
key "timestamp";
leaf timestamp {
type string;
description "Timestamp marking the beginning of the historical data point.";
}
container oneMinute {
description "1-minute candle data for the crypto asset.";
leaf open {
type decimal64 {
fraction-digits 2;
}
}
leaf high {
type decimal64 {
fraction-digits 2;
}
}
leaf low {
type decimal64 {
fraction-digits 2;
}
}
leaf close {
type decimal64 {
fraction-digits 2;
}
}
leaf volume {
type uint64;
description "Volume of the crypto asset traded.";
}
}
container fiveMinute {
description "Optional 5-minute candle data for the crypto asset.";
leaf open {
type decimal64 {
fraction-digits 2;
}
}
leaf high {
type decimal64 {
fraction-digits 2;
}
}
leaf low {
type decimal64 {
fraction-digits 2;
}
}
leaf close {
type decimal64 {
fraction-digits 2;
}
}
leaf volume {
type uint64;
description "Volume of the crypto asset traded.";
}
}
}
}
}
}
Example Object