-
-
Save tansawit/08e98c9fd437a43a9011712747edfd07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Preparation Phase | |
#[no_mangle] | |
fn prepare_impl(input: Input) { | |
// Coingecko volume data source | |
oei::ask_external_data(1, 9, &input.symbol.as_bytes()); | |
} | |
// Execution Phase | |
#[no_mangle] | |
fn execute_impl(input: Input) -> Output { | |
let avg: f64 = ext::load_average(1); | |
Output { volume: (avg * input.multiplier as f64) as u64 } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment