PixelAlpha Technology Closeup: Building Derivative Contracts Using Stellar

PixelAlpha will be using Stellar as the settlements layer for our decentralized cryptoasset derivatives exchange. There are several features which make their DLT uniquely suited for operating a derivatives platform, but speed, reliability, and simplicity were key differentiators. Stellar allows our transactions to settle in seconds, rather than the minutes that other public chains take. Users maintain custody over their funds, removing the single repository of funds that hackers love to target in centralized exchanges. Lastly, their contract operations align very well with derivative product structuring.

We can start with a simple usecase: OTC forwards with asset delivery on expiry. Stellar practically has this feature built in. The initiating party would generate a time-bounded multisignature account that both them and the counterparty can send their digital assets to. When the time bound expires, each party can withdraw as initially agreed. This has exciting implications for when tokenization is more universally recognized as proof of ownership and entities are hedging the real-world assets that tokens represent.

Building on this foundation, PixelAlpha’s value is in the ability to reliably facilitate leveraged trades, programmatically enforce margin calls, and enable settlement in a common denomination. On chain, we have user accounts and an immutable record of all active positions, including the sum of longs and shorts. This way we can relegate expensive calculations regarding margin requirement, pricing feed, and order entry/cancellation off chain. Algorithmic traders have been known to enter and exit positions in fractions of seconds at very points, so building the orderbook off chain to support such behavior is necessary if we are going to target institutional users. The functional diagram below is how the hybrid chain approach makes this possible:

Leverage and margin calls are both largely reliant on accurate pricing, which is what the TrueMarket API at the bottom of the chart refers to. That will be the subject of another technology closeup.

To walk through the above: each margin Stellar account comes wrapped in PixelAlpha secured code, which needs to be verified as original and secure before the orderbook accepts orders from it. This way funds never go into an exchange-controlled account, but margin calls can still be triggered via baked-in code which tracks open positions and real time pricing data against available margin. Each transaction is signed by party, counterparty, and exchange for veracity, but only party and counterparty have privilege levels that allow them to close their positions. Upon settlement, the commensurate number of PXA are purchased at market value and automatically paid out as detailed in our tokenomics structure.

We knew we needed the right chain to take on the $200b/day derivatives market, and are incredibly excited that we found that in Stellar. To learn more, join our Telegram group or follow us on Twitter.