Updated ZEPH
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cryptoforknote-util",
|
"name": "cryptoforknote-util",
|
||||||
"version": "15.7.0",
|
"version": "15.7.1",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "LucasJones",
|
"name": "LucasJones",
|
||||||
"email": "lucasjonesdev@hotmail.co.uk"
|
"email": "lucasjonesdev@hotmail.co.uk"
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
template <template <bool> class Archive>
|
template <template <bool> class Archive>
|
||||||
bool do_serialize(Archive<false> &ar, zephyr_oracle::pricing_record &pr, uint8_t version)
|
bool do_serialize(Archive<false> &ar, zephyr_oracle::pricing_record &pr, uint8_t version)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (version >= 6)
|
if (version >= 6)
|
||||||
{
|
{
|
||||||
// very basic sanity check
|
// very basic sanity check
|
||||||
|
|||||||
@@ -32,6 +32,10 @@
|
|||||||
namespace zephyr_oracle {
|
namespace zephyr_oracle {
|
||||||
|
|
||||||
const std::vector<std::string> ASSET_TYPES = {"ZEPH", "ZEPHUSD", "ZEPHRSV", "ZYIELD"};
|
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
|
class asset_type_counts
|
||||||
{
|
{
|
||||||
@@ -44,11 +48,21 @@ namespace zephyr_oracle {
|
|||||||
uint64_t ZEPHRSV;
|
uint64_t ZEPHRSV;
|
||||||
uint64_t ZYIELD;
|
uint64_t ZYIELD;
|
||||||
|
|
||||||
|
// v2 fields
|
||||||
|
uint64_t ZPH;
|
||||||
|
uint64_t ZSD;
|
||||||
|
uint64_t ZRS;
|
||||||
|
uint64_t ZYS;
|
||||||
|
|
||||||
asset_type_counts() noexcept
|
asset_type_counts() noexcept
|
||||||
: ZEPH(0)
|
: ZEPH(0)
|
||||||
, ZEPHUSD(0)
|
, ZEPHUSD(0)
|
||||||
, ZEPHRSV(0)
|
, ZEPHRSV(0)
|
||||||
, ZYIELD(0)
|
, ZYIELD(0)
|
||||||
|
, ZPH(0)
|
||||||
|
, ZSD(0)
|
||||||
|
, ZRS(0)
|
||||||
|
, ZYS(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,6 +76,14 @@ namespace zephyr_oracle {
|
|||||||
return ZEPHRSV;
|
return ZEPHRSV;
|
||||||
} else if (asset_type == "ZYIELD") {
|
} else if (asset_type == "ZYIELD") {
|
||||||
return 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;
|
return 0;
|
||||||
@@ -77,6 +99,14 @@ namespace zephyr_oracle {
|
|||||||
ZEPHRSV += val;
|
ZEPHRSV += val;
|
||||||
} else if (asset_type == "ZYIELD") {
|
} else if (asset_type == "ZYIELD") {
|
||||||
ZYIELD += val;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -298,4 +298,3 @@ namespace zephyr_oracle
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -252,4 +252,4 @@ namespace zephyr_oracle
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // oracle
|
} // zephyr_oracle
|
||||||
|
|||||||
Reference in New Issue
Block a user