pub trait QueryService: Send + Sync + 'static {
    type SwapExecutionsStream: Stream<Item = Result<SwapExecutionsResponse, Status>> + Send + 'static;
    type ArbExecutionsStream: Stream<Item = Result<ArbExecutionsResponse, Status>> + Send + 'static;
    type LiquidityPositionsStream: Stream<Item = Result<LiquidityPositionsResponse, Status>> + Send + 'static;
    type LiquidityPositionsByIdStream: Stream<Item = Result<LiquidityPositionsByIdResponse, Status>> + Send + 'static;
    type LiquidityPositionsByPriceStream: Stream<Item = Result<LiquidityPositionsByPriceResponse, Status>> + Send + 'static;

    // Required methods
    fn batch_swap_output_data<'life0, 'async_trait>(
        &'life0 self,
        request: Request<BatchSwapOutputDataRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<BatchSwapOutputDataResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn swap_execution<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SwapExecutionRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<SwapExecutionResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn arb_execution<'life0, 'async_trait>(
        &'life0 self,
        request: Request<ArbExecutionRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<ArbExecutionResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn swap_executions<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SwapExecutionsRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SwapExecutionsStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn arb_executions<'life0, 'async_trait>(
        &'life0 self,
        request: Request<ArbExecutionsRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ArbExecutionsStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn liquidity_positions<'life0, 'async_trait>(
        &'life0 self,
        request: Request<LiquidityPositionsRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::LiquidityPositionsStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn liquidity_position_by_id<'life0, 'async_trait>(
        &'life0 self,
        request: Request<LiquidityPositionByIdRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<LiquidityPositionByIdResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn liquidity_positions_by_id<'life0, 'async_trait>(
        &'life0 self,
        request: Request<LiquidityPositionsByIdRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::LiquidityPositionsByIdStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn liquidity_positions_by_price<'life0, 'async_trait>(
        &'life0 self,
        request: Request<LiquidityPositionsByPriceRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::LiquidityPositionsByPriceStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn spread<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SpreadRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<SpreadResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Available on crate feature rpc only.
Expand description

Generated trait containing gRPC methods that should be implemented for use with QueryServiceServer.

Required Associated Types§

source

type SwapExecutionsStream: Stream<Item = Result<SwapExecutionsResponse, Status>> + Send + 'static

Server streaming response type for the SwapExecutions method.

source

type ArbExecutionsStream: Stream<Item = Result<ArbExecutionsResponse, Status>> + Send + 'static

Server streaming response type for the ArbExecutions method.

source

type LiquidityPositionsStream: Stream<Item = Result<LiquidityPositionsResponse, Status>> + Send + 'static

Server streaming response type for the LiquidityPositions method.

source

type LiquidityPositionsByIdStream: Stream<Item = Result<LiquidityPositionsByIdResponse, Status>> + Send + 'static

Server streaming response type for the LiquidityPositionsById method.

source

type LiquidityPositionsByPriceStream: Stream<Item = Result<LiquidityPositionsByPriceResponse, Status>> + Send + 'static

Server streaming response type for the LiquidityPositionsByPrice method.

Required Methods§

source

fn batch_swap_output_data<'life0, 'async_trait>( &'life0 self, request: Request<BatchSwapOutputDataRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<BatchSwapOutputDataResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the batch clearing prices for a specific block height and trading pair.

source

fn swap_execution<'life0, 'async_trait>( &'life0 self, request: Request<SwapExecutionRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<SwapExecutionResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the precise swap execution used for a specific batch swap.

source

fn arb_execution<'life0, 'async_trait>( &'life0 self, request: Request<ArbExecutionRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<ArbExecutionResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the precise execution used to perform on-chain arbitrage.

source

fn swap_executions<'life0, 'async_trait>( &'life0 self, request: Request<SwapExecutionsRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SwapExecutionsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stream all swap executions over a range of heights, optionally subscribing to future executions.

source

fn arb_executions<'life0, 'async_trait>( &'life0 self, request: Request<ArbExecutionsRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ArbExecutionsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stream all arbitrage executions over a range of heights, optionally subscribing to future executions.

source

fn liquidity_positions<'life0, 'async_trait>( &'life0 self, request: Request<LiquidityPositionsRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::LiquidityPositionsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query all liquidity positions on the DEX.

source

fn liquidity_position_by_id<'life0, 'async_trait>( &'life0 self, request: Request<LiquidityPositionByIdRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<LiquidityPositionByIdResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query liquidity positions by ID.

To get multiple positions, use LiquidityPositionsById.

source

fn liquidity_positions_by_id<'life0, 'async_trait>( &'life0 self, request: Request<LiquidityPositionsByIdRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::LiquidityPositionsByIdStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query multiple liquidity positions by ID.

source

fn liquidity_positions_by_price<'life0, 'async_trait>( &'life0 self, request: Request<LiquidityPositionsByPriceRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::LiquidityPositionsByPriceStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query liquidity positions on a specific pair, sorted by effective price.

source

fn spread<'life0, 'async_trait>( &'life0 self, request: Request<SpreadRequest> ) -> Pin<Box<dyn Future<Output = Result<Response<SpreadResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the current (direct) spread on a trading pair.

This method doesn’t do simulation, so actually executing might result in a better price (if the chain takes a different route to the target asset).

Implementors§