- atom: Oracle Smart Contracts
- js_tests: JS Tests
"sd" -> {double}
"mean" -> {double}
"median" -> {double, uint64_t}
"mode" -> {double, uint64_t, string}
"last" -> {double, uint64_t, string}
Notes: Median will return average of middle two values if an even number of values are present. Mode will return the last mode if there are 2 or more modes in the dataset.
{uint64_t} data_window_size (min 1, max 250)
{uint64_t} data_same_provider_limit (optional)
{uint64_t} data_freshness_sec (optional)
{uint64_t} min_provider_wait_sec (optional)
"string" -> std::string
"uint64_t" -> uint64_t
"double" -> double
Creates or replaces a feed
- authority:
get_self()
{optional<uint64_t>} index
- (Optional) Index of the feed if updating{string} name
- name of feed{string} description
- description of feed{string} aggregate_function
- type of aggregate function{string} data_type
- flash loan fee{map<string, uint64_t>} config
- Feed config{vector<name>} providers
- All feed providers
Removes a feed
- authority:
get_self()
{uint64_t} index
- Index of the feed to remove
Feed data as a provider
- authority:
account
{name} account
- Provider account{uint64_t} feed_index
- Index of the feed to provide data to{data_variant} data
- Data to provide
Create multisig
- authority:
proposer
{name} propose
- Proposer account{Feed} feed
- New feed to propose
Approve / reject multisig
- authority:
provider
{name} provider
- Provider account{uint64_t} msig_index
- Index of the msig to approve{bool} vote
-true
to approve /false
to reject
execute multisig
- authority: no authority needed
{uint64_t} msig_index
- Index of the msig to execute
Cancel multisig
- authority:
provider
{name} proposer
- Proposer account{uint64_t} msig_index
- Index of the msig to cancel
{uint64_t} index
- index of the feed{string} name
- name of feed{string} description
- description of feed{string} aggregate_function
- type of aggregate function{string} data_type
- flash loan fee{map<string, uint64_t>} config
- Feed config{map<name, time_point>} providers
- Map of provider name to last time they provided data
{
"index": 0,
"name": "XPR/BTC",
"description": "Oracle for real-time provision of XPR price against BTC",
"aggregate_function": "mean",
"data_type": "double",
"config": {
"data_window_size": 20,
"data_same_provider_limit": 5
},
"providers": {
"bot1": "1970-01-01T00:00:00.000",
"bot2": "1970-01-01T00:00:00.000",
"bot3": "1970-01-01T00:00:00.000"
}
}
{uint64_t} feed_index
- index of the feed{data_variant} aggregate
- aggegrate data point{vector<ProviderPoint>} points
- vector of provider points
{
"index": 0,
"aggregate": {
"d_string": null,
"d_uint64_t": null,
"d_double": "18293.82000000000334694"
} ,
"points": [
{
"provider": "bot4",
"time": "2020-12-12T02:04:37.500",
"data": {
"d_string": null,
"d_uint64_t": null,
"d_double": "18293.81999999999970896"
}
},
]
}
{uint64_t} index
- index of the msig{name} proposer
- aggegrate data point{Feed} new_feed
- vector of provider points{map<name, bool>} votes
- Map of providers who have voted to their true/false vote
{
"index": 0,
"proposer": "bot1",
"new_feed": {
"index": 0,
"name": "XPR/BTC",
"description": "NEW DESCRIPTION",
"aggregate_function": "mean",
"data_type": "double",
"config": {
"data_window_size": 20,
"data_same_provider_limit": 5
},
"providers": ["bot1", "bot2", "bot3"]
},
"votes": {
"bot1": true,
"bot2": false
}
}