Updates for the Week. The synthetics contract code has been published:. Contract features:.

03 Oct 2022, 12:55
Updates for the Week The synthetics contract code has been published: Contract features: - A new oracle system that offers front-running resistance - Exact order execution for market, limit, stop-loss, take-profit orders - Positive / negative price impact and funding fees - Pairs and risk isolation - Multi-collateral support - Low fee swap orders # XGET oracle The contracts provide an oracle system that allows for general information to be verified on-chain while providing front-running resistance, this works by having nodes sign a combination of blockhashes and values For example, if the latest block on Arbitrum has a blockhash of 0x5d3e7, an oracle node would retrieve this and the median price of exchanges for a token, it would then sign (0x5d3e7, median price) Since information is retrieved and signed only after the block is observed, this helps to prevent front-running issues The oracle system is neutral and nodes are easy to run, the oracle nodes only notarize information they do not send transactions on-chain or respond to requests # Exact order execution The oracle can be used for any system requiring front-running resistance Applying this to synthetics, an order request can be sent at block 100, and once oracle nodes notarize the prices for the block, the order can be executed at that price This means that even in times of congestion, orders can be executed at the exact price observed when the order transaction was sent This allows limit orders to behave similar to what would be expected on a centralized exchange, if the price crossed the limit price, the limit order can be retroactively executed Stop-loss and take-profit orders can similarly be executed at the exact price specified in the original order if price conditions are met # Positive / negative price impact and funding fees To keep long / short ratios balanced, orders will have both positive and negative price impact Negative price impact scales with increasing imbalance, while positive price impact incentivises re-balancing, to avoid price manipulation positive price impact will be reduced or set to zero in times of high volatility or irregular price movements Positive and negative funding fees additionally help incentivise balance to reduce the risks of liquidity providers # Pairs and risk isolation We had mentioned a PvP AMM and GD token in our last update, while it had some useful properties, we have modified the model into a pair based system, as we felt that there were a lot of advantages in doing so With the synthetics contracts, each market is its own pool, and liquidity providers can choose which pools to deposit into This allows for better market efficiency, capital can flow into the pools with the most utilization without requiring any manual configuration Newer, riskier tokens can be isolated from tokens that have been around for longer or that have a higher market capitalization A pair system creates a base to allow for permissionless listings, the flow to add a new market would be - To run oracle nodes or request existing oracle nodes to support a new information feed - Create the market using the synthetics market factory # Multi-collateral support Markets will support both a long and short token, for example, the ETH / USD market can have ETH as the long token and USDC as the short token These tokens are used to back net trader profits / losses, and helps to ensure that profits can be fully paid while ensuring the system remains solvent Similarly, traders can use either the long or short token as collateral, for example either ETH or USDC for an ETH / USD market, this allows for capital efficient trades to earn funding fees If there are more longs than shorts, ETH can be deposited as collateral for a 1x short position, the position would earn funding fees while remaining delta neutral