@startuml
title Where does the yield come from?

/' //////////////////////////////////////////////////////////////////
//                            Actors                               //
////////////////////////////////////////////////////////////////// '/

actor "User" as User

/' //////////////////////////////////////////////////////////////////
//                         Core Components                         //
////////////////////////////////////////////////////////////////// '/

participant "Uniswap V3" as UniswapV3
participant "Non Fungible Position Manager" as NonFungiblePositionManager 
participant "Uniswap V3 Staker" as UniswapV3Staker
participant "Uniswap V3 Gauge" as UniswapV3Gauge
participant "FlywheelGaugeRewards" as FlywheelGaugeRewards
participant "Base V2 Minter" as BaseV2Minter
participant "bHermes (Deposit Only ERC4626)" as bHermes

/' //////////////////////////////////////////////////////////////////
//                         Interactions                            //
////////////////////////////////////////////////////////////////// '/
'Numbers are in the A.B.C format, by calling `inc A` you will increase the first number by 1'
autonumber 1.1.1
group Providing liquidity to Uniswap V3
    User -> UniswapV3 : Provide liquidity
    UniswapV3 -[#purple]> User : Uniswap V3 NFT
end

autonumber stop
BaseV2Minter -[#blue]> BaseV2Minter : Mint HERMES once per cycle (1 week)\nfor previous week rewards
BaseV2Minter -[#blue]> FlywheelGaugeRewards : Transfer //newWeeklyEmission// of HERMES tokens for rewards 
FlywheelGaugeRewards -[#blue]> UniswapV3Gauge : ???
UniswapV3Gauge -[#blue]> UniswapV3Staker : Distribute HERMES //accruedRewards// as incentive program rewards\nThis happens whenever //newEpoch()// is called

autonumber resume
autonumber inc A
group Staking NFT in the UniswapV3Staker
    User -[#purple]> UniswapV3Staker : Stake Uniswap V3 NFT
    UniswapV3Staker -> UniswapV3Gauge : Attach User to Gauge
end

...
... ...Some time has to pass to get the rewards... ...
...

autonumber inc A
group Claiming rewards
    User -> UniswapV3Staker : Unstake Uniswap V3 NFT
    UniswapV3Staker -> NonFungiblePositionManager : Collect the fees to the bribes contract
    User -> UniswapV3Staker : Claim all rewards
end

autonumber inc A
group Burning HERMES for bHermes
    User -[#blue]> bHermes : Deposit (burn) 1000 Hermes tokens
    bHermes -[#red]> User : Mint 1000 bHermes tokens
end

autonumber inc A
group Claiming utilities with bHermes
    User -> bHermes : Claim utility tokens for 1000 bHermes
    bHermes -[#green]> User : 1000 Boost tokens, 1000 Votes tokens, 1000 Weight tokens
end

/' //////////////////////////////////////////////////////////////////
//                            Legend                               //
////////////////////////////////////////////////////////////////// '/

legend
    == Legend ==
    <font color=purple>Purple</font> - UniV3 NFT flow
    <font color=blue>Blue</font> - HERMES Tokens flow
    <font color=red>Red</font> - bHERMES Tokens flow
    <font color=green>Green</font> - Utility Tokens flow
endlegend

/' //////////////////////////////////////////////////////////////////
//                            Styling                              //
////////////////////////////////////////////////////////////////// '/

' left to right direction
skinparam linetype ortho
skinparam sequenceMessageAlign center
skinparam note {
    BorderColor black
    BackgroundColor white
    FontColor black
}
skinparam participant {
    FontSize 25
    BackgroundColor lightgray
}

footer Hermes: Contract Interactions - PlantUML diagram | author: @kamilchmielu
@enduml
