Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteEffect(e *Effect)
- func DeleteRequest(uuid string) error
- func NewTaxModifier(portfolioUuid, title string, duration time.Duration, taxMultiplier float64) (*Effect, *Effect, error)
- func NewTradeEffect(portfolioUuid, title, tag string, effect *TradeEffect, duration time.Duration) (*Effect, *Effect, error)
- func RunEffectCleaner()
- func UnmarshalJsonEffect(effectType, jsonStr string) (interface{}, error)
- func UpdateBaseProfit(portfolioUuid string, profitMultiplier float64) (*Effect, *Effect, error)
- type Effect
- type EffectType
- type InsiderTrading
- type InsiderTradingType
- type TradeEffect
- type TradingType
Constants ¶
View Source
const BaseBuyFee = 20 * money.One
View Source
const BaseSellFell = 20 * money.One
View Source
const BaseTaxRate = 0.15
View Source
const InsiderTradingEffectType = "insider"
View Source
const TradeEffectType = "trade"
Variables ¶
View Source
var EffectLock = lock.NewLock("EffectLock")
Functions ¶
func DeleteEffect ¶
func DeleteEffect(e *Effect)
func DeleteRequest ¶
func NewTaxModifier ¶
func NewTradeEffect ¶
func RunEffectCleaner ¶
func RunEffectCleaner()
func UnmarshalJsonEffect ¶
Types ¶
type Effect ¶
func GetAllEffects ¶
func GetAllEffects() []*Effect
func NewBaseTradeEffect ¶
func (*Effect) MarshalJSON ¶
type EffectType ¶
type EffectType interface {
Name() string
}
type InsiderTrading ¶
func (*InsiderTrading) Type ¶
func (*InsiderTrading) Type() EffectType
type InsiderTradingType ¶
type InsiderTradingType struct { }
func (*InsiderTradingType) Name ¶
func (*InsiderTradingType) Name() string
func (*InsiderTradingType) RequiredLevel ¶
func (*InsiderTradingType) RequiredLevel() int64
type TradeEffect ¶
type TradeEffect struct { BuyFeeAmount *int64 `json:"buy_fee_amount"` // fee on all trades ex: base fee BuyFeeMultiplier *float64 `json:"buy_fee_multiplier"` // fee % of the total fees, ex: double fees SellFeeAmount *int64 `json:"sell_fee_amount"` // fee on all sales trades ex: base fee SellFeeMultiplier *float64 `json:"sell_fee_multiplier"` // fee % of the total fees, ex: double fees on trades BonusProfitMultiplier *float64 `json:"profit_multiplier"` // current profit multiplier, ex: bonus TaxPercent *float64 `json:"tax_percent"` // tax payed on profits, ex: base tax TaxMultiplier *float64 `json:"tax_multiplier"` // percent multiplier, ex: taxless sales TradeBlocked *bool `json:"trade_blocked"` // if trade is blocked // contains filtered or unexported fields }
func TotalTradeEffect ¶
func TotalTradeEffect(portfolioUuid string) (*TradeEffect, []string)
Calculate the total bonus for a portfolio
func (*TradeEffect) Add ¶
func (t *TradeEffect) Add(effect *TradeEffect)
type TradingType ¶
type TradingType struct { }
func (TradingType) Name ¶
func (TradingType) Name() string
Click to show internal directories.
Click to hide internal directories.