Skip to content

Commit c496ac0

Browse files
committed
exchange rates interface
1 parent 2bc090e commit c496ac0

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/exchange_rates.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ for example to convert account assets to the account's base currency.
99
"""
1010
abstract type ExchangeRates{CData} end
1111

12+
"""
13+
Register a cash asset with the exchange rate provider.
14+
15+
Default implementation is a no-op.
16+
"""
17+
@inline add_asset!(er::ExchangeRates, cash::Cash) = nothing
18+
1219
# ---------------------------------------------------------
1320

1421
"""
@@ -23,6 +30,13 @@ For `OneExchangeRates`, the exchange rate is always 1.0.
2330
"""
2431
@inline get_rate(er::OneExchangeRates, from::Cash, to::Cash) = 1.0
2532

33+
"""
34+
Register a cash asset with the exchange rate provider.
35+
36+
For `OneExchangeRates`, this is a no-op.
37+
"""
38+
@inline add_asset!(er::OneExchangeRates, cash::Cash) = nothing
39+
2640
# ---------------------------------------------------------
2741

2842
"""

0 commit comments

Comments
 (0)