analysis

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoneOrder

type DoneOrder struct {
	Order
	RemainingSize float64 `json:"remaining_size"`
	Side          string  `json:"side" db:"side"`
	Reason        string  `json:"reason" db:"reason"`
}

type MatchOrder

type MatchOrder struct {
	Order
	Size          float64 `json:"size" db:"size"`
	RemainingSize float64 `json:"remaining_size" db:"remaining_size"`
	Side          string  `json:"side" db:"side"`
}

type OpenOrder

type OpenOrder struct {
	Order
	RemainingSize float64 `json:"remaining_size" db:"remaining_size"`
	Side          string  `json:"side" db:"side"`
}

type Order

type Order struct {
	OrderID   string  `json:"order_id" db:"order_id"` // Use both 'json' and 'db' tags
	Price     float64 `json:"price" db:"price"`
	ProductID string  `json:"product_id,omitempty" db:"product_id,omitempty"`
	Type      string  `json:"type,omitempty" db:"type,omitempty"`
	Timestamp int64   `json:"timestamp,omitempty" db:"timestamp,omitempty"`
}

type ReceivedOrder

type ReceivedOrder struct {
	Order
	OrderType string  `json:"order_type,omitempty"`
	Size      float64 `json:"size" db:"size"`
	Side      string  `json:"side" db:"side"`
}

type Service

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

func NewService

func NewService(db *sqlx.DB, supabaseClient *supabase.Client) *Service

func (*Service) GetLargestMatchOrdersInLastNHours

func (s *Service) GetLargestMatchOrdersInLastNHours(ctx context.Context, hours, limit int) ([]MatchOrder, error)

Get the largest match orders in last N hours

func (*Service) GetLargestOpenOrdersInLastNHours

func (s *Service) GetLargestOpenOrdersInLastNHours(ctx context.Context, hours int, limit int) ([]OpenOrder, error)

Get the largest open orders in last N hours

func (*Service) GetLargestReceivedOrdersInLastNHours

func (s *Service) GetLargestReceivedOrdersInLastNHours(ctx context.Context, hours int, limit int) ([]ReceivedOrder, error)

func (*Service) StoreMatchOrdersInSupabase

func (s *Service) StoreMatchOrdersInSupabase(ctx context.Context, hours int, limit int) error

func (*Service) StoreOpenOrdersInSupabase

func (s *Service) StoreOpenOrdersInSupabase(ctx context.Context, hours int, limit int) error

func (*Service) StoreReceivedOrdersInSupabase

func (s *Service) StoreReceivedOrdersInSupabase(ctx context.Context, hours int, limit int) error

Helper methods for different order types

Directories

Path Synopsis
application
infrastructure

Jump to

Keyboard shortcuts

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