Skip to content

Buyback with a Fee ​

Extend a recurring buyback to burn a share of the purchased token and transfer the rest to a fixed fee recipient.

mermaid
flowchart LR
    S[Stream A] --> O[Open Fill for B] --> W{Weights}
    W --> B[Burn]
    W --> F[Transfer fee]

Combine Stream, Open Fill, Weight Splitter, Burn and Transfer.

Recipes.buyback takes a fee weight in millionths: 50,000 means 5%. Children are ordered burn first, fee second; weights are 950,000 and 50,000. A declared output of 1,000 raw units therefore burns 950 and pays 50.

Both weights must be positive. Choose a demand large enough that the fee does not round to zero; supplied nodes are not skippable. Surplus above the demand stays in the DAO.sol contract because this recipe does not enable forwarding. The manager may update weights; replacing the fixed fee recipient requires a new action and a flow update.

Configure and install ​

Use Recipes.buyback and the configuration example. Follow setup and permissions to install the flow. Replace addresses and choose amounts in each token's smallest unit.

Component source: StreamBudget.sol · OpenFillAction.sol · WeightSplitter.sol · BurnAction.sol · TransferAction.sol.

All examples.