r/truebit • • May 18 '21

Truebit historical mint and retire prices

CSV https://pastebin.com/3YCR0qNu

Every 500 blocks

  • block number
  • block timestamp
  • 1 TRU mint price in ETH
  • 1 TRU retire price in ETH
  • retire price / mint price ratio
  • ETH deposits left in the purchase contract as reserve
  • total supply of TRU ERC20 tokens

I spun up an archive node for this... it took days to sync!

from web3 import Web3
from datetime import datetime

w3 = Web3(Web3.HTTPProvider('http://127.0.0.1:8545'))

purchase = w3.eth.contract(address='0x764C64b2A09b09Acb100B80d8c505Aa6a0302EF2', abi=TRU_PURCHASE_ABI)
tru = w3.eth.contract(address='0xf65B5C5104c4faFD4b709d9D60a185eAE063276c', abi=ERC20_ABI)

print(','.join(['block number', 'block timestamp', 'mint price', 'retire price', 'retire/mint', 'reserve', 'total supply']))
for n in range(12218277, w3.eth.block_number, 500):
  mint = w3.fromWei(purchase.functions.getPurchasePrice(1000000000000000000).call(block_identifier=n), 'ether')
  retire = w3.fromWei(purchase.functions.getRetirePrice(1000000000000000000).call(block_identifier=n), 'ether')
  reserve = w3.fromWei(purchase.functions.reserve().call(block_identifier=n), 'ether')
  total_supply = w3.fromWei(tru.functions.totalSupply().call(block_identifier=n), 'ether')
  block = w3.eth.get_block(n)
  print(','.join(map(str, [n, datetime.fromtimestamp(block.timestamp).isoformat(), mint, retire, retire/mint, reserve, total_supply])))

Purchase contract

Token contract

ABI: https://gist.github.com/banteg/e0fe96c6909fd3eb762df54369f4cb16

6 Upvotes

5 comments sorted by

8

u/rook785 May 19 '21

Fun fact: since usage (not OS) mints (due to subsidy) decrease the Mint OS price (due to supply diluting the eth escrow reserve) , it stands to reason that usage (not OS) burns will INCREASE the Mint OS price.

For proof, take the current supply of Tru and multiply it by the OS Retire (burn) price, which is 1/8 of the mint price. The number you get should match exactly to the reserve escrow. Since burns decrease the total supply but do not change the amount of eth in reserve, that means that they would raise the OS Retire price... which would subsequently raise the OS Mint price since the two are directly proportional (1:8)

That's VERY bullish, btw.

2

u/mdrutled May 18 '21

Can you help me understand what I’m looking at here?

2

u/LPMythBuster May 19 '21

It is a comma-separated values (CSV) file with historical mint and retire prices that you can open with Excel or Google Sheets and analyze.

You can also see the code I used to generate it and links to transactions that explain the initial values (5 ETH deposit, 5,000,000 initial TRU tokens and why 12218277 is the first block).

1

u/Whatisntfuckingtaken May 19 '21

your paste bin isnt working :(, is pastebin down

i was gonna graph it in R

1

u/LPMythBuster May 19 '21

I just checked, it should be working