Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oraichain/cw-oracle-hub
Price feed oracle implement flex multisig interface
https://github.com/oraichain/cw-oracle-hub
ai-oracle pricefeed
Last synced: about 2 months ago
JSON representation
Price feed oracle implement flex multisig interface
- Host: GitHub
- URL: https://github.com/oraichain/cw-oracle-hub
- Owner: oraichain
- License: other
- Created: 2024-02-26T10:22:24.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-08-13T07:11:57.000Z (5 months ago)
- Last Synced: 2024-08-13T08:34:51.739Z (5 months ago)
- Topics: ai-oracle, pricefeed
- Language: Rust
- Homepage:
- Size: 1.49 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CW Oracle Hub
The CW Oracle Hub contains the logic for oracle price feeding.
## CosmWasm Integration
To invoke the pricefeed contract at the end of each round, set the cw-oracle-hub address as the admin and add the following code to your contract:
```rust
// msg.rs
#[cw_serde]
pub enum SudoMsg {
AppendPrice {
key: String,
price: Uint128,
timestamp: u64,
},
}// contract.rs
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn execute(deps: DepsMut, _env: Env, msg: SudoMsg) -> Result {
match msg {
ExecuteMsg::AppendPrice {
key,
price,
timestamp,
} => append_price(deps, info, key, price, timestamp),
}
}
```