Axis-Fi / axis-core

Axis Protocol
https://axis.finance
Other
6 stars 1 forks source link

Fee Updates #33

Closed Oighty closed 7 months ago

Oighty commented 7 months ago

Updated fee logic per #29

Oighty commented 7 months ago

@0xJem let me know what you think about this approach.

The only thing not implemented is the curator fee on the purchase and settle functions. There are two ways to approach this part:

  1. Calculate the payout fee earlier in the process and remove from the payout the user receives prior to the slippage check. This is probably easy for purchase, but a lot more complicated for settle.
  2. Require the owner to provide extra tokens for the curator. This is easier to implement but it may mess with the math for projects looking to issue tokens. I.e. if they want to allocate 100 tokens to an auction, they want 95 to go to users and 5 to curator instead of allocating 100 and then paying 5 extra to the curator for a total of 105.

    I will discuss with tex, but we probably need to figure out 1. even though it's more complicated.

Oighty commented 7 months ago

I also forgot to add a setter function for _PROTOCOL address to update where fees are allocated and can be claimed from. We will need this later on I think.

Oighty commented 7 months ago

@0xJem let me know what you think about this approach.

The only thing not implemented is the curator fee on the purchase and settle functions. There are two ways to approach this part:

  1. Calculate the payout fee earlier in the process and remove from the payout the user receives prior to the slippage check. This is probably easy for purchase, but a lot more complicated for settle.
  2. Require the owner to provide extra tokens for the curator. This is easier to implement but it may mess with the math for projects looking to issue tokens. I.e. if they want to allocate 100 tokens to an auction, they want 95 to go to users and 5 to curator instead of allocating 100 and then paying 5 extra to the curator for a total of 105.

I will discuss with tex, but we probably need to figure out 1. even though it's more complicated.

Per sync discussion, we should go with the second option (provide extra tokens for curator fee). Requires some extra effort on the front-end to show capacity + fee required for approval and then transfer on creation.

Oighty commented 7 months ago

On the implementation of the curator fee, it may make sense to not transfer the extra payout tokens until the curator accepts the role by calling curate.

Oighty commented 7 months ago

Ok, I think this is done except for updating the tests. @0xJem please take a look.