-
Notifications
You must be signed in to change notification settings - Fork 2
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
megsdevs
wants to merge
8
commits into
main
Choose a base branch
from
megsdevs/val-1907-new-option-type-creation-script
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
52ddb36
featured instruments interface
megsdevs 97a97db
fix field number
megsdevs 4717fb0
improve namespace
megsdevs 0901dee
improved commentary
megsdevs e1ece4d
fix commentary
megsdevs 101b975
less verbose name
megsdevs a076660
rename service proto
megsdevs 47c22f3
fix pairs field name
megsdevs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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. | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.