DECENTRALIZED TRADE EXECUTION
Smart Contract Execution Triggers
Decentralised Trade Execution
By Louise Courtman & Cynan Rhodes
Thursday, 4th April, 2024
Web 2 Copy Trading Was A Bad Product

Copy trading or social trading has been around for many years now but it's never really taken off. We wrote about it in detail here: https://alphacapture.xyz/blogs/why-we-built-alphacapture but in short, because it's always been a web2 proposition, it's alway involved a centralised service which needs to be regulated to handle trades and manage brokerage connections; as investors you need to give access to your account and personal financial information and as strategy providers, you must be approved by the centralised service and then give up your strategy and your users (to the centralised service). For these reasons, copy trading has only ever had a very small market share.

Using decentralised tools eliminates the major issues. Here's how it works:

Steps:

  • Strategy tokenisation: A creator posts a strategy and trades (proof of idea OR proof of trade) on-chain (created as NFTs)
  • Grants Share of Token: The creator grants access to the idea as a share of token
  • Credentials NFT setup: An investor configures their own brokerage account/wallet (CEX/DEX) on-chain
  • Trigger setup: An investor configures what they want to do when they receive access to an idea (share of token)
  • Copy Trade Trigger: Upon receipt of a trade/nft, it is auto copied using smart contracts/oracles into an investor's brokerage account/wallet according to the details of the trigger

Simple enough, but let's look at it in more detail.

Step 1: Creator: Strategy tokenisation

There are two ways to create a strategy and record the individual trades on-chain for transparency.

  • Proof of idea - using smart contracts and oracles, when your strategy says 'buy Microsoft', the asset is validated at your brokerage with the credentials you provide to the smart contract, a real-time price is requested and the data is signed and returned. An nft is created with this data and your trading idea is now immortalised on-chain: you said to 'buy Microsoft at $367 at 2024-01-05 12:02:08.954092000'.
  • Proof of trade - again, using smart contracts and oracles, historic trade data is requested directly from your brokerage, then signed and an nft is created. This proves that your broker said you 'bought Microsoft at $367 at 2024-01-05 12:02:08.954092000 on Alpaca'.

A strategy consists of either one approach or the other (it can't be a mix) and ideas or trades are created within the context of a parent strategy. Note that by default, ideas/trades are encrypted and so the idea contents are not yet publicly available.

See example strategy: US Tech Momemtum Strategy

See example idea: Long SNOW (in the US Tech Momemtum Strategy)

Step 2: Creator: Grants Share of Token

When creating the idea/trade as an NFT, the creator decides who should have access. The creator simply grants a wallet owner a share of the NFT (token). This can be done when the nft is created or at a later point. The investor (now token owner) will have access to NFTs via their wallet and can automatically decrypt the idea/trade contents.

Step 3: Investor: Credentials NFT setup

The investor creates an encrypted NFT in their own wallet containing their credentials to their CEX/DEX account.

Only the investor (wallet owner) has access to this NFT via their wallet connection. It is important to note that only the investor has access to these details and they are never, ever shared with anyone else, including strategy owners.

There is no account connection taking place - this is simply an encrypted store of investor's brokerage details.

Note that investor configure their credentials via https://d2.alphacapture.xyz/. This is an open source application available from https://github.com/IXily/D2

Step 4: Investor: Define a Trigger

What should happen when the investor receives an NFT (share of token) from a strategy creator? This is defined by the investor - send a notification, send a email, do nothing - or action the proposed trade into their account i.e. copy trade.

The investor defines the strategy, the brokerage account and the risk settings (such as position size). This data is accessible only by the investor and is secured by their wallet connection.

Triggers are also configured via https://d2.alphacapture.xyz/.

Step 5: Investor: Copy Trade

The final step brings the whole process together. The strategy creator creates a new idea, the nft is created and the investor receives a share of token. Upon receipt of the token, an event listener (a process owned by the investor) checks for triggers, retrieves the investor's credentials and using smart contracts/oracles places a trade on the investor's behalf according to their instructions.

For further details on setting up your own event listener, please see https://d2.alphacapture.xyz/guides/event-listener.

Summary

So what is the advantage of using a decentralised process versus a traditional, web2 centralised approach?

Pros:

  • There is no brokerage connection - the investor never connects their brokerage account to a centralised party, to a strategy owner or to anyone else. Ever.
  • There is no sharing of investor data - no personal or financial data is shared by the investor; there is no need for it. The strategy owner does not need access to the investor's brokerage account for a copy trade to take place. All the investor needs is the details of the idea and they apply it to their account according to their risk parameters.
  • Regulation is not required to grant a share of token and neither for the Investor to place their own trade.
  • Ownership: creators own all their data and control who has access.
  • Permissionless: anyone can create their own ideas and strategy.

Cons:

  • At the moment the service requires some technical capabilities, such as setting up an event listener and also about crypto in general, such as the need to pay for gas fees (to create idea or to apply the trades).
@AlphaCapture 2024