Files
sendico/api/fx/storage/model/cross.go
Stephan D 62a6631b9a
All checks were successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
service backend
2025-11-07 18:35:26 +01:00

19 lines
824 B
Go

package model
// CrossRateConfig describes how to synthetically derive a currency pair using
// two other pairs connected by a pivot currency.
type CrossRateConfig struct {
Enabled bool `bson:"enabled" json:"enabled"`
PivotCurrency string `bson:"pivotCurrency,omitempty" json:"pivotCurrency,omitempty"`
BaseLeg CrossRateLeg `bson:"baseLeg" json:"baseLeg"`
QuoteLeg CrossRateLeg `bson:"quoteLeg" json:"quoteLeg"`
}
// CrossRateLeg identifies a supporting currency pair and optional overrides to
// fetch or orient its pricing data for cross-rate calculations.
type CrossRateLeg struct {
Pair CurrencyPair `bson:"pair" json:"pair"`
Invert bool `bson:"invert,omitempty" json:"invert,omitempty"`
Provider string `bson:"provider,omitempty" json:"provider,omitempty"`
}