Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountFifo ¶
func (AccountFifo) Get ¶
func (a AccountFifo) Get(accountName string, subCategory ...string) *fifo.Fifo
Get the accounts global fifo queue for physical holdings or for a sub category to track margin trades for example.
func (AccountFifo) SetIsShortTrade ¶
func (a AccountFifo) SetIsShortTrade(accountName string, subCategory string, status bool)
type Conversion ¶
type Conversion struct { Ts time.Time RecID string Type string Account string From string // = Quote asset for buy, base asset for sells. FromDecimals int32 // = Number of decimals of either the quote or base asset. Depending on the direction of the trade. To string // = Base asset for bus, quote asset for sells. ToDecimals int32 // = Number of decimals of either the quote or base asset. Depending on the direction of the trade. ToAmount d.Decimal // = Amount ToAmountNet d.Decimal // = Amount - Fee ToAmountEur d.Decimal // = Amount * QuotePriceC ToAmountNetEur d.Decimal // = Amount * QuotePriceC - QuoteFeeC FromAmount d.Decimal // = Value FromAmountNet d.Decimal // = Value - FeeC FromAmountEur d.Decimal // = ValueC FromAmountNetEur d.Decimal // = ValueC - FeeC FromEntries []fifo.Asset QueueBefore []fifo.Asset QueueAfter []fifo.Asset Price d.Decimal // = Price PriceEur d.Decimal // = PriceC (only in there for informational purposes) FeeCurrency string // = FeeCurrency Fee d.Decimal // = Fee FeeDecimals int32 // = Number of decimals of the fee currency. QuoteFeeCurrency string // = QuoteFeeCurrency QuoteFee d.Decimal // = QuoteFee QuoteFeeDecimals int32 // = Number of decimals of the quote fee currency. FeeEur d.Decimal // = FeeC + QuoteFeeC Result ConversionResult Warning string Error string IsDerivative bool IsMarginTrade bool IsPhysical bool }
type ConversionResult ¶
type Description ¶
type Description interface {
String() string
}
type DescriptionMap ¶
type DescriptionMap map[string][]Description
func (DescriptionMap) Add ¶
func (d DescriptionMap) Add(accountName string, description Description)
type Generator ¶
type Generator struct { Recs []any // contains filtered or unexported fields }
func NewGenerator ¶
func NewGenerator() *Generator
func (*Generator) TradeToConversion ¶
func (r *Generator) TradeToConversion(trade *proto.Trade) *Conversion
Create a conversion from a trade. Depending on the direction of the trade, assets and prices are assigned accordingly.
Click to show internal directories.
Click to hide internal directories.