Service Methods
- Table of Methods
- Protobuf
The Market Data Price Service has the following methods:
syntax = "proto3";
package meshtrade.market_data.price.v1;
import "buf/validate/validate.proto";
import "meshtrade/market_data/price/v1/price.proto";
import "meshtrade/option/method_options/v1/method_options.proto";
import "meshtrade/type/v1/token.proto";
option go_package = "github.com/meshtrade/api/go/market_data/price/v1;price_v1";
option java_package = "co.meshtrade.api.market_data.price.v1";
/*
PriceService provides market data pricing information.
This service enables retrieval of current market prices for token pairs,
supporting trading decisions and portfolio valuation.
*/
service PriceService {
/*
Retrieves the current price for a specified token pair.
Returns the mid-market price for the base token denominated in the quote token.
*/
rpc GetCurrentPriceByTokenPair(GetCurrentPriceByTokenPairRequest) returns (meshtrade.market_data.price.v1.Price) {
option (meshtrade.option.method_options.v1.method_options) = {
type: METHOD_TYPE_READ
access_level: METHOD_ACCESS_LEVEL_AUTHORISED
roles: [
ROLE_MARKET_DATA_ADMIN,
ROLE_MARKET_DATA_VIEWER,
ROLE_MARKET_DATA_PRICE_ADMIN,
ROLE_MARKET_DATA_PRICE_VIEWER
]
};
}
}
/*
Request to retrieve the current price for a token pair.
*/
message GetCurrentPriceByTokenPairRequest {
/*
The base token for which a price is required.
This is the token being priced (e.g., BTC in a BTC/USD pair).
*/
meshtrade.type.v1.Token base_token = 1 [(buf.validate.field) = {required: true}];
/*
The quote token in which the price should be denominated.
This is the unit of measurement for the price (e.g., USD in a BTC/USD pair).
*/
meshtrade.type.v1.Token quote_token = 2 [(buf.validate.field) = {required: true}];
}