-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No implementation yet, but this is the shape I think we want.
- Loading branch information
1 parent
9c7da1f
commit 848a0dc
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
crates/core/component/funding/src/component/liquidity_tournament/bank.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use async_trait::async_trait; | ||
use cnidarium::StateWrite; | ||
use penumbra_sdk_dex::lp::position; | ||
use penumbra_sdk_keys::Address; | ||
use penumbra_sdk_num::fixpoint::U128x128; | ||
|
||
#[allow(dead_code)] | ||
#[async_trait] | ||
/// The bank strictly controls issuance of rewards in the liquidity tournament. | ||
/// | ||
/// This ensures that rewards do not exceed the issuance budget, and are immediately | ||
/// debited from the appropriate source (which happens to be the community pool), | ||
/// and credited towards the appropriate destination (i.e. positions or new notes). | ||
pub trait Bank: StateWrite { | ||
/// Move a fraction of our issuance budget towards an address, by minting a note. | ||
async fn reward_fraction_to_voter( | ||
&mut self, | ||
_fraction: U128x128, | ||
_voter: &Address, | ||
) -> anyhow::Result<()> { | ||
unimplemented!() | ||
} | ||
|
||
/// Move a fraction of our issuance budget towards a position, increasing its reserves. | ||
async fn reward_fraction_to_position( | ||
&mut self, | ||
_fraction: U128x128, | ||
_lp: position::Id, | ||
) -> anyhow::Result<()> { | ||
unimplemented!() | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
crates/core/component/funding/src/component/liquidity_tournament/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod bank; |