taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

commit 3c808661c6552fd2700cd25c42d5ff1e170f87c1
parent dc44d170215db9f843f684ab5a2aae0c44bf743c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 11 Aug 2023 16:30:40 +0200

add STEFAN support to exchange

Diffstat:
Mcore/api-exchange.rst | 25+++++++++++++++++++++++++
Mdesign-documents/047-stefan.rst | 5++++-
Mmanpages/taler.conf.5.rst | 20++++++++++++++++++++
3 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/core/api-exchange.rst b/core/api-exchange.rst @@ -116,6 +116,31 @@ possibly by using HTTPS. // The exchange's currency or asset unit. currency: string; + // How many digits should the amounts be rendered + // with by default. Small capitals should + // be used to render fractions beyond the number + // given here (like on gas stations). + currency_fraction_digits: integer; + + // Absolute cost offset for the STEFAN curve used + // to (over) approximate fees payable by amount. + stefan_abs: Amount; + + // Factor to multiply the logarithm of the amount + // with to (over) approximate fees payable by amount. + // Note that the total to be paid is first to be + // divided by the smallest denomination to obtain + // the value that the logarithm is to be taken of. + stefan_log: Amount; + + // Linear cost factor for the STEFAN curve used + // to (over) approximate fees payable by amount. +. + // Note that the total to be paid is first to be + // divided by the smallest denomination to obtain + // the value to be multiplied with. + stefan_lin: Amount; + // Type of the asset. "fiat", "crypto", "regional" // or "stock". Wallets should adjust their UI/UX // based on this value. diff --git a/design-documents/047-stefan.rst b/design-documents/047-stefan.rst @@ -38,7 +38,10 @@ Proposed Solution The proposal is for the exchange to advertise three STEFAN-parameters that encode a fee curve of the form ``stefan_abs + stefan_log * log P + -stefan_lin * P`` where P is the price to be paid. The fee curve will be the +stefan_lin * P`` where P represents the price to be paid. +Here, the numerical value for P is to be computed by +dividing the actual price by the smallest denomination +offered by the exchange. The fee curve will be the displayed fee, except in cases where the coin selection is exceptionally bad (which should happen in substantially less than 1% of all cases). The fee curve will also be used as the maximum fee a merchant will cover unless the diff --git a/manpages/taler.conf.5.rst b/manpages/taler.conf.5.rst @@ -113,6 +113,26 @@ ENABLE_REWARDS rewards is enabled or disabled, and protocol-compliant merchant backends will then enable or disable the feature accordingly. +CURRENCY_FRACTION_DIGITS + How many digits should amounts be rendered + with by default. Small capitals should + be used to render fractions beyond the number + given here (like on gas stations). Defaults to 0. + For EUR and USD, the value would be 2, while for + JPY it would be 0. + +STEFAN_ABS + Absolte amount to use in the STEFAN fee approximation + curve (see DD47). Defaults to 0 if not specified. + +STEFAN_LOG + Logarithmic factor to use in the STEFAN fee approximation + curve (see DD47). Defaults to 0 if not specified. + +STEFAN_LIN + Linear factor to use in the STEFAN fee approximation + curve (see DD47). Defaults to 0 if not specified. + BASE_URL The base URL under which the exchange can be reached. Added to wire transfers to enable tracking by merchants.