Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: refactor payout curve example #1805

Merged
merged 3 commits into from
Jan 9, 2024
Merged

chore: refactor payout curve example #1805

merged 3 commits into from
Jan 9, 2024

Conversation

bonomat
Copy link
Contributor

@bonomat bonomat commented Jan 8, 2024

The example now produces a csv file which contains <price>,<offerer>,<acceptor>. This is useful to plot the payout for the coordinator(offerer) and trader (acceptor) in a single diagram.

I've also changed the gnuplot file which now produces an SVG so that one can zoom in and see more details.

Note: diagrams below where generated with a fee of 30%
payout_curve

Copy link
Contributor

@luckysori luckysori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!

I guess the second patch is not a refactor because you fixed some things that weren't working! chore: Fix would make sense to me since it's only auxiliary code.

@@ -266,7 +266,7 @@ fn calculate_upper_range_payouts(
},
PayoutPoint {
event_outcome: BTCUSD_MAX_PRICE,
outcome_payout: 0,
outcome_payout: fee,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@luckysori
Copy link
Contributor

@bonomat: I've pushed 548bd88 to fix the tests after d0bdcff.

I'll let you squash and merge if it looks good to you.

this was a bug in the code. the offerer (e.g. the coordinator) should always receive at least the fee
The example now produces a csv file which contains `<price>,<offerer>,<acceptor>`. This is useful to plot the payout for the coordinator(offerer) and trader (acceptor) in a single diagram.

I've also changed the gnuplot file which now produces an SVG so that one can zoom in and see more details.

Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
@bonomat bonomat force-pushed the fix/payout-curve-fixes branch from 548bd88 to 7b5b2ce Compare January 9, 2024 08:46
@bonomat bonomat enabled auto-merge January 9, 2024 08:47
@bonomat bonomat added this pull request to the merge queue Jan 9, 2024
Merged via the queue into main with commit a94cc1b Jan 9, 2024
9 checks passed
@bonomat bonomat deleted the fix/payout-curve-fixes branch January 9, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants