-
Notifications
You must be signed in to change notification settings - Fork 25
Home
The Laminar Chain contains the following modules
-
orml-oracle
: is part of the Open Runtime Module Library, takes price feed, and allows other modules to get price for particular currency// Dispatchable methods fn feed_value(origin, key: T::Key, value: T::Value) fn feed_values(origin, values: Vec<(T::Key, T::Value)>) // Module callable methods fn read_raw_values(key: &T::Key) fn get(key: &T::Key)
-
orml-currencies
: is part of the Open Runtime Module Library, supportsMultiCurrency
and native token viabalance
// Dispatchable methods pub fn transfer(origin, dest: <T::Lookup as StaticLookup>::Source, currency_id: CurrencyIdOf<T>, #[compact] amount: BalanceOf<T>,) pub fn transfer_native_currency(origin, dest: <T::Lookup as StaticLookup>::Source, #[compact] amount: BalanceOf<T>,)
-
liquidity_pools
: assets in the liquidity pool are used as collaterals in synthetic asset and margin trading. Anyone cancreate_pool
anddeposit_liquidity
, only owner canremove_pool
anddisable_pool
, owner can setbid_spread
andadditional_collateral_ratio
, and specify which trades are supported by this pool// Dispatchable methods fn create_pool(origin) fn disable_pool(origin, pool: LiquidityPoolId) fn remove_pool(origin, pool: LiquidityPoolId) fn deposit_liquidity(origin, pool: LiquidityPoolId, amount: Balance) fn withdraw_liquidity(origin, pool: LiquidityPoolId, amount: Balance) fn set_bid_spread(origin, pool: LiquidityPoolId, currency_id: CurrencyId, ask: Permill, bid: Permill) fn set_additional_collateral_ratio(origin, pool: LiquidityPoolId, currency_id: CurrencyId, ratio: Option<Permill>) fn set_enabled_trades(origin, pool: LiquidityPoolId, currency_id: CurrencyId, long: Leverages, short: Leverages)
-
synthetic_tokens
: represents synthetic assets like fEUR. It is an implementation of MultiCurrency from our Open Runtime Module Library// Storage ExtremeRatio: CurrencyId => Option<Permill> LiquidationRatio: CurrencyId => Option<Permill> CollateralRatio: CurrencyId => Option<Permill> Positions: map (LiquidityPoolId, CurrencyId) => Position // Module callable methods addPosition(who: AccountId, pool: LiquidityPoolId, collaterals: Balance, minted: Balance) removePosition(who: AccountId, pool: LiquidityPoolId, collaterals: Balance, minted: Balance)
-
synthetic_protocol
: it is the entry/proxy module for people to trade 1:1 with synthetic assets. You canmint
andredeem
a particular synthetic asset,liquidate
a position that's below required collateral ratio. Later version we will use off-chain worker to implement liquidation process to improve responsiveness to risks.// Dispatchable methods fn mint(origin, currency_id: CurrencyId, pool: LiquidityPoolId, base_amount: Balance, max_slippage: fn Permill) fn redeem(origin, currency_id: CurrencyId, pool: LiquidityPoolId, flow_amount: Balance, max_slippage: Permill) fn liquidate(origin, currency_id: CurrencyId, pool: LiquidityPoolId, flow_amount: Balance)
-
margin_protocol
: people can use this module toopenPosition
andclosePosition
for leveraged long or short trades// Dispatchable methods fn openPosition(origin, pair: TradingPair, pool: LiquidityPoolId, base_amount: Balance) fn closePosition(origin, position_id: PositionId)
-
primitives
: constants for supported leverages, currencies etc
Our margin trading protocol is currently under review by financial advisors. While the MVP testnet will implement the current version of margin trading protocol, it is expected that the next version will be upgraded to a more elaborated margin trading mechanisms. More details on the upgrade will be disclosed as we progress.
See more details here