Skip to content

Commit

Permalink
Stub funding/LQT Bank interface
Browse files Browse the repository at this point in the history
No implementation yet, but this is the shape I think we want.
  • Loading branch information
cronokirby committed Jan 30, 2025
1 parent 9c7da1f commit 848a0dc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions crates/core/component/funding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ component = [
"cnidarium",
"penumbra-sdk-proto/cnidarium",
"penumbra-sdk-community-pool/component",
"penumbra-sdk-dex/component",
"penumbra-sdk-distributions/component",
"penumbra-sdk-sct/component",
"penumbra-sdk-shielded-pool/component",
Expand All @@ -25,6 +26,7 @@ parallel = [
"ark-groth16/parallel",
"decaf377/parallel",
"decaf377-rdsa/parallel",
"penumbra-sdk-dex/parallel",
"penumbra-sdk-tct/parallel",
"penumbra-sdk-shielded-pool/parallel",
"penumbra-sdk-governance/parallel"
Expand All @@ -44,6 +46,7 @@ futures = {workspace = true, optional = true}
metrics = {workspace = true, optional = true}
penumbra-sdk-asset = {workspace = true, default-features = true}
penumbra-sdk-community-pool = {workspace = true, default-features = false}
penumbra-sdk-dex = {workspace = true, default-features = true}
penumbra-sdk-distributions = {workspace = true, default-features = false}
penumbra-sdk-governance = {workspace = true, default-features = false}
penumbra-sdk-keys = {workspace = true, default-features = false}
Expand Down
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!()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod bank;

0 comments on commit 848a0dc

Please # to comment.