Domain Specific Language
Unary map
map// They might write it like this
fn to_pct(ratios: u64): u64 {
return ratios * 100
}
// or like this
fn to_pct = (ratios: u64) => ratios * 100Binary map
map// They might write it like this:
fn nft_price_to_eth((meta, price): (NFTMeta, u256), exchange_rate: u256): u256 {
let converted_price = price * exchange_rate;
(meta, converted_price)
}
// or like this
fn nft_price_to_eth((meta, price): (NFTMeta, u256), exchange_rate: u256): u256 => (meta, price * exchange_rate)
// then, they can build the dataflow and `export` the output collection:
export collection nfts_priced_in_eth = @input("PRICE_STREAM_ID")
.zip("EXCHANGE_RATE_STREAM_ID")
.map(nft_price_to_eth)Filter for all of the prices for ETH-USDC swaps on Uniswap
Compute a 24-hour block-by-block moving average of the ETH-USDC pair on Uniswap
Compiler Optimizations
Last updated