pub struct KrakenTradingRateLimiter { /* private fields */ }
Expand description
An implementation of the most accurate trading rate limits given by Kraken
Implementations§
Source§impl KrakenTradingRateLimiter
impl KrakenTradingRateLimiter
Implements the Advanced rate limiting scheme that requires knowing each order’s lifetime.
Detailed documentation is available from several locations, including the overview rate-limiting page, api rate-limiting page and trading rate-limiting page.
Sourcepub fn new(user_verification: VerificationTier) -> KrakenTradingRateLimiter
pub fn new(user_verification: VerificationTier) -> KrakenTradingRateLimiter
Create a new instance for a user with the given VerificationTier
Sourcepub async fn add_order_batch(
&mut self,
add_batched_order_request: &AddBatchedOrderRequest,
)
pub async fn add_order_batch( &mut self, add_batched_order_request: &AddBatchedOrderRequest, )
Determine the cost and wait appropriately for the given AddBatchedOrderRequest.
The cost of a batch is n / 2, where n is the number of orders in the batch.
Sourcepub async fn amend_order(
&mut self,
tx_id: &Option<String>,
client_order_id: &Option<String>,
)
pub async fn amend_order( &mut self, tx_id: &Option<String>, client_order_id: &Option<String>, )
Determine the cost of amending an order and wait if necessary
This is inclusive of penalties for orders amended soon after creation or their last amendment.
Sourcepub async fn edit_order(&mut self, edit_order_request: &EditOrderRequest)
pub async fn edit_order(&mut self, edit_order_request: &EditOrderRequest)
Determine the cost of editing an order and wait if necessary
This is inclusive of penalties for orders edited soon after creation.
Sourcepub async fn cancel_order_tx_id(&mut self, id: &String)
pub async fn cancel_order_tx_id(&mut self, id: &String)
Determine the cost of cancelling the provided order id and wait appropriately
This is inclusive of penalties for orders cancelled soon after creation.
Sourcepub async fn cancel_order_user_ref(&mut self, id: &i64)
pub async fn cancel_order_user_ref(&mut self, id: &i64)
Determine the cost of cancelling the provided user ref and wait appropriately
This is inclusive of penalties for orders cancelled soon after creation.
Sourcepub async fn notify_add_order(
&mut self,
tx_id: String,
placement_time: i64,
user_ref: Option<i64>,
client_order_id: &Option<String>,
)
pub async fn notify_add_order( &mut self, tx_id: String, placement_time: i64, user_ref: Option<i64>, client_order_id: &Option<String>, )
Notify the rate limiter of a new order being created – this is essential to the rate limiting scheme!
Order lifetimes must be known in order to determine the penalties for editing or cancelling orders that were placed less than 300s ago.
Trait Implementations§
Source§impl Clone for KrakenTradingRateLimiter
impl Clone for KrakenTradingRateLimiter
Source§fn clone(&self) -> KrakenTradingRateLimiter
fn clone(&self) -> KrakenTradingRateLimiter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more