Skip to content

Commit

Permalink
Phoenix v1/add getter for fee rate (#9)
Browse files Browse the repository at this point in the history
Changes:
- Create traits for getting tick size and taker fee bps
- Implement traits for FIFOMarket
  • Loading branch information
jarry-xiao authored Feb 14, 2023
1 parent 38a2129 commit d66d2cd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "phoenix-v1"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
resolver = "2"
repository = "https://github.com/Ellipsis-Labs/phoenix-v1"
Expand Down
8 changes: 8 additions & 0 deletions src/state/markets/fifo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,14 @@ impl<
std::mem::size_of::<Self>()
}

fn get_taker_fee_bps(&self) -> u64 {
self.taker_fee_bps
}

fn get_tick_size(&self) -> QuoteLotsPerBaseUnitPerTick {
self.tick_size_in_quote_lots_per_base_unit
}

fn get_base_lots_per_base_unit(&self) -> BaseLotsPerBaseUnit {
self.base_lots_per_base_unit
}
Expand Down
2 changes: 2 additions & 0 deletions src/state/markets/market_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ pub trait Market<
TypedLadder { bids, asks }
}

fn get_taker_fee_bps(&self) -> u64;
fn get_tick_size(&self) -> QuoteLotsPerBaseUnitPerTick;
fn get_base_lots_per_base_unit(&self) -> BaseLotsPerBaseUnit;
fn get_sequence_number(&self) -> u64;
fn get_registered_traders(&self) -> &dyn OrderedNodeAllocatorMap<MarketTraderId, TraderState>;
Expand Down

0 comments on commit d66d2cd

Please sign in to comment.