Bugmark-Simulator / bugmark_simulation

A simulator for Bugmark to run experiments
Mozilla Public License 2.0
2 stars 1 forks source link

Market Metrics #10

Closed GeorgLink closed 5 years ago

GeorgLink commented 6 years ago
GeorgLink commented 6 years ago

This might have to wait for two weeks, until Malvika is back

GeorgLink commented 6 years ago

Changing title because we now 'determined market metrics'.

I'm documenting visualization ideas here but they are open to discussion and ideas.

  1. Contract Fix Rate -- a graph with 0-100% on y-axis and days on x-axis, shows the percentage of contracts that are each day resolved to pay out fixed side owners. Because these values are independent, we might have to display dots or columns for the individual days but add a 5 day trailing average line.

  2. Payout vs Potential -- a graph with tokens on the y-axis and days on the x-axis, shows for contracts maturing each day, how much was paid out to fixed side and what the total contract volume was. This graph can even go into the future, showing contract volume in upcoming days without realized payouts. We might want to add overall potential from all offers that could have resulted in contracts to mature at day X. In addition to daily values, we might display a 5 day trailing average line.

  3. Variance of Offer volumes -- a graph with tokens on the y-axis and days on the x-axis. For each day, show the maximum, average, and minimum offer volume*price. Again, trailing average line.

  4. Open Offer count and volume -- a graph with tokens the left y-axis, a count on the right y-axis, and days on the x-axis, show number of offers to mature on a day and total volume of offers. Again, trailing average line.

  5. Maturation days table -- a table with columns: day (future only), last price, price change, high-price, low-price, volume, last contract cross time (in seconds)

1, 3, and 4 are good for comparing projects within one display (not to be done in simulator)

Further idea: A graph combining all projects (not combining them) -- total market volume (contracts not yet matured -- across all maturation days).

dmarti commented 6 years ago

Total volume for Bugmark as a whole?

GeorgLink commented 6 years ago

Thanks @dmarti. Total volume for Bugmark is a good idea but not helpful for people to choose between projects. Maybe we can put it on the 'researcher dashboard' as an overview of the total simulation.

snehasi commented 6 years ago

Thanks @GeorgLink for the detailed description. Could you assign this issue to me, as I am already working on it?

GeorgLink commented 6 years ago

Yes, I will do that. Can you please share your progress frequently? Maybe you can start a pull request and keep updating it. Let me know if you need help figuring out our simulation platform.

GeorgLink commented 6 years ago

I can only add you after you accept the invite to be a member of this repository.

snehasi commented 6 years ago

Great. Sure!

vinodkahuja commented 5 years ago

SQL for maturation days table In this sql Project variable is defined in grafana

select co.maturation,   
(select price from positions
join amendments
on positions.amendment_uuid = amendments.uuid
join contracts as ci
on amendments.contract_uuid = ci.uuid
join issues
on ci.stm_issue_uuid=issues.uuid
where positions.side = 'unfixed'
and issues.stm_tracker_uuid = '[[project]]'
and ci.maturation = co.maturation
order by positions.updated_at DESC limit 1) as LastPrice, max(positions.price) as HighPrice, min(positions.price) as LowPrice, sum(positions.volume) as Volume
from positions
join amendments
on positions.amendment_uuid = amendments.uuid
join contracts as co
on amendments.contract_uuid = co.uuid
join issues
on co.stm_issue_uuid=issues.uuid
where positions.side = 'unfixed'
and issues.stm_tracker_uuid = '[[project]]'
and co.status = 'open'
group by co.maturation
order by co.maturation
;
vinodkahuja commented 5 years ago

Done