diff --git a/proto/valorem/trade/v1/featured_instruments.proto b/proto/valorem/trade/v1/featured_instruments.proto new file mode 100644 index 0000000..34995d7 --- /dev/null +++ b/proto/valorem/trade/v1/featured_instruments.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +// Import additional EVM data types types. +import "types.proto"; + +package valorem.trade.v1; + +// The FeaturedInstruments service offers live streams of the featured instruments for provided asset pairs. +service FeaturedInstruments { + // Streams the featured option types for specified asset pairs. Option types are returned for a pair on the stream + // roughly once per block. + rpc GetOptionTypes (OptionTypesRequest) returns (stream OptionTypes); +} + +message OptionTypesRequest { + // List of asset pairs to get featured options for. + repeated OptionTypes option_types = 1; +} + +message OptionTypes { + // The specific chain on which the tokens are located. + uint64 chain_id = 1; + + // Pair of ERC20 tokens to retrieve all featured options for. + AssetPair asset_pair = 2; + + // List of featured option types encoded as option_ids, along with a flag to determine if the option already exists + // with the clearing house. + // Reused message, leave empty for requests. + repeated OptionId option_id = 5; +} + +// Underlying and exercise ERC20 asset pair for which to retrieve instruments for. +// Note the order of tokens does not matter here. +message AssetPair { + H160 token1 = 1; + H160 token2 = 2; +} + +// Option id with created flag. +message OptionId { + // Option type encoded as option_id. + H256 option_id = 1; + + // True if option type already exists with the clearing house. + bool created = 2; +}