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

Define the stream cost dynamically #141

Open
SofiiaVarich opened this issue Sep 10, 2023 · 0 comments
Open

Define the stream cost dynamically #141

SofiiaVarich opened this issue Sep 10, 2023 · 0 comments

Comments

@SofiiaVarich
Copy link

Expected behavior

At the moment we read the stream costs from instants. This means regardless of the subscription price, all of the costs the same for the user, producing no incentive for the users to purchase bigger subscriptions.

Actual behavior

Subscriptions should define the stream cost based on their price. This should be defined dynamically at the time of subscription creation.
We can specify a discount in the subscription.create command so that the stream cost is defined as:

streamCost = BASE_COST * (1 - discount);

then use the streamCost in the audio.stream command.

subscription.consumable -= subscription. streamCost;
// ...
income: audio.owners[index].income + (subscription .streamCost * BigInt(owner.shares)) / BigInt(100),
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

No branches or pull requests

1 participant