Skip to content

Commit

Permalink
featured instruments interface
Browse files Browse the repository at this point in the history
  • Loading branch information
megsdevs committed Jan 23, 2024
1 parent d43d44f commit 52ddb36
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions proto/valorem/trade/v1/featured_instruments.proto
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 52ddb36

Please sign in to comment.