Module Polymarket.Rfq

RFQ API client for Request for Quote trading.

All RFQ endpoints require L2 authentication.

include module type of struct include Rfq.Client end
type private_key

Abstract type for a private key.

type credentials = {
  1. api_key : string;
  2. secret : string;
  3. passphrase : string;
}

API credentials for L2 authentication.

val default_base_url : string

Default base URL for the RFQ API: https://clob.polymarket.com

type t = Rfq.Client.t

RFQ client with L2 authentication.

Error type for client initialization (TLS setup).

val create : ?base_url:string -> sw:Eio.Switch.t -> net:_ Eio.Net.t -> rate_limiter:Rate_limiter.t -> private_key:private_key -> credentials:credentials -> unit -> (t, init_error) Stdlib.result

Create a new RFQ client.

  • returns

    Ok client on success, Error on TLS initialization failure

val address : t -> string

Get the Ethereum address derived from the private key.

val credentials : t -> credentials

Get the API credentials.

Request Endpoints

val create_request : t -> body:Types.create_request_body -> unit -> (Types.create_request_response, Types.error) Stdlib.result
val cancel_request : t -> request_id:Types.P.Request_id.t -> unit -> (unit, Types.error) Stdlib.result
val get_requests : t -> ?offset:string -> ?limit:int -> ?state:Types.State_filter.t -> ?request_ids:string list -> ?markets:string list -> ?size_min:Types.P.Decimal.t -> ?size_max:Types.P.Decimal.t -> ?size_usdc_min:Types.P.Decimal.t -> ?size_usdc_max:Types.P.Decimal.t -> ?price_min:Types.P.Decimal.t -> ?price_max:Types.P.Decimal.t -> ?sort_by:Types.Sort_by.t -> ?sort_dir:Types.P.Sort_dir.t -> unit -> (Types.get_requests_response, Types.error) Stdlib.result

Quote Endpoints

val create_quote : t -> body:Types.create_quote_body -> unit -> (Types.create_quote_response, Types.error) Stdlib.result
val cancel_quote : t -> quote_id:Types.P.Quote_id.t -> unit -> (unit, Types.error) Stdlib.result
val get_quotes : t -> ?offset:string -> ?limit:int -> ?state:Types.State_filter.t -> ?quote_ids:string list -> ?request_ids:string list -> ?markets:string list -> ?size_min:Types.P.Decimal.t -> ?size_max:Types.P.Decimal.t -> ?size_usdc_min:Types.P.Decimal.t -> ?size_usdc_max:Types.P.Decimal.t -> ?price_min:Types.P.Decimal.t -> ?price_max:Types.P.Decimal.t -> ?sort_by:Types.Sort_by.t -> ?sort_dir:Types.P.Sort_dir.t -> unit -> (Types.get_quotes_response, Types.error) Stdlib.result

Execution Endpoints

val accept_quote : t -> body:Types.accept_quote_body -> unit -> (unit, Types.error) Stdlib.result

Accept a quote. Use Rfq_order_builder.build_accept_quote_body to create the body.

val approve_order : t -> body:Types.approve_order_body -> unit -> (Types.approve_order_response, Types.error) Stdlib.result

Approve an order. Use Rfq_order_builder.build_accept_quote_body to create the body.

module Types : sig ... end

RFQ API types for Polymarket.

module Order_builder : sig ... end

Order building helpers for the RFQ API.