combo

package
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package combo implements Polymarket Combo market discovery and maker RFQ REST APIs.

Index

Constants

View Source
const (
	DefaultHost = "https://combos-rfq-api.polymarket.com"
	ZeroBytes32 = clob.ZeroBytes32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuiltQuote

type BuiltQuote struct {
	PriceE6     pmtypes.String
	SizeE6      pmtypes.String
	SignedOrder SignedOrder
}

type CancelQuoteRequest

type CancelQuoteRequest struct {
	RFQID   RFQID   `json:"rfq_id"`
	QuoteID QuoteID `json:"quote_id"`
	Identity
}

type CancelQuoteResponse

type CancelQuoteResponse struct {
	RFQID   RFQID   `json:"rfq_id"`
	QuoteID QuoteID `json:"quote_id"`
	Success bool    `json:"success"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host string, opts ...Option) *Client

func (*Client) AuthAddress

func (c *Client) AuthAddress() string

func (*Client) CancelQuote

func (c *Client) CancelQuote(ctx context.Context, req CancelQuoteRequest, out *CancelQuoteResponse) error

func (*Client) ChainID

func (c *Client) ChainID() int64

func (*Client) Credentials

func (c *Client) Credentials() *clob.Credentials

func (*Client) GetMarkets

func (c *Client) GetMarkets(ctx context.Context, params MarketParams, out *MarketPage) error

func (*Client) Host

func (c *Client) Host() string

func (*Client) Identity

func (c *Client) Identity() Identity

func (*Client) RespondLastLook

func (c *Client) RespondLastLook(ctx context.Context, req LastLookRequest, out *LastLookResponse) error

func (*Client) Signer

func (c *Client) Signer() *polyauth.Signer

func (*Client) SubmitQuote

func (c *Client) SubmitQuote(ctx context.Context, req SubmitQuoteRequest, out *QuoteResponse) error

type ComboConditionID

type ComboConditionID string

func NormalizeConditionID

func NormalizeConditionID(value string) (ComboConditionID, error)

type ConfirmationDecision

type ConfirmationDecision string
const (
	ConfirmationConfirm ConfirmationDecision = "CONFIRM"
	ConfirmationDecline ConfirmationDecision = "DECLINE"
)

type Direction

type Direction string
const (
	DirectionBuy  Direction = "BUY"
	DirectionSell Direction = "SELL"
)

type ExecutionStatus

type ExecutionStatus string
const (
	ExecutionMatched   ExecutionStatus = "MATCHED"
	ExecutionMined     ExecutionStatus = "MINED"
	ExecutionConfirmed ExecutionStatus = "CONFIRMED"
	ExecutionRetrying  ExecutionStatus = "RETRYING"
	ExecutionFailed    ExecutionStatus = "FAILED"
)

func (ExecutionStatus) Terminal

func (s ExecutionStatus) Terminal() bool

type Identity

type Identity struct {
	SignerAddress string             `json:"signer_address"`
	MakerAddress  string             `json:"maker_address"`
	SignatureType clob.SignatureType `json:"signature_type"`
}

type LastLookRequest

type LastLookRequest struct {
	RFQID   RFQID   `json:"rfq_id"`
	QuoteID QuoteID `json:"quote_id"`
	Identity
	Decision ConfirmationDecision `json:"decision"`
}

type LastLookResponse

type LastLookResponse struct {
	RFQID   RFQID   `json:"rfq_id"`
	QuoteID QuoteID `json:"quote_id"`
	Success bool    `json:"success"`
}

type Market

type Market struct {
	ID          pmtypes.String  `json:"id"`
	ConditionID string          `json:"condition_id"`
	Slug        string          `json:"slug"`
	Title       string          `json:"title"`
	Yes         MarketOutcome   `json:"yes"`
	No          MarketOutcome   `json:"no"`
	Image       string          `json:"image"`
	Volume      pmtypes.Float64 `json:"volume"`
	Tags        []string        `json:"tags"`
}

func (*Market) UnmarshalJSON

func (m *Market) UnmarshalJSON(data []byte) error

type MarketOutcome

type MarketOutcome struct {
	Label      string
	PositionID pmtypes.String
	Price      pmtypes.String
}

type MarketPage

type MarketPage struct {
	Markets    []Market       `json:"markets"`
	NextCursor pmtypes.String `json:"next_cursor"`
}

type MarketParams

type MarketParams struct {
	Limit   int
	Cursor  string
	Exclude []string
}

type Option

type Option func(*Client)

func WithAuthAddress

func WithAuthAddress(address string) Option

WithAuthAddress sets the EOA that owns the configured CLOB API credentials. It is distinct from the order identity for POLY_1271 deposit wallets.

func WithChainID

func WithChainID(chainID int64) Option

func WithCredentials

func WithCredentials(credentials clob.Credentials) Option

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

func WithIdentity

func WithIdentity(identity Identity) Option

func WithServerTime

func WithServerTime(enabled bool) Option

func WithSigner

func WithSigner(signer *polyauth.Signer) Option

type QuoteBuilder

type QuoteBuilder struct {
	// contains filtered or unexported fields
}

func NewQuoteBuilder

func NewQuoteBuilder(client *Client) *QuoteBuilder

func (*QuoteBuilder) BuildAndSign

func (b *QuoteBuilder) BuildAndSign(request QuoteRequest, opts QuoteOptions) (*BuiltQuote, error)

type QuoteID

type QuoteID string

type QuoteOptions

type QuoteOptions struct {
	Price  string
	Size   string
	Source QuoteSource
}

type QuoteRequest

type QuoteRequest struct {
	RFQID              RFQID             `json:"rfq_id"`
	RequestorPublicID  RequestorPublicID `json:"requestor_public_id"`
	LegPositionIDs     []pmtypes.String  `json:"leg_position_ids"`
	ConditionID        ComboConditionID  `json:"condition_id"`
	YesPositionID      pmtypes.String    `json:"yes_position_id"`
	NoPositionID       pmtypes.String    `json:"no_position_id"`
	Direction          Direction         `json:"direction"`
	Side               Side              `json:"side"`
	RequestedSize      RequestedSize     `json:"requested_size"`
	SubmissionDeadline pmtypes.Int64     `json:"submission_deadline"`
}

type QuoteResponse

type QuoteResponse struct {
	RFQID   RFQID   `json:"rfq_id"`
	QuoteID QuoteID `json:"quote_id"`
	Success bool    `json:"success"`
	Status  string  `json:"status"`
}

type QuoteSource

type QuoteSource string
const (
	QuoteSourceCollateral QuoteSource = "collateral"
	QuoteSourceInventory  QuoteSource = "inventory"
)

type RFQID

type RFQID string

type RequestedSize

type RequestedSize struct {
	Unit    RequestedSizeUnit `json:"unit"`
	ValueE6 pmtypes.String    `json:"value_e6"`
}

type RequestedSizeUnit

type RequestedSizeUnit string
const (
	RequestedSizeNotional RequestedSizeUnit = "notional"
	RequestedSizeShares   RequestedSizeUnit = "shares"
)

type RequestorPublicID

type RequestorPublicID string

type Side

type Side string
const SideYes Side = "YES"

type SignedOrder

type SignedOrder struct {
	Salt          pmtypes.String     `json:"salt"`
	Maker         string             `json:"maker"`
	Signer        string             `json:"signer"`
	TokenID       pmtypes.String     `json:"tokenId"`
	MakerAmount   pmtypes.String     `json:"makerAmount"`
	TakerAmount   pmtypes.String     `json:"takerAmount"`
	Side          int                `json:"side"`
	SignatureType clob.SignatureType `json:"signatureType"`
	Timestamp     pmtypes.String     `json:"timestamp"`
	Expiration    pmtypes.String     `json:"expiration,omitempty"`
	Metadata      string             `json:"metadata,omitempty"`
	Builder       string             `json:"builder,omitempty"`
	Signature     string             `json:"signature"`
}

type SubmitQuoteRequest

type SubmitQuoteRequest struct {
	QuoteID QuoteID `json:"quote_id"`
	RFQID   RFQID   `json:"rfq_id"`
	Identity
	PriceE6     pmtypes.String `json:"price_e6"`
	SizeE6      pmtypes.String `json:"size_e6"`
	SignedOrder SignedOrder    `json:"signed_order"`
}

Directories

Path Synopsis
Package ws implements the authenticated Polymarket Combo RFQ quoter WebSocket.
Package ws implements the authenticated Polymarket Combo RFQ quoter WebSocket.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL