pub enum PerpDeploy {
Show 16 variants
RegisterAsset2 {
max_gas: Option<u64>,
asset: NewAsset,
margin_mode: MarginMode,
dex: DexName,
schema: Option<DexSchema>,
},
RegisterAsset {
max_gas: Option<u64>,
asset: NewAsset,
only_isolated: bool,
dex: DexName,
schema: Option<DexSchema>,
},
SetOracle {
dex: DexName,
oracle_pxs: ByCoin<Dec>,
mark_pxs: Vec<ByCoin<Dec>>,
external_perp_pxs: ByCoin<Dec>,
},
SetFundingMultipliers(ByCoin<Dec>),
SetFundingInterestRates(ByCoin<Dec>),
SetFundingClamps(ByCoin<Dec>),
HaltTrading {
coin: String,
is_halted: bool,
},
InsertMarginTable {
dex: DexName,
margin_table: MarginTable,
},
SetMarginTableIds(ByCoin<u32>),
SetFeeRecipient {
dex: DexName,
fee_recipient: Address,
},
SetOpenInterestCaps(ByCoin<Option<u64>>),
SetSubDeployers {
dex: DexName,
sub_deployers: Vec<SubDeployer>,
},
SetMarginModes(ByCoin<MarginMode>),
SetDeployerFees(ByCoin<DeployerFee>),
SetPerpAnnotation {
coin: String,
annotation: Annotation,
},
DisableDex(DexName),
}Expand description
{"type":"perpDeploy",<variant>:..}. The constructors check what the
docs rule out and take each per-coin list in any order, refusing a coin
given twice; the lists go out sorted by coin, as the venue requires.
Variants§
RegisterAsset2
registerAsset2: an asset with a margin mode. With a schema it also
creates the dex. max_gas is in native token wei; None (sent as
null) pays the current auction price, and 0 uses a reserve
deployment whether or not the auction has ended.
Fields
max_gas: Option<u64>The most native token wei to pay (maxGas); None, sent as null, pays the current auction price.
margin_mode: MarginModeHow the asset may be margined (marginMode).
RegisterAsset
registerAsset: as RegisterAsset2,
with onlyIsolated for the margin mode.
Fields
SetOracle
setOracle: oracle prices, 0 to 2 lists of mark prices, and external
perp prices for every asset. At least 2.5 seconds apart.
Fields
SetFundingMultipliers(ByCoin<Dec>)
setFundingMultipliers, each from 0 to 10.
SetFundingInterestRates(ByCoin<Dec>)
setFundingInterestRates: 8 hour rates, each from -0.01 to 0.01.
SetFundingClamps(ByCoin<Dec>)
setFundingClamps: 8 hour clamps, each from 0 to 0.01.
HaltTrading
haltTrading: halts (true) or resumes (false) one asset.
Fields
InsertMarginTable
insertMarginTable.
Fields
margin_table: MarginTableThe table to insert (marginTable).
SetMarginTableIds(ByCoin<u32>)
setMarginTableIds, none of them 0.
SetFeeRecipient
setFeeRecipient.
Fields
SetOpenInterestCaps(ByCoin<Option<u64>>)
setOpenInterestCaps: notional caps; None (sent as null) removes
an asset’s custom cap.
SetSubDeployers
setSubDeployers.
Fields
sub_deployers: Vec<SubDeployer>The grants (subDeployers), at least one.
SetMarginModes(ByCoin<MarginMode>)
setMarginModes.
SetDeployerFees(ByCoin<DeployerFee>)
setDeployerFees. On mainnet, one change per 30 days.
SetPerpAnnotation
setPerpAnnotation.
Fields
annotation: AnnotationThe annotation, sent flat next to the coin.
DisableDex(DexName)
disableDex.
Implementations§
Source§impl PerpDeploy
impl PerpDeploy
Sourcepub fn register_asset2(
dex: DexName,
max_gas: Option<u64>,
asset: NewAsset,
margin_mode: MarginMode,
schema: Option<DexSchema>,
) -> Result<Self, BadDeploy>
pub fn register_asset2( dex: DexName, max_gas: Option<u64>, asset: NewAsset, margin_mode: MarginMode, schema: Option<DexSchema>, ) -> Result<Self, BadDeploy>
registerAsset2, refusing a negative oracle price.
Sourcepub fn register_asset(
dex: DexName,
max_gas: Option<u64>,
asset: NewAsset,
only_isolated: bool,
schema: Option<DexSchema>,
) -> Result<Self, BadDeploy>
pub fn register_asset( dex: DexName, max_gas: Option<u64>, asset: NewAsset, only_isolated: bool, schema: Option<DexSchema>, ) -> Result<Self, BadDeploy>
registerAsset, refusing a negative oracle price.
Sourcepub fn set_oracle<K: Into<String>>(
dex: DexName,
oracle_pxs: impl IntoIterator<Item = (K, Dec)>,
mark_pxs: Vec<Vec<(K, Dec)>>,
external_perp_pxs: impl IntoIterator<Item = (K, Dec)>,
) -> Result<Self, BadDeploy>
pub fn set_oracle<K: Into<String>>( dex: DexName, oracle_pxs: impl IntoIterator<Item = (K, Dec)>, mark_pxs: Vec<Vec<(K, Dec)>>, external_perp_pxs: impl IntoIterator<Item = (K, Dec)>, ) -> Result<Self, BadDeploy>
setOracle, refusing more than 2 mark price lists or a negative price.
Sourcepub fn set_funding_multipliers<K: Into<String>>(
multipliers: impl IntoIterator<Item = (K, Dec)>,
) -> Result<Self, BadDeploy>
pub fn set_funding_multipliers<K: Into<String>>( multipliers: impl IntoIterator<Item = (K, Dec)>, ) -> Result<Self, BadDeploy>
setFundingMultipliers, each from 0 to 10.
Sourcepub fn set_funding_interest_rates<K: Into<String>>(
rates: impl IntoIterator<Item = (K, Dec)>,
) -> Result<Self, BadDeploy>
pub fn set_funding_interest_rates<K: Into<String>>( rates: impl IntoIterator<Item = (K, Dec)>, ) -> Result<Self, BadDeploy>
setFundingInterestRates, each from -0.01 to 0.01.
Sourcepub fn set_funding_clamps<K: Into<String>>(
clamps: impl IntoIterator<Item = (K, Dec)>,
) -> Result<Self, BadDeploy>
pub fn set_funding_clamps<K: Into<String>>( clamps: impl IntoIterator<Item = (K, Dec)>, ) -> Result<Self, BadDeploy>
setFundingClamps, each from 0 to 0.01.
Sourcepub fn set_margin_table_ids<K: Into<String>>(
ids: impl IntoIterator<Item = (K, u32)>,
) -> Result<Self, BadDeploy>
pub fn set_margin_table_ids<K: Into<String>>( ids: impl IntoIterator<Item = (K, u32)>, ) -> Result<Self, BadDeploy>
setMarginTableIds, refusing id 0.
Sourcepub fn set_open_interest_caps<K: Into<String>>(
caps: impl IntoIterator<Item = (K, Option<u64>)>,
) -> Result<Self, BadDeploy>
pub fn set_open_interest_caps<K: Into<String>>( caps: impl IntoIterator<Item = (K, Option<u64>)>, ) -> Result<Self, BadDeploy>
setOpenInterestCaps; None removes an asset’s custom cap.
Sourcepub fn set_sub_deployers(
dex: DexName,
sub_deployers: Vec<SubDeployer>,
) -> Result<Self, BadDeploy>
pub fn set_sub_deployers( dex: DexName, sub_deployers: Vec<SubDeployer>, ) -> Result<Self, BadDeploy>
setSubDeployers, refusing an empty list.
Sourcepub fn set_margin_modes<K: Into<String>>(
modes: impl IntoIterator<Item = (K, MarginMode)>,
) -> Result<Self, BadDeploy>
pub fn set_margin_modes<K: Into<String>>( modes: impl IntoIterator<Item = (K, MarginMode)>, ) -> Result<Self, BadDeploy>
setMarginModes.
Sourcepub fn set_deployer_fees<K: Into<String>>(
fees: impl IntoIterator<Item = (K, DeployerFee)>,
) -> Result<Self, BadDeploy>
pub fn set_deployer_fees<K: Into<String>>( fees: impl IntoIterator<Item = (K, DeployerFee)>, ) -> Result<Self, BadDeploy>
setDeployerFees: each scale from 0 to 3, or from 0 up to (not
including) 10 in growth mode.
Trait Implementations§
Source§impl Clone for PerpDeploy
impl Clone for PerpDeploy
Source§impl Debug for PerpDeploy
impl Debug for PerpDeploy
impl Eq for PerpDeploy
Source§impl L1Action for PerpDeploy
impl L1Action for PerpDeploy
Source§fn action(&self) -> Map
fn action(&self) -> Map
Source§fn msgpack(&self) -> Vec<u8> ⓘ
fn msgpack(&self) -> Vec<u8> ⓘ
Source§fn typed(
&self,
nonce: u64,
vault: Option<Address>,
network: Network,
) -> TypedStruct<'static>
fn typed( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> TypedStruct<'static>
Source§fn digest(
&self,
nonce: u64,
vault: Option<Address>,
network: Network,
) -> [u8; 32]
fn digest( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> [u8; 32]
Domain::EXCHANGE.Source§impl PartialEq for PerpDeploy
impl PartialEq for PerpDeploy
impl StructuralPartialEq for PerpDeploy
Auto Trait Implementations§
impl Forget for PerpDeploy
impl Freeze for PerpDeploy
impl Move for PerpDeploy
impl RefUnwindSafe for PerpDeploy
impl Send for PerpDeploy
impl Sync for PerpDeploy
impl Unpin for PerpDeploy
impl UnsafeUnpin for PerpDeploy
impl UnwindSafe for PerpDeploy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.