package polymarket
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=4eb4c5d2f63ff081c9713d90be5a51b2
sha512=0e3de0c9b40683e09ab8f9f966a44784ef1b9b482c3eefef84104a7e8042c92f1d79893ee9588b24fa3d0decaed7f365509f4d1c23c66ce8328efb64e721f276
doc/polymarket.gamma/Polymarket_gamma/Client/index.html
Module Polymarket_gamma.ClientSource
Gamma API client for markets, events, series, and search.
include module type of Types
Enum Modules
Parent entity type for comments
Response Types
Pagination information
val pp_pagination :
Ppx_deriving_runtime.Format.formatter ->
pagination ->
Ppx_deriving_runtime.unittype image_optimization = {id : string;image_url_source : string option;image_url_optimized : string option;image_size_kb_source : float option;image_size_kb_optimized : float option;image_optimized_complete : bool option;image_optimized_last_updated : string option;rel_id : int option;field : string option;relname : string option;
}Image optimization data
val pp_image_optimization :
Ppx_deriving_runtime.Format.formatter ->
image_optimization ->
Ppx_deriving_runtime.unitval equal_image_optimization :
image_optimization ->
image_optimization ->
Ppx_deriving_runtime.boolBasic Domain Types
type team = {id : int;name : string option;league : string option;record : string option;logo : string option;abbreviation : string option;alias : string option;created_at : Polymarket_common.Primitives.Timestamp.t option;updated_at : Polymarket_common.Primitives.Timestamp.t option;provider_id : int option;color : string option;
}Sports team
type tag = {id : string;label : string option;slug : string option;force_show : bool option;published_at : string option;created_by : int option;updated_by : int option;created_at : Polymarket_common.Primitives.Timestamp.t option;updated_at : Polymarket_common.Primitives.Timestamp.t option;force_hide : bool option;is_carousel : bool option;requires_translation : bool option;
}Tag for categorization
Related tag relationship
type category = {id : string option;label : string option;parent_category : string option;slug : string option;published_at : string option;created_by : string option;updated_by : string option;created_at : string option;updated_at : string option;
}Market category
val pp_category :
Ppx_deriving_runtime.Format.formatter ->
category ->
Ppx_deriving_runtime.unittype event_creator = {id : string;creator_name : string option;creator_handle : string option;creator_url : string option;creator_image : string option;created_at : string option;updated_at : string option;
}Event creator
val pp_event_creator :
Ppx_deriving_runtime.Format.formatter ->
event_creator ->
Ppx_deriving_runtime.unittype chat = {id : string;channel_id : string option;channel_name : string option;channel_image : string option;live : bool option;start_time : Polymarket_common.Primitives.Timestamp.t option;end_time : Polymarket_common.Primitives.Timestamp.t option;
}Chat channel
type template = {id : string;event_title : string option;event_slug : string option;event_image : string option;market_title : string option;description : string option;resolution_source : string option;neg_risk : bool option;sort_by : string option;show_market_images : bool option;series_slug : string option;outcomes : string option;
}Event template
val pp_template :
Ppx_deriving_runtime.Format.formatter ->
template ->
Ppx_deriving_runtime.unitSearch result tag
val pp_search_tag :
Ppx_deriving_runtime.Format.formatter ->
search_tag ->
Ppx_deriving_runtime.unitComment Types
Position held by a commenter
val pp_comment_position :
Ppx_deriving_runtime.Format.formatter ->
comment_position ->
Ppx_deriving_runtime.unitval equal_comment_position :
comment_position ->
comment_position ->
Ppx_deriving_runtime.booltype comment_profile = {name : string option;pseudonym : string option;display_username_public : bool option;bio : string option;is_mod : bool option;is_creator : bool option;proxy_wallet : string option;base_address : string option;profile_image : string option;profile_image_optimized : image_optimization option;positions : comment_position list;
}Comment author profile
val pp_comment_profile :
Ppx_deriving_runtime.Format.formatter ->
comment_profile ->
Ppx_deriving_runtime.unittype reaction = {id : string;comment_id : int option;reaction_type : string option;icon : string option;user_address : string option;created_at : string option;profile : comment_profile option;
}Comment reaction
val pp_reaction :
Ppx_deriving_runtime.Format.formatter ->
reaction ->
Ppx_deriving_runtime.unittype comment = {id : string;body : string option;parent_entity_type : string option;parent_entity_id : int option;parent_comment_id : string option;user_address : string option;reply_address : string option;created_at : Polymarket_common.Primitives.Timestamp.t option;updated_at : Polymarket_common.Primitives.Timestamp.t option;profile : comment_profile option;reactions : reaction list;report_count : int option;reaction_count : int option;
}Comment
val pp_comment :
Ppx_deriving_runtime.Format.formatter ->
comment ->
Ppx_deriving_runtime.unitProfile Types
Public profile user
val pp_public_profile_user :
Ppx_deriving_runtime.Format.formatter ->
public_profile_user ->
Ppx_deriving_runtime.unitval equal_public_profile_user :
public_profile_user ->
public_profile_user ->
Ppx_deriving_runtime.booltype public_profile_response = {created_at : Polymarket_common.Primitives.Timestamp.t option;proxy_wallet : string option;profile_image : string option;display_username_public : bool option;bio : string option;pseudonym : string option;name : string option;users : public_profile_user list option;x_username : string option;verified_badge : bool option;
}Public profile response
val yojson_of_public_profile_response :
public_profile_response ->
Ppx_yojson_conv_lib.Yojson.Safe.tval public_profile_response_of_yojson :
Ppx_yojson_conv_lib.Yojson.Safe.t ->
public_profile_responseval pp_public_profile_response :
Ppx_deriving_runtime.Format.formatter ->
public_profile_response ->
Ppx_deriving_runtime.unitval equal_public_profile_response :
public_profile_response ->
public_profile_response ->
Ppx_deriving_runtime.booltype profile = {id : string;name : string option;user : int option;referral : string option;created_by : int option;updated_by : int option;created_at : Polymarket_common.Primitives.Timestamp.t option;updated_at : Polymarket_common.Primitives.Timestamp.t option;utm_source : string option;utm_medium : string option;utm_campaign : string option;utm_content : string option;utm_term : string option;wallet_activated : bool option;pseudonym : string option;display_username_public : bool option;profile_image : string option;bio : string option;proxy_wallet : string option;profile_image_optimized : image_optimization option;is_close_only : bool option;is_cert_req : bool option;cert_req_date : string option;
}User profile
val pp_profile :
Ppx_deriving_runtime.Format.formatter ->
profile ->
Ppx_deriving_runtime.unitCollection Type
type collection = {id : string;ticker : string option;slug : string option;title : string option;subtitle : string option;collection_type : string option;description : string option;image : string option;icon : string option;header_image : string option;layout : string option;active : bool option;closed : bool option;archived : bool option;is_new : bool option;featured : bool option;restricted : bool option;is_template : bool option;template_variables : string option;published_at : string option;created_by : string option;updated_by : string option;created_at : string option;updated_at : string option;comments_enabled : bool option;image_optimized : image_optimization option;icon_optimized : image_optimization option;header_image_optimized : image_optimization option;
}Collection of events/markets
val pp_collection :
Ppx_deriving_runtime.Format.formatter ->
collection ->
Ppx_deriving_runtime.unittype clob_reward = {id : string option;condition_id : string option;asset_address : string option;rewards_amount : float option;rewards_daily_rate : float option;start_date : string option;end_date : string option;
}CLOB rewards configuration for a market
val pp_clob_reward :
Ppx_deriving_runtime.Format.formatter ->
clob_reward ->
Ppx_deriving_runtime.unitMutually Recursive Types: Market, Event, Series
type market = {id : string;question : string option;condition_id : string option;slug : string option;twitter_card_image : string option;resolution_source : string option;end_date : Polymarket_common.Primitives.Timestamp.t option;category : string option;amm_type : string option;liquidity : string option;sponsor_name : string option;sponsor_image : string option;start_date : Polymarket_common.Primitives.Timestamp.t option;x_axis_value : string option;y_axis_value : string option;denomination_token : string option;fee : string option;image : string option;icon : string option;lower_bound : string option;upper_bound : string option;description : string option;outcomes : string option;outcome_prices : string option;volume : string option;active : bool option;market_type : string option;format_type : string option;lower_bound_date : string option;upper_bound_date : string option;closed : bool option;market_maker_address : string option;created_by : int option;updated_by : int option;created_at : Polymarket_common.Primitives.Timestamp.t option;updated_at : Polymarket_common.Primitives.Timestamp.t option;closed_time : string option;wide_format : bool option;is_new : bool option;mailchimp_tag : string option;category_mailchimp_tag : string option;sent_discord : bool option;featured : bool option;archived : bool option;resolved_by : string option;restricted : bool option;market_group : int option;group_item_title : string option;group_item_threshold : string option;question_id : string option;uma_end_date : string option;enable_order_book : bool option;order_price_min_tick_size : float option;order_min_size : float option;uma_resolution_status : string option;curation_order : int option;volume_num : float option;liquidity_num : float option;end_date_iso : string option;start_date_iso : string option;uma_end_date_iso : string option;has_reviewed_dates : bool option;ready_for_cron : bool option;comments_enabled : bool option;volume_24hr : float option;volume_1wk : float option;volume_1mo : float option;volume_1yr : float option;game_start_time : string option;seconds_delay : int option;clob_token_ids : string option;disqus_thread : string option;short_outcomes : string option;team_a_id : string option;team_b_id : string option;uma_bond : string option;uma_reward : string option;fpmm_live : bool option;volume_24hr_amm : float option;volume_1wk_amm : float option;volume_1mo_amm : float option;volume_1yr_amm : float option;volume_24hr_clob : float option;volume_1wk_clob : float option;volume_1mo_clob : float option;volume_1yr_clob : float option;volume_amm : float option;volume_clob : float option;liquidity_amm : float option;liquidity_clob : float option;maker_base_fee : int option;taker_base_fee : int option;custom_liveness : int option;accepting_orders : bool option;notifications_enabled : bool option;score : int option;image_optimized : image_optimization option;icon_optimized : image_optimization option;events : event list;categories : category list;creator : string option;ready : bool option;funded : bool option;past_slugs : string option;ready_timestamp : Polymarket_common.Primitives.Timestamp.t option;funded_timestamp : Polymarket_common.Primitives.Timestamp.t option;accepting_orders_timestamp : Polymarket_common.Primitives.Timestamp.t option;competitive : float option;rewards_min_size : float option;rewards_max_spread : float option;spread : float option;automatically_resolved : bool option;one_day_price_change : float option;one_hour_price_change : float option;one_week_price_change : float option;one_month_price_change : float option;one_year_price_change : float option;last_trade_price : float option;best_bid : float option;best_ask : float option;automatically_active : bool option;clear_book_on_start : bool option;chart_color : string option;series_color : string option;show_gmp_series : bool option;show_gmp_outcome : bool option;manual_activation : bool option;neg_risk_other : bool option;game_id : string option;group_item_range : string option;sports_market_type : string option;line : float option;uma_resolution_statuses : string option;pending_deployment : bool option;deploying : bool option;deploying_timestamp : Polymarket_common.Primitives.Timestamp.t option;scheduled_deployment_timestamp : Polymarket_common.Primitives.Timestamp.t option;rfq_enabled : bool option;event_start_time : Polymarket_common.Primitives.Timestamp.t option;cyom : bool option;pager_duty_notification_enabled : bool option;approved : bool option;holding_rewards_enabled : bool option;fees_enabled : bool option;requires_translation : bool option;submitted_by : string option;neg_risk : bool option;neg_risk_market_id : string option;neg_risk_request_id : string option;clob_rewards : clob_reward list;
}Market
and event = {id : string;ticker : string option;slug : string option;title : string option;subtitle : string option;description : string option;resolution_source : string option;start_date : Polymarket_common.Primitives.Timestamp.t option;creation_date : Polymarket_common.Primitives.Timestamp.t option;end_date : Polymarket_common.Primitives.Timestamp.t option;image : string option;icon : string option;active : bool option;closed : bool option;archived : bool option;is_new : bool option;featured : bool option;restricted : bool option;liquidity : float option;volume : float option;open_interest : float option;sort_by : string option;category : string option;subcategory : string option;is_template : bool option;template_variables : string option;published_at : string option;created_by : string option;updated_by : string option;created_at : Polymarket_common.Primitives.Timestamp.t option;updated_at : Polymarket_common.Primitives.Timestamp.t option;comments_enabled : bool option;competitive : float option;volume_24hr : float option;volume_1wk : float option;volume_1mo : float option;volume_1yr : float option;featured_image : string option;disqus_thread : string option;parent_event : string option;enable_order_book : bool option;liquidity_amm : float option;liquidity_clob : float option;neg_risk : bool option;neg_risk_market_id : string option;neg_risk_fee_bips : int option;comment_count : int option;image_optimized : image_optimization option;icon_optimized : image_optimization option;featured_image_optimized : image_optimization option;sub_events : string list option;markets : market list;series : series list;categories : category list;collections : collection list;cyom : bool option;closed_time : Polymarket_common.Primitives.Timestamp.t option;show_all_outcomes : bool option;show_market_images : bool option;automatically_resolved : bool option;enable_neg_risk : bool option;automatically_active : bool option;event_date : string option;start_time : Polymarket_common.Primitives.Timestamp.t option;event_week : int option;series_slug : string option;score : string option;elapsed : string option;period : string option;live : bool option;ended : bool option;finished_timestamp : Polymarket_common.Primitives.Timestamp.t option;gmp_chart_mode : string option;event_creators : event_creator list;tweet_count : int option;chats : chat list;featured_order : int option;estimate_value : bool option;cant_estimate : bool option;estimated_value : string option;templates : template list;spreads_main_line : float option;totals_main_line : float option;carousel_map : string option;pending_deployment : bool option;deploying : bool option;deploying_timestamp : Polymarket_common.Primitives.Timestamp.t option;scheduled_deployment_timestamp : Polymarket_common.Primitives.Timestamp.t option;game_status : string option;neg_risk_augmented : bool option;requires_translation : bool option;
}Event
and series = {id : string;ticker : string option;slug : string option;title : string option;subtitle : string option;series_type : string option;recurrence : string option;description : string option;image : string option;icon : string option;layout : string option;active : bool option;closed : bool option;archived : bool option;is_new : bool option;featured : bool option;restricted : bool option;is_template : bool option;template_variables : bool option;published_at : string option;created_by : string option;updated_by : string option;created_at : Polymarket_common.Primitives.Timestamp.t option;updated_at : Polymarket_common.Primitives.Timestamp.t option;comments_enabled : bool option;competitive : string option;volume_24hr : float option;volume : float option;liquidity : float option;start_date : Polymarket_common.Primitives.Timestamp.t option;pyth_token_id : string option;cg_asset_name : string option;score : int option;events : event list;collections : collection list;categories : category list;comment_count : int option;requires_translation : bool option;chats : chat list;
}Series
Pagination Response Types
Paginated events response
val pp_events_pagination :
Ppx_deriving_runtime.Format.formatter ->
events_pagination ->
Ppx_deriving_runtime.unitval equal_events_pagination :
events_pagination ->
events_pagination ->
Ppx_deriving_runtime.booltype search = {events : event list option;profiles : profile list option;pagination : pagination option;
}Search results
Sports Types
type sports_metadata = {id : int option;sport : string;image : string option;resolution : string option;ordering : string;series : string;created_at : string option;
}Sports metadata
val pp_sports_metadata :
Ppx_deriving_runtime.Format.formatter ->
sports_metadata ->
Ppx_deriving_runtime.unitSports market types response
val yojson_of_sports_market_types_response :
sports_market_types_response ->
Ppx_yojson_conv_lib.Yojson.Safe.tval sports_market_types_response_of_yojson :
Ppx_yojson_conv_lib.Yojson.Safe.t ->
sports_market_types_responseval pp_sports_market_types_response :
Ppx_deriving_runtime.Format.formatter ->
sports_market_types_response ->
Ppx_deriving_runtime.unitval show_sports_market_types_response :
sports_market_types_response ->
Ppx_deriving_runtime.stringval equal_sports_market_types_response :
sports_market_types_response ->
sports_market_types_response ->
Ppx_deriving_runtime.boolField Lists for Extra Field Detection
The client type (alias for HTTP client)
Default base URL: https://gamma-api.polymarket.com
val create :
?base_url:string ->
sw:Eio.Switch.t ->
net:'a Eio.Net.t ->
rate_limiter:Polymarket_rate_limiter.Rate_limiter.t ->
unit ->
tCreate a Gamma API client.
Health Endpoint
Check if the API is healthy.
Teams Endpoints
val get_teams :
t ->
?limit:int ->
?offset:int ->
?order:string list ->
?ascending:bool ->
?league:string list ->
?name:string list ->
?abbreviation:string list ->
unit ->
(team list, Polymarket_http.Client.error) resultGet list of sports teams.
Get list of sports with metadata.
val get_sports_market_types :
t ->
unit ->
(sports_market_types_response, Polymarket_http.Client.error) resultGet list of sports market types.
Tags Endpoints
val get_tags :
t ->
?limit:int ->
?offset:int ->
?order:string list ->
?ascending:bool ->
?include_template:bool ->
?is_carousel:bool ->
unit ->
(tag list, Polymarket_http.Client.error) resultGet list of tags.
val get_tag :
t ->
id:string ->
?include_template:bool ->
unit ->
(tag, Polymarket_http.Client.error) resultGet a tag by ID.
val get_tag_by_slug :
t ->
slug:string ->
?include_template:bool ->
unit ->
(tag, Polymarket_http.Client.error) resultGet a tag by slug.
Get related tags for a tag.
Get related tags for a tag by slug.
Get full tag objects for tags related to a tag.
Get full tag objects for tags related to a tag by slug.
Events Endpoints
val get_events :
t ->
?limit:int ->
?offset:int ->
?order:string list ->
?ascending:bool ->
?id:int list ->
?tag_id:int ->
?exclude_tag_id:int list ->
?slug:string list ->
?tag_slug:string ->
?related_tags:bool ->
?active:bool ->
?archived:bool ->
?featured:bool ->
?cyom:bool ->
?include_chat:bool ->
?include_template:bool ->
?recurrence:string ->
?closed:bool ->
?liquidity_min:float ->
?liquidity_max:float ->
?volume_min:float ->
?volume_max:float ->
?start_date_min:Polymarket_common.Primitives.Timestamp.t ->
?start_date_max:Polymarket_common.Primitives.Timestamp.t ->
?end_date_min:Polymarket_common.Primitives.Timestamp.t ->
?end_date_max:Polymarket_common.Primitives.Timestamp.t ->
unit ->
(event list, Polymarket_http.Client.error) resultList events.
val get_event :
t ->
id:string ->
?include_chat:bool ->
?include_template:bool ->
unit ->
(event, Polymarket_http.Client.error) resultGet an event by ID.
val get_event_by_slug :
t ->
slug:string ->
?include_chat:bool ->
?include_template:bool ->
unit ->
(event, Polymarket_http.Client.error) resultGet an event by slug.
val get_event_tags :
t ->
id:string ->
unit ->
(tag list, Polymarket_http.Client.error) resultGet tags for an event.
Markets Endpoints
val get_markets :
t ->
?limit:int ->
?offset:int ->
?order:string ->
?ascending:bool ->
?id:int list ->
?slug:string list ->
?clob_token_ids:string list ->
?condition_ids:string list ->
?market_maker_address:string list ->
?liquidity_num_min:float ->
?liquidity_num_max:float ->
?volume_num_min:float ->
?volume_num_max:float ->
?start_date_min:Polymarket_common.Primitives.Timestamp.t ->
?start_date_max:Polymarket_common.Primitives.Timestamp.t ->
?end_date_min:Polymarket_common.Primitives.Timestamp.t ->
?end_date_max:Polymarket_common.Primitives.Timestamp.t ->
?tag_id:int ->
?related_tags:bool ->
?cyom:bool ->
?uma_resolution_status:string ->
?game_id:string ->
?sports_market_types:string list ->
?rewards_min_size:float ->
?question_ids:string list ->
?include_tag:bool ->
?closed:bool ->
unit ->
(market list, Polymarket_http.Client.error) resultGet list of markets.
val get_market :
t ->
id:string ->
?include_tag:bool ->
unit ->
(market, Polymarket_http.Client.error) resultGet a market by ID.
val get_market_by_slug :
t ->
slug:string ->
?include_tag:bool ->
unit ->
(market, Polymarket_http.Client.error) resultGet a market by slug.
val get_market_tags :
t ->
id:string ->
unit ->
(tag list, Polymarket_http.Client.error) resultGet tags for a market.
Series Endpoints
val get_series_list :
t ->
?limit:int ->
?offset:int ->
?order:string ->
?ascending:bool ->
?slug:string list ->
?categories_ids:int list ->
?categories_labels:string list ->
?closed:bool ->
?include_chat:bool ->
?recurrence:string ->
unit ->
(series list, Polymarket_http.Client.error) resultGet list of series.
val get_series :
t ->
id:string ->
?include_chat:bool ->
unit ->
(series, Polymarket_http.Client.error) resultGet a series by ID.
Comments Endpoints
val get_comments :
t ->
?limit:int ->
?offset:int ->
?order:string ->
?ascending:bool ->
?parent_entity_type:Parent_entity_type.t ->
?parent_entity_id:int ->
?get_positions:bool ->
?holders_only:bool ->
unit ->
(comment list, Polymarket_http.Client.error) resultGet list of comments.
val get_comment :
t ->
id:string ->
?get_positions:bool ->
unit ->
(comment, Polymarket_http.Client.error) resultGet a comment by ID.
val get_user_comments :
t ->
user_address:string ->
?limit:int ->
?offset:int ->
?order:string ->
?ascending:bool ->
unit ->
(comment list, Polymarket_http.Client.error) resultGet comments by user address.
Profile Endpoints
val get_public_profile :
t ->
address:string ->
unit ->
(public_profile_response, Polymarket_http.Client.error) resultGet public profile by address.
Search Endpoint
val public_search :
t ->
q:string ->
?cache:bool ->
?events_status:string ->
?limit_per_type:int ->
?page:int ->
?events_tag:string list ->
?keep_closed_markets:int ->
?sort:string ->
?ascending:bool ->
?search_tags:bool ->
?search_profiles:bool ->
?recurrence:string ->
?exclude_tag_id:int list ->
?optimized:bool ->
unit ->
(search, Polymarket_http.Client.error) resultSearch for events, tags, and profiles.