Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

featured instruments interface #48

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions proto/valorem/trade/v1/featured_instruments.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
syntax = "proto3";

// Import additional EVM data types types.
import "types.proto";

package valorem.trade.v1;

// The FeaturedInstruments service offers related methods to retrieve information about the Valorem's
// currently featured instruments.
service FeaturedInstruments {
// GetFeaturedOptions is a server-streaming RPC. It provides real-time featured options
// for for specified asset pairs across multiple chains.
//
// Parameters:
// FeaturedOptionsRequest: Contains information about which tokens' instruments
// should be fetched on their respective chains.
// Returns:
// stream of AssetPairOptions: Continuously streams data about the featured options
// of the requested tokens on their respective chains
// as updates are available.
rpc GetFeaturedOptions (FeaturedOptionsRequest) returns (stream AssetPairOptions);
}

message FeaturedOptionsRequest {
repeated AssetPairOptions asset = 1; // List of asset pairs to get featured data for.
}

// AssetPairOptions represents the details and the featured options (if available) for a token pair
// on a particular blockchain.
// Note reused message for request and responses, leave featured_options empty for requests.
message AssetPairOptions {
uint64 chain_id = 1; // The specific chain on which the tokens are located.
AssetPair asset_pair = 2; // Pair of ERC20 tokens to retrieve featured options for.
repeated Option featured_options = 3; // List of featured option types with existence flag.
}

// Underlying and exercise ERC20 asset pair for which to retrieve instruments for.
// Note the order of tokens does not matter here.
message AssetPair {
H160 token_a = 1;
H160 token_b = 2;
}

// Option id with created flag.
message Option {
H256 id = 1; // Option type encoded as option_id.
bool created = 2; // True if option type already exists with the clearing house.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also include all the details on the option here, and make it a hashmap of option details keyed on the ID.

}
Loading