pub struct TestPerp<'e> {
pub id: PerpetualId,
pub name: String,
pub price_converter: Converter,
pub size_converter: Converter,
pub leverage_converter: Converter,
pub exchange: &'e TestExchange,
}Fields§
§id: PerpetualId§name: String§price_converter: Converter§size_converter: Converter§leverage_converter: Converter§exchange: &'e TestExchangeImplementations§
Source§impl<'e> TestPerp<'e>
impl<'e> TestPerp<'e>
pub async fn with_mark_price(self, price: UD64) -> Self
pub async fn with_min_post(self, min: U256) -> Self
pub async fn with_min_settle(self, min: U256) -> Self
pub async fn unpause(self) -> Self
pub async fn set_maintenance_margin( &self, maintenance_margin: UD64, ) -> PendingTransactionBuilder<Ethereum>
pub async fn set_mark_price( &self, price: UD64, ) -> PendingTransactionBuilder<Ethereum>
pub async fn set_funding_rate( &self, price: u32, rate: i32, ) -> PendingTransactionBuilder<Ethereum>
Sourcepub async fn with_legacy_fees(self, taker_fee: UD64, maker_fee: UD64) -> Self
pub async fn with_legacy_fees(self, taker_fee: UD64, maker_fee: UD64) -> Self
Sets this contract’s fees through the pre-v1.1.7.4 per-contract setters,
for use with TestExchange::new_at_previous_version.
The current contract has no equivalent - fees live in the keyed
schedules and these setters were removed - so this reverts against
it. Emits the deprecated TakerFeeUpdated/MakerFeeUpdated events.
Sourcepub async fn set_fee_schedule(
&self,
taker_fees: [UD64; 8],
maker_fees: [UD64; 8],
) -> PendingTransactionBuilder<Ethereum>
pub async fn set_fee_schedule( &self, taker_fees: [UD64; 8], maker_fees: [UD64; 8], ) -> PendingTransactionBuilder<Ethereum>
Sets a custom fee schedule for this perpetual contract, eight
(taker, maker) rates indexed by an account’s fee tier.
v1.1.7.4 split the one-shot custom-schedule setter into value-set +
repoint, done here back to back. Use
Self::set_own_fee_schedule_values and Self::use_own_fee_schedule
to exercise the two halves apart.
Sourcepub async fn set_own_fee_schedule_values(
&self,
taker_fees: [UD64; 8],
maker_fees: [UD64; 8],
)
pub async fn set_own_fee_schedule_values( &self, taker_fees: [UD64; 8], maker_fees: [UD64; 8], )
Writes the rates of the schedule keyed by this contract’s id, without pointing the contract at it - schedule values and the pointer into them are independent.
Sourcepub async fn use_own_fee_schedule(&self) -> PendingTransactionBuilder<Ethereum>
pub async fn use_own_fee_schedule(&self) -> PendingTransactionBuilder<Ethereum>
Points this perpetual contract at the schedule keyed by its own id, see
Self::set_own_fee_schedule_values.
Sourcepub async fn set_rwa_default_fee(&self) -> PendingTransactionBuilder<Ethereum>
pub async fn set_rwa_default_fee(&self) -> PendingTransactionBuilder<Ethereum>
Repoints this perpetual contract at the exchange-wide RWA default fee schedule.
Sourcepub async fn order(
&self,
account_id: AccountId,
request: OrderRequest,
) -> PendingTransactionBuilder<Ethereum>
pub async fn order( &self, account_id: AccountId, request: OrderRequest, ) -> PendingTransactionBuilder<Ethereum>
Posts an order via the V1 entrypoint, which carries no builder attribution.
Sourcepub async fn order_v2(
&self,
account_id: AccountId,
request: OrderRequest,
) -> PendingTransactionBuilder<Ethereum>
pub async fn order_v2( &self, account_id: AccountId, request: OrderRequest, ) -> PendingTransactionBuilder<Ethereum>
Posts an order via the V2 entrypoint, carrying the request’s builder attribution if any.
Sourcepub async fn orders_v2(
&self,
account_id: AccountId,
requests: Vec<OrderRequest>,
revert_on_fail: bool,
) -> PendingTransactionBuilder<Ethereum>
pub async fn orders_v2( &self, account_id: AccountId, requests: Vec<OrderRequest>, revert_on_fail: bool, ) -> PendingTransactionBuilder<Ethereum>
Posts a batch of orders via the V2 entrypoint, carrying each request’s builder attribution if any.
pub async fn orders( &self, account_id: AccountId, requests: Vec<OrderRequest>, ) -> PendingTransactionBuilder<Ethereum>
Trait Implementations§
Auto Trait Implementations§
impl<'e> !RefUnwindSafe for TestPerp<'e>
impl<'e> !UnwindSafe for TestPerp<'e>
impl<'e> Freeze for TestPerp<'e>
impl<'e> Send for TestPerp<'e>
impl<'e> Sync for TestPerp<'e>
impl<'e> Unpin for TestPerp<'e>
impl<'e> UnsafeUnpin for TestPerp<'e>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more