Updated ZEPH

This commit is contained in:
MoneroOcean
2025-06-11 08:55:48 -07:00
parent 91b90dbc01
commit 49a238086e
5 changed files with 46 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "cryptoforknote-util",
"version": "15.7.0",
"version": "15.7.1",
"author": {
"name": "LucasJones",
"email": "lucasjonesdev@hotmail.co.uk"

View File

@@ -40,6 +40,7 @@
template <template <bool> class Archive>
bool do_serialize(Archive<false> &ar, zephyr_oracle::pricing_record &pr, uint8_t version)
{
if (version >= 6)
{
// very basic sanity check

View File

@@ -32,6 +32,10 @@
namespace zephyr_oracle {
const std::vector<std::string> ASSET_TYPES = {"ZEPH", "ZEPHUSD", "ZEPHRSV", "ZYIELD"};
const std::vector<std::string> RESERVE_TYPES = {"ZEPH", "ZEPHUSD", "ZEPHRSV", "ZYIELD", "ZYIELDRSV"};
const std::vector<std::string> ASSET_TYPES_V2 = {"ZPH", "ZSD", "ZRS", "ZYS"};
const std::vector<std::string> RESERVE_TYPES_V2 = {"DJED", "YIELD"};
class asset_type_counts
{
@@ -44,11 +48,21 @@ namespace zephyr_oracle {
uint64_t ZEPHRSV;
uint64_t ZYIELD;
// v2 fields
uint64_t ZPH;
uint64_t ZSD;
uint64_t ZRS;
uint64_t ZYS;
asset_type_counts() noexcept
: ZEPH(0)
, ZEPHUSD(0)
, ZEPHRSV(0)
, ZYIELD(0)
, ZPH(0)
, ZSD(0)
, ZRS(0)
, ZYS(0)
{
}
@@ -62,6 +76,14 @@ namespace zephyr_oracle {
return ZEPHRSV;
} else if (asset_type == "ZYIELD") {
return ZYIELD;
} else if (asset_type == "ZPH") {
return ZPH;
} else if (asset_type == "ZSD") {
return ZSD;
} else if (asset_type == "ZRS") {
return ZRS;
} else if (asset_type == "ZYS") {
return ZYS;
}
return 0;
@@ -77,6 +99,14 @@ namespace zephyr_oracle {
ZEPHRSV += val;
} else if (asset_type == "ZYIELD") {
ZYIELD += val;
} else if (asset_type == "ZPH") {
ZPH += val;
} else if (asset_type == "ZSD") {
ZSD += val;
} else if (asset_type == "ZRS") {
ZRS += val;
} else if (asset_type == "ZYS") {
ZYS += val;
}
}
};

View File

@@ -298,4 +298,3 @@ namespace zephyr_oracle
return true;
}
}

View File

@@ -252,4 +252,4 @@ namespace zephyr_oracle
};
};
} // oracle
} // zephyr_oracle