Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xuhcc/beancount-cryptoassets
Price sources for Beancount that provide prices for various cryptoassets
https://github.com/xuhcc/beancount-cryptoassets
beancount beancount-prices bzx coinmarketcap compound cryptonator tokensets
Last synced: about 1 month ago
JSON representation
Price sources for Beancount that provide prices for various cryptoassets
- Host: GitHub
- URL: https://github.com/xuhcc/beancount-cryptoassets
- Owner: xuhcc
- License: gpl-3.0
- Created: 2019-08-21T12:49:46.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-20T11:29:38.000Z (over 2 years ago)
- Last Synced: 2024-08-02T06:15:14.133Z (4 months ago)
- Topics: beancount, beancount-prices, bzx, coinmarketcap, compound, cryptonator, tokensets
- Language: Python
- Size: 32.2 KB
- Stars: 15
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-beancount - Cryptoassets
README
# Beancount Cryptoassets
Price sources for [Beancount](http://furius.ca/beancount/) that provide prices for various cryptoassets.
## Installation
Install latest version with `pip` (python 3 is required):
```
pip install https://github.com/xuhcc/beancount-cryptoassets/archive/master.zip
```## CoinGecko API
https://www.coingecko.com/en/api
No API key required, only latest quotes.
Source string format is `:beancount_cryptoassets.coingecko/:`.
`base_currency` can be either CoinGecko currency ID (e.g. `uniswap`) or a symbol (e.g. `UNI`).
## Coinmarketcap Pro API
API key is required. You can get free one at https://pro.coinmarketcap.com/ but it grants access only to latest quotes.
Source string format is `:beancount_cryptoassets.coinmarketcap_api/::`.
## Cryptonator API (Broken)
https://www.cryptonator.com/api
No API key required, only latest quotes.
Source string format is `:beancount_cryptoassets.cryptonator/:`.
## Compound
https://compound.finance/developers/api
No API key required, only latest quotes. The price of the cToken's underlying asset in quote currency is calculated using the data from [Cryptonator API](https://www.cryptonator.com/api).
Source string format is `:beancount_cryptoassets.compound/:`.
CTokens' addresses can be found here: https://compound.finance/ctokens
## bZx
Price source for [Fulcrum](https://fulcrum.trade/) iTokens.
Free [Infura](https://infura.io/) API key is required (the "Project ID"). The price of iToken is taken directly from iToken smart contract. The price of the iToken's underlying asset in quote currency is calculated using the data from [Cryptonator API](https://www.cryptonator.com/api).
Source string format is `:beancount_cryptoassets.bzx/::`.
## Token Sets
This source uses undocumented [Token Sets](https://www.tokensets.com/) API which provides only USD prices. Historical prices are available only for the last week.
Source string format is `USD:beancount_cryptoassets.tokensets/:USD`.
## Examples
Evaluate source string with `bean-price`:
```
PYTHONPATH=.:$PYTHONPATH bean-price --no-cache -e 'USD:beancount_cryptoassets.coingecko/BTC:USD'
```Set price source for commodity in beancount file:
```
2009-01-09 commodity BTC
price: "USD:beancount_cryptoassets.coingecko/BTC:USD"
```