• Stars
    star
    5
  • Rank 2,861,366 (Top 57 %)
  • Language
    Ruby
  • Created over 3 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Aggregated token amounts and values. Supports ApeBoard, YieldWatch, Binance, CoinGecko and more.

yield.rb

This is a simple ruby script that pulls data from supported yield trackers and exchanges, and reconstructs them for one purpose: to get the aggregated amounts and values of underlying tokens.

Why?

In YieldWatch, as much as I love the details it provides on yields, it lacks a consolidated view on how much underlying tokens I have. Imagine having deposited tokens into multiple liquidity pools (LPs) and having to manually find and add up the underlying tokens (not LP tokens) one by one...

Some other wallet trackers support this, but none of them supports all the yield farms I use.

As of July 2021, I've switched to using 0xTracker and ApeBoard. If a farm is supported in both then I'd use 0xTracker as it doesn't require a periodically updated auth token.

Here's what the output data looks like:

BNB   6.9420     USD 1.23     AUD 2.34
BTC   0.6969     USD 12.34    AUD 23.45
ETH   4.2000     USD 3.45     AUD 5.67

Total USD: 17.02
Total AUD: 31.46

Usage

Copy config.sample.yml to config.yml:

cp config{.sample,}.yml

Configurations

Option Type Description
format string json or text
currencies array(string) currency ISO codes, e.g. USD
rounding integer decimal rounding, defaults to 6
token_names string: string token name mapping
token_mappings array(string) token code mapping, e.g. to map BTCB to BTC
hide_tokens array(string) tokens that should be hidden from output
include_tokens string: float manually add tokens and their amounts
  • In some cases token symbols are not unique (e.g. BUNNY can be Pancake Bunny, BunnyToken or Rocket Bunny), in this case they need to be added to the token_names mapping. Search CoinGecko for their names.

  • The hide_tokens option is useful for hiding dusts and/or tokens you don't care about.

  • The include_tokens option is useful for adding tokens from places without APIs, such as Nexo. Tokens are categorised under groups (exchanges or farms, etc).

0xTracker

Option Type Description
wallet string wallet address
wallets array(string) wallets, e.g. eth, bsc and matic, etc
farms array(string) farms, e.g. mochiswap.io, bsc
  • Visit 0xTracker and take a look at the GET or POST requests to find all the supported farms.

  • Farm entries are supplied by their name and network, e.g. mochiswap.io, bsc.

ApeBoard

Option Type Description
ape-secret string value from the request header ape-secret
passcode string value from the request header passcode
wallet string wallet address
wallets array(string) wallets, e.g. eth, bsc and matic, etc
farms array(string) farms, e.g. pancakeswapBsc and polycat, etc
  • Visit ApeBoard and take a look at the GET requests to find all the supported wallets and farms.

YieldWatch

Option Type Description
wallet string wallet address
jwt string YieldWatch JWT
file string relative path to the YieldWatch JSON payload file
  • Please note that if you are using the wallet address, the wallet balances will be missing from the calculation. To include the wallet balances, go to YieldWatch, fetch your wallet, and open the browser console to copy the JSON payload.

  • Alternatively, find the YieldWatch GET request and copy the JWT (the string after "Authorization: Bearer ") in the header.

Binance & Bittrex

Option Type Description
api_key string API key
secret_key string secret key
file string relative path to the JSON payload file from the API
  • The file option is only needed if you don't want to supply the API and secret keys.

Assumptions

  1. You only care about the amounts of the underlying tokens - which changes all the time due to IL (Impermanent Loss).
  2. Only tokens that have already been deposited into the vaults will be counted, those that are pending are ignored.
  3. Coin names on different protocols are consolidated into one, e.g. WBNB, iBNB and beltBNB are all consolidated into BNB.
  4. Only the farms and tokens I personally use have been tested.
  5. Token prices are fetched from CoinGecko.

Supported Exchanges

Tested Farms / Yield Aggregators

These are the farms I have used and therefore their outputs are tested.

If a farm is supported on 0xTracker or ApeBoard, it should work fine.

Wallet Trackers

These are the BSC (Binance Smart Chain) wallet trackers I have come across.

License

Licensed under MIT.

More Repositories

1

crawler

A high performance web crawler / scraper in Elixir.
Elixir
917
star
2

jquery-endless-scroll

Endless/infinite scrolling/pagination.
CoffeeScript
838
star
3

angel_nest

Project code name: Angel Nest. :)
Ruby
775
star
4

api_taster

A quick and easy way to visually test your Rails application's API.
Ruby
727
star
5

simple_bayes

A Naive Bayes machine learning implementation in Elixir.
Elixir
392
star
6

datamappify

Compose, decouple and manage domain logic and data persistence separately. Works particularly great for composing form objects!
Ruby
332
star
7

opq

Elixir queue! A simple, in-memory queue with worker pooling and rate limiting in Elixir.
Elixir
255
star
8

stemmer

An English (Porter2) stemming implementation in Elixir.
Elixir
149
star
9

bustle

Activities recording and retrieving using a simple Pub/Sub-like interface.
Ruby
93
star
10

ruby_decorators

Ruby method decorators inspired by Python.
Ruby
63
star
11

inherited_resources_views

Share and DRY up views between resources. Use with Inherited Resources.
Ruby
60
star
12

jquery-inline-confirmation

Inline Confirmation plugin for jQuery. One of the less obtrusive ways of implementing confirmation dialogues.
JavaScript
53
star
13

toy-robot-elixir

The infamous Toy Robot code test done in Elixir.
Elixir
45
star
14

skinny-coffee-machine

A simple JavaScript state machine with observers, for browsers and Node.js.
JavaScript
42
star
15

kohana-phamlp

This module is a bridge between the Kohana PHP framework (http://kohanaframework.org/) and the PHamlP library (http://code.google.com/p/phamlp/).
PHP
25
star
16

authlite

Authlite, an auth module for Kohana PHP framework, it offers greater flexibility than the official Auth module.
PHP
23
star
17

dotfiles

My dotfiles
Shell
18
star
18

amaze_hands

Amaze Hands is an amazing tool developed for analysing Kanban board cards.
Ruby
15
star
19

kthrottler

A Kohana port of Action Throtller (for Rails): http://github.com/fredwu/action_throttler
PHP
14
star
20

jquery-slideshow-lite

An extremely lightweight slideshow plugin for jQuery.
JavaScript
14
star
21

code-test-2016-cultureamp

Ruby
13
star
22

README-xplor

Fred @ Xplor - how to work with me.
10
star
23

code-test-2016-myob

Ruby
8
star
24

code-test-2016-trunkplatform

Ruby
6
star
25

action_throttler

An easy to use Rails plugin to quickly throttle application actions based on configurable duration and limit.
Ruby
6
star
26

app_reset

Resets (and if available, seeds) your databases.
Ruby
6
star
27

layerful

Layerful PHP framework.
4
star
28

advent_of_code_2018

https://adventofcode.com/2018/about
Elixir
4
star
29

security_guard

A collection of useful tools for auditing data and performing security checks.
Ruby
3
star
30

fredwu.me-v3

JavaScript
3
star
31

ruby-slim-tmbundle

https://github.com/slim-template/ruby-slim.tmbundle
3
star
32

kata-poker-hands-elixir

A coding kata for comparing poker hands - Elixir version.
Elixir
2
star
33

flower

Playground to test out the Lotus framework.
Ruby
2
star
34

jqstub

A simple stub library for jQuery / Zepto objects.
JavaScript
1
star
35

project_retard

One sale a day e-commerce platform built on Ruby on Rails.
JavaScript
1
star
36

reacraft

Ruby
1
star
37

kata-poker-hands-ruby

A coding kata for comparing poker hands - Ruby version.
Ruby
1
star
38

toy-robot-lolz

It's art. And it's beautiful.
Ruby
1
star
39

code-test-2016-adslot

CoffeeScript
1
star
40

spiky_xml

Just a spike on XML parsing in different environments.
JavaScript
1
star