gateway

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BybitRepository added in v1.5.0

type BybitRepository struct {
	BaseURL      string
	APIKey       string
	APISecretKey string
	HTTPClient   *http.Client
	Client       *rest.ByBit
}

func (*BybitRepository) CalculateTPSL added in v1.5.0

func (r *BybitRepository) CalculateTPSL(req domain.TV, value interface{}, isType string) (float64, error)

func (*BybitRepository) CreateOrder added in v1.5.0

func (r *BybitRepository) CreateOrder(req domain.TV) (string, error)

func (*BybitRepository) FetchOrder added in v1.7.0

func (r *BybitRepository) FetchOrder(req *domain.TV, orderID string) error

FetchOrder is set entry price

func (*BybitRepository) GetActiveOrderCount added in v1.7.2

func (r *BybitRepository) GetActiveOrderCount(req *domain.TV, positions *[]rest.LinearPosition) int

func (*BybitRepository) GetClosedOrderLast added in v1.8.0

func (r *BybitRepository) GetClosedOrderLast(symbol string) (*domain.BybitLinearClosedPnLResponse, error)

func (*BybitRepository) GetPositions added in v1.7.2

func (r *BybitRepository) GetPositions(symbol string) (*[]rest.LinearPosition, error)

GetPositions return an array of positions. This func uses deep copy if the symbol is PERP/USDC so return positions are not exactly but only used for GetActiveOrderCount

func (*BybitRepository) GetWalletInfoDeriv added in v1.7.0

func (r *BybitRepository) GetWalletInfoDeriv() (*rest.Balance, error)

func (*BybitRepository) GetWalletInfoUSDC added in v1.6.0

func (r *BybitRepository) GetWalletInfoUSDC() (*domain.BybitWallet, error)

func (*BybitRepository) Set added in v1.5.0

func (r *BybitRepository) Set(req domain.TV)

type SettingRepository added in v1.1.0

type SettingRepository struct {
	RWDB *gorm.DB
	RODB *gorm.DB
}

func (*SettingRepository) Get added in v1.1.0

func (r *SettingRepository) Get(setting domain.Setting) (domain.Setting, error)

func (*SettingRepository) GetByID added in v1.6.0

func (r *SettingRepository) GetByID(id uint64) (domain.Setting, error)

func (*SettingRepository) Set added in v1.1.0

func (r *SettingRepository) Set(setting domain.Setting) (domain.Setting, error)

type TVRepository

type TVRepository struct {
	RWDB *gorm.DB
	RODB *gorm.DB
}

func (*TVRepository) GetPLNullOrders added in v1.8.0

func (r *TVRepository) GetPLNullOrders(settingID uint64) (*[]domain.TVOrder, error)

func (*TVRepository) GetSetting added in v1.7.2

func (r *TVRepository) GetSetting(apiKey, apiSecretKey string) (*domain.Setting, error)

func (*TVRepository) GetSettings added in v1.6.0

func (r *TVRepository) GetSettings() ([]domain.Setting, error)

func (*TVRepository) SaveOrder added in v1.3.0

func (r *TVRepository) SaveOrder(req domain.TV, order *domain.TVOrder) error

func (*TVRepository) SaveWalletHistories added in v1.6.0

func (r *TVRepository) SaveWalletHistories(histories []domain.WalletHistory) error

func (*TVRepository) UpdateOrder added in v1.8.0

func (r *TVRepository) UpdateOrder(order *domain.TVOrder) error

Jump to

Keyboard shortcuts

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