In BQL it is possible to apply CONVERT multiple times, for example:

SELECT CONVERT(CONVERT(position, 'USDT'), 'EUR')

You can also take a look at CoinGecko price source from 
https://github.com/xuhcc/beancount-cryptoassets that can fetch price in EUR:

$ bean-price --no-cache -e 'EUR:beancount_cryptoassets.coingecko/MKR:EUR'
2020-12-26 price MKR:EUR                            436.94 EUR


On Saturday, December 26, 2020 at 1:53:39 PM UTC+3 Peter wrote:

> Hi all,
>
> is it possible to convert a lot/commodity to the current market value of 
> my base currency using an intermediary currency?
>
> Use case:
> I fetch prices for cryptocurrencies from binance. My base currency is EUR. 
> Binance supports EUR quotes only for a few big cryptos. Most other cryptos 
> have USDT (Tether, a stable coin representing a fixed value of 1 USD) 
> quotes.
>
> Is it possible to use that to convert a crypto to EUR, like: CoinXY is 
> currently 10 USDT; 1 USD(T) is currently 0.75 EUR; therefore CoinXY is 0.75 
> EUR? 
>
> E.g:
>
> 2020-12-01 * "" "Opening"
> Equity:Opening-Balances     -0.1 MKR {441 EUR} @ 441 EUR
> Assets:Crypto:MKR:Coinbase   0.1 MKR {441 EUR} @ 441 EUR
>
> 2017-01-01 price USDT    1.0 USD
> 2020-12-25 price MKR  528.64 USDT
> 2020-12-25 price USD     0.82 EUR
> 2020-12-25 price USDT    0.82 EUR
>
> Is there a way to convert the 0.1 MKR to EUR by calculating 0.1 MKR * 
> 0.82 USDT using bean-query?
>
> Regards
>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/3c3b74db-67b6-48de-974d-9fe985a1dd5en%40googlegroups.com.

Reply via email to