ArkProjectNFTs / ark-project

ArkProject is a liquidity layer for digital assets, uniting markets, empowering creators, and bridging the gap to mass adoption. Built on top of Starknet, ArkProject is designed to provide a fully decentralized and trustless orderbook on-chain.
https://arkproject.dev
Apache License 2.0
24 stars 8 forks source link

Implementing Fee Distribution on Token Swap in StarkNet Contract #315

Closed ybensacq closed 3 months ago

ybensacq commented 3 months ago

Is this feature related to a problem? Please describe. Design and implement a StarkNet smart contract feature for our ArkProject, that splits transaction fees generated from token swaps into five distinct parts. The smart contract must automatically divide the transaction fees from each token swap into five parts, allocating specific percentages to:

  1. ArkProject
  2. Listing Broker
  3. Selling Broker
  4. Seller (the person who sells the token)
  5. Collection Creator (can be done later)

The fees allocated to the seller will be dynamically calculated as 100% minus the sum of the percentages allocated to the ArkProject, Listing Broker, Selling Broker, and Collection Creator.

Describe the solution you'd like Fees distribution mechanism should be done directly within the execute_order function of our StarkNet smart contract. We will introduce an additional aspect: a dedicated function in the ArkProject contract for setting the fee percentages. This function will enable the dynamic adjustment of fees allocated to the two brokers and the ArkProject itself.

Alternative solutions

Additional Context