model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GridModel

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

func NewGridModel

func NewGridModel(client *ent.GridClient) *GridModel

func (*GridModel) DeleteByGuid

func (model *GridModel) DeleteByGuid(ctx context.Context, guid string) (int, error)

func (*GridModel) DeleteByStrategyId

func (model *GridModel) DeleteByStrategyId(ctx context.Context, strategyId string) (int, error)

func (*GridModel) FindByGuid

func (model *GridModel) FindByGuid(ctx context.Context, guid string) (*ent.Grid, error)

func (*GridModel) FindByStrategyId

func (model *GridModel) FindByStrategyId(ctx context.Context, strategyId string) ([]*ent.Grid, error)

func (*GridModel) Save

func (model *GridModel) Save(ctx context.Context, args ent.Grid) (*ent.Grid, error)

func (*GridModel) SetBoughtStatus

func (model *GridModel) SetBoughtStatus(ctx context.Context, guid string, finalPrice, quantity decimal.Decimal) error

func (*GridModel) SetSellingStatus

func (model *GridModel) SetSellingStatus(ctx context.Context, guid string) error

func (*GridModel) UpdateStatusByGuid

func (model *GridModel) UpdateStatusByGuid(ctx context.Context, guid string, status grid.Status) error

type NonceModel

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

func NewNonceModel

func NewNonceModel(client *ent.NonceClient) *NonceModel

func (*NonceModel) FindOne

func (m *NonceModel) FindOne(ctx context.Context, account string) (*ent.Nonce, error)

func (*NonceModel) Save

func (m *NonceModel) Save(ctx context.Context, account string, n uint64) error

func (*NonceModel) UpdateNonce

func (m *NonceModel) UpdateNonce(ctx context.Context, account string, newValue uint64) error

type OrderModel

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

func NewOrderModel

func NewOrderModel(client *ent.OrderClient) *OrderModel

func (*OrderModel) FindOrdersByStrategyId

func (model *OrderModel) FindOrdersByStrategyId(ctx context.Context, strategyId string, offset, limit int) ([]*ent.Order, int, error)

func (*OrderModel) FindPendingOrders

func (model *OrderModel) FindPendingOrders(ctx context.Context, limit int) ([]*ent.Order, error)

func (*OrderModel) Save

func (model *OrderModel) Save(ctx context.Context, args ent.Order) (*ent.Order, error)

func (*OrderModel) SetOrderClosedStatus

func (model *OrderModel) SetOrderClosedStatus(ctx context.Context, id int, finalPrice, outAmount decimal.Decimal) error

func (*OrderModel) SetOrderRejectedStatus

func (model *OrderModel) SetOrderRejectedStatus(ctx context.Context, id int, reason string) error

func (*OrderModel) TotalProfit

func (model *OrderModel) TotalProfit(ctx context.Context, strategyId string, firstOrderId int) (decimal.Decimal, error)

func (*OrderModel) UpdateProfit

func (model *OrderModel) UpdateProfit(ctx context.Context, id int, profit decimal.Decimal) error

type SettingsModel

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

func NewSettingsModel

func NewSettingsModel(client *ent.SettingsClient) *SettingsModel

func (*SettingsModel) FindByUserId

func (model *SettingsModel) FindByUserId(ctx context.Context, userId int64) (*ent.Settings, error)

func (*SettingsModel) Save

func (model *SettingsModel) Save(ctx context.Context, args ent.Settings) (*ent.Settings, error)

func (*SettingsModel) UpdateDexAggregator

func (model *SettingsModel) UpdateDexAggregator(ctx context.Context, id int, dexAggregator settings.DexAggregator) error

func (*SettingsModel) UpdateEnableInfiniteApproval

func (model *SettingsModel) UpdateEnableInfiniteApproval(ctx context.Context, id int, newValue bool) error

func (*SettingsModel) UpdateExitSlippageBps

func (model *SettingsModel) UpdateExitSlippageBps(ctx context.Context, id int, newValue int) error

func (*SettingsModel) UpdateSellSlippageBps

func (model *SettingsModel) UpdateSellSlippageBps(ctx context.Context, id int, newValue int) error

func (*SettingsModel) UpdateSlippageBps

func (model *SettingsModel) UpdateSlippageBps(ctx context.Context, id int, newValue int) error

type StrategyModel

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

func NewStrategyModel

func NewStrategyModel(client *ent.StrategyClient) *StrategyModel

func (*StrategyModel) ClearLastLowerThresholdAlertTime

func (model *StrategyModel) ClearLastLowerThresholdAlertTime(ctx context.Context, id int) error

func (*StrategyModel) ClearLastUpperThresholdAlertTime

func (model *StrategyModel) ClearLastUpperThresholdAlertTime(ctx context.Context, id int) error

func (*StrategyModel) Delete

func (model *StrategyModel) Delete(ctx context.Context, id int) error

func (*StrategyModel) FindAllActive

func (model *StrategyModel) FindAllActive(ctx context.Context, offset, limit int) ([]*ent.Strategy, error)

func (*StrategyModel) FindByGUID

func (model *StrategyModel) FindByGUID(ctx context.Context, guid string) (*ent.Strategy, error)

func (*StrategyModel) FindByUserId

func (model *StrategyModel) FindByUserId(ctx context.Context, userId int64, offset, limit int) ([]*ent.Strategy, int, error)

func (*StrategyModel) FindByUserIdGUID

func (model *StrategyModel) FindByUserIdGUID(ctx context.Context, userId int64, guid string) (*ent.Strategy, error)

func (*StrategyModel) FindByUserIdToken

func (model *StrategyModel) FindByUserIdToken(ctx context.Context, userId int64, token string) (*ent.Strategy, error)

func (*StrategyModel) Save

func (model *StrategyModel) Save(ctx context.Context, args ent.Strategy) (*ent.Strategy, error)

func (*StrategyModel) UpdateCandlesToCheck

func (model *StrategyModel) UpdateCandlesToCheck(ctx context.Context, id int, candlesToCheck int) error

func (*StrategyModel) UpdateDropOn

func (model *StrategyModel) UpdateDropOn(ctx context.Context, id int, newValue bool) error

func (*StrategyModel) UpdateDropThreshold

func (model *StrategyModel) UpdateDropThreshold(ctx context.Context, id int, dropThreshold decimal.Decimal) error

func (*StrategyModel) UpdateDynamicStopLoss

func (model *StrategyModel) UpdateDynamicStopLoss(ctx context.Context, id int, newValue bool) error

func (*StrategyModel) UpdateEnableAutoBuy

func (model *StrategyModel) UpdateEnableAutoBuy(ctx context.Context, id int, newValue bool) error

func (*StrategyModel) UpdateEnableAutoExit

func (model *StrategyModel) UpdateEnableAutoExit(ctx context.Context, id int, newValue bool) error

func (*StrategyModel) UpdateEnableAutoSell

func (model *StrategyModel) UpdateEnableAutoSell(ctx context.Context, id int, newValue bool) error

func (*StrategyModel) UpdateEnablePushNotification

func (model *StrategyModel) UpdateEnablePushNotification(ctx context.Context, id int, newValue bool) error

func (*StrategyModel) UpdateFirstOrderId

func (model *StrategyModel) UpdateFirstOrderId(ctx context.Context, id int, newValue *int) error

func (*StrategyModel) UpdateFiveKlineVolume

func (model *StrategyModel) UpdateFiveKlineVolume(ctx context.Context, id int, newValue decimal.Decimal) error

func (*StrategyModel) UpdateGlobalTakeProfitRatio

func (model *StrategyModel) UpdateGlobalTakeProfitRatio(ctx context.Context, id int, newValue decimal.Decimal) error

func (*StrategyModel) UpdateGridTrend

func (model *StrategyModel) UpdateGridTrend(ctx context.Context, id int, trending string) error

func (*StrategyModel) UpdateInitialOrderSize

func (model *StrategyModel) UpdateInitialOrderSize(ctx context.Context, id int, newValue decimal.Decimal) error

func (*StrategyModel) UpdateLastKlineVolume

func (model *StrategyModel) UpdateLastKlineVolume(ctx context.Context, id int, newValue decimal.Decimal) error

func (*StrategyModel) UpdateLastLowerThresholdAlertTime

func (model *StrategyModel) UpdateLastLowerThresholdAlertTime(ctx context.Context, id int, newValue time.Time) error

func (*StrategyModel) UpdateLastUpperThresholdAlertTime

func (model *StrategyModel) UpdateLastUpperThresholdAlertTime(ctx context.Context, id int, newValue time.Time) error

func (*StrategyModel) UpdateLowerPriceBound

func (model *StrategyModel) UpdateLowerPriceBound(ctx context.Context, id int, newValue decimal.Decimal) error

func (*StrategyModel) UpdateMaxGridLimit

func (model *StrategyModel) UpdateMaxGridLimit(ctx context.Context, id int, newValue int) error

func (*StrategyModel) UpdateStatusByGuid

func (model *StrategyModel) UpdateStatusByGuid(ctx context.Context, guid string, newValue strategy.Status) error

func (*StrategyModel) UpdateStopLossExit

func (model *StrategyModel) UpdateStopLossExit(ctx context.Context, id int, newValue decimal.Decimal) error

func (*StrategyModel) UpdateTakeProfitExit

func (model *StrategyModel) UpdateTakeProfitExit(ctx context.Context, id int, newValue decimal.Decimal) error

func (*StrategyModel) UpdateTakeProfitRatio

func (model *StrategyModel) UpdateTakeProfitRatio(ctx context.Context, id int, newValue decimal.Decimal) error

func (*StrategyModel) UpdateUpperBoundExit

func (model *StrategyModel) UpdateUpperBoundExit(ctx context.Context, id int, newValue decimal.Decimal) error

func (*StrategyModel) UpdateUpperPriceBound

func (model *StrategyModel) UpdateUpperPriceBound(ctx context.Context, id int, newValue decimal.Decimal) error

type WalletModel

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

func NewWalletModel

func NewWalletModel(client *ent.WalletClient) *WalletModel

func (*WalletModel) FindByAccount

func (model *WalletModel) FindByAccount(ctx context.Context, account string) (*ent.Wallet, error)

func (*WalletModel) FindByUserId

func (model *WalletModel) FindByUserId(ctx context.Context, userId int64) (*ent.Wallet, error)

func (*WalletModel) Save

func (model *WalletModel) Save(ctx context.Context, args ent.Wallet) (*ent.Wallet, error)

func (*WalletModel) UpdatePassword

func (model *WalletModel) UpdatePassword(ctx context.Context, account, password string) error

Jump to

Keyboard shortcuts

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