Skip to content

Commit

Permalink
minor correction in example values
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusParvin authored Dec 21, 2023
1 parent 56e4e6a commit 93dc3d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions umad-04-lnurlp-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,23 @@ Lightning invoice for 10,000 millisats (10 * 1,000) plus applicable conversion f
"code": "USDC",
"name": "USDC",
"symbol": "USDC",
"minSendable": 100000, // 100K
"maxSendable": 10000000000, // 10B
"minSendable": 1000000, // 1M
"maxSendable": 1000000000000, // 1T
"multiplier": 2.34,
"decimals": 6
}
```

In this case, the `decimals` field is 6, indicating that the smallest unit of the currency is one USDC / 10^6.
The `multiplier` field is 2.466, indicating that there are 2.466 millisats per USDC/10^6. This struct also indicates that
the receiving user can receive between 1 USDCent and 100,000,000 USDCents. If a sender wanted to send 5.95 USDC, they would
the receiving user can receive between 1 USDCent and 10,000 USDC. If a sender wanted to send 5.95 USDC, they would
specify `amount: 5950000, currency: USDC` in their [payreq request](/umad-05-payreq-request.md), which should in turn create
a Lightning invoice for 14,677,700 millisats (5,950,000 * 2.466) plus applicable conversion fees.

## Note for very small currency units

If the smallest unit of a currency is very small (eg. `multiplier` is .0001), it may be necessary to round up to a larger
unit when actually sending the payment so that the `amount` field in the [payreq request](/umad-05-payreq-request.md) is
unit when actually sending the payment so that the `amount` field in the [payreq request](/umad-05-payreq-request.md)

Check failure on line 122 in umad-04-lnurlp-response.md

View workflow job for this annotation

GitHub Actions / markdown-lint

Trailing spaces

umad-04-lnurlp-response.md:122:118 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md009.md
can fit in an int64 and can be represented in millisats. For example, DAI has 18 decimals, so the smallest unit is 10^-18.
In this case, trying to send 20 DAI would result in an `amount` of 20 * 10^18, which is too large to fit in an int64. For
this reason, the maximum `decimals` allowed is 8. If a currency has more than 8 decimals, the `multiplier` should be
Expand Down

0 comments on commit 93dc3d3

Please sign in to comment.