trading

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TradingService

type TradingService struct {
	Clob *clob.ClobClient
	Ctf  *ctf.CTFClient
}

TradingService handles all trading execution (orders) and asset management (split/merge)

func NewTradingService

func NewTradingService(clobClient *clob.ClobClient, ctfClient *ctf.CTFClient) *TradingService

func (*TradingService) CancelAll

func (s *TradingService) CancelAll(ctx context.Context) error

CancelAll cancels all orders

func (*TradingService) CancelOrder

func (s *TradingService) CancelOrder(ctx context.Context, orderID string) error

CancelOrder cancels an order

func (*TradingService) CreateOrder

func (s *TradingService) CreateOrder(ctx context.Context, params clob.UserOrderParams, tickSize string, negRisk bool) (*clob.OrderResponse, error)

CreateOrder places a new order via CLOB

func (*TradingService) GetOrder

func (s *TradingService) GetOrder(ctx context.Context, orderID string) (*clob.OrderResponse, error)

GetOrder fetches a single order status

func (*TradingService) Merge

func (s *TradingService) Merge(ctx context.Context, conditionID string, amount float64) (string, error)

Merge redeems conditional tokens

func (*TradingService) Redeem

func (s *TradingService) Redeem(ctx context.Context, conditionID string, outcome string) (string, error)

Redeem redeems positions on a resolved market

func (*TradingService) Split

func (s *TradingService) Split(ctx context.Context, conditionID string, amount float64) (string, error)

Split mints conditional tokens

Jump to

Keyboard shortcuts

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