Phoenix-Protocol-Group / phoenix-contracts

Source code of the smart contracts of the Phoenix DeFi hub DEX protocol
GNU General Public License v3.0
10 stars 6 forks source link

Split reward distribution functionality into the `stake_rewards` smart contract #312

Open ueco-jb opened 1 month ago

ueco-jb commented 1 month ago

Due to Soroban block limitations, we had to change our original implementation. I splitted the fund distribution and distribute rewards into a new smart contract. The workflow will look like this:

---
title: Bonding tokens
---
sequenceDiagram
    participant U as User
    participant ST as Stake Contract
    participant STR as Stake Rewards Contract

    U->>ST: Bonds LP Tokens using `bond()`
    U->>STR: Calculates his new LP token power using `calculate_bond()`
    S-->>U: Confirms bonding

    U->>STR: Calculates corrected LP token power after removal calling `calculate_unbond()`
    U->>ST: Unonds LP Tokens using `unbond()`
    S-->>U: Confirms unbonding

Roadmap: