effectai / effect-network

Smart contracts and documentation for Effect Network
MIT License
46 stars 9 forks source link

Implement network fees #88

Closed jeisses closed 2 years ago

jeisses commented 2 years ago

Feature

A percentage of the task rewards on the platform should be collected as a network fee.

Description

Effect Network will implement a network fee that is collected by the DAO to sustain the development of the network.

With the mainnet release all the smart contract technology is in place to implement this in a decentralized way. The goal is to have the fees be collected completely autonomous (so it happens automatically, no manual actions) and as real-time as possible.

The fee parameter will be an extremely important parameter for the network - as both workers and requesters will be impacted by the value.

Technical remarks

Steps

djstrikanova commented 2 years ago

I think there will be interest at some point to allow the DAO to choose a percentage of these network fees to be burned as well. There was a proposal passed on this a while back

https://dao.effect.network/proposals/17

jeisses commented 2 years ago

I think there will be interest at some point to allow the DAO to choose a percentage of these network fees to be burned as well. There was a proposal passed on this a while back

https://dao.effect.network/proposals/17

Thanks for bringing that up, we should keep this in mind.

Currently all fees are being collected to feepool.efx and from there they are distributed to guardians every cycle.

This might be the right place to actually perform the burn - maybe we can use a vector of "fees" that are taken from the worker, that can be configured by the DAO.

The default value would be:

The remainder of the value would always go to the worker (90% in the above case).

I also had a discussion with Laurens about taking the fees on publishbatch instead of payout. This means fees will come in quicker, and the logic is more "requester pays fees" than "worker pays fees" (example: from the task reward 100% goes to the worker; the requester would just pay on top). This also works nicer if network fees change in the future.

laurensV commented 2 years ago

To expand a bit on the discussion me and Jesse had: In order to do it on publishbatch we also have to implement an additional check to see if the batch is funded for both the fees and the costs for the tasks, but it would save quite a lot of time in the frontend adjusting for fees in worker payouts, so I prefer the publishbatch option. It also shows better that the fees are being paid by the requester, not the worker.

A downside to this is that if you decide to cancel your batch or not all tasks get done, you already paid the fee for all tasks in your batch (while with the payout option you only pay fees for tasks that are actually done), but I don't think its that big of a problem.