The liquidity providers in the Margin Protocol

Jarvis
Jarvis
Aug 30, 2019 · 11 min read

Jarvis Exchange (https://app.jarvis.exchange) is a platform for interacting with our financial protocols on Ethereum. In this article we will detail the relationship that exists within our Margin Protocol between users who speculate, the traders, and those who provide liquidity, the liquidity providers (LP).

Our protocols uberize brokerage; like AirBnb is the largest hotelier in the world, without owning any hotel, our protocol aims to power the largest brokerage place in the world, without having any broker.


TLDR: In Jarvis Margin Protocol traders trade any assets, from Forex to stocks and cryptocurrencies, against liquidity pools which are supplied by different users. Savvy liquidity providers can hedge their exposure on real financial markets through an automated bridge.


How does it work?

Traders trade against the protocol’s liquidity pools, fuelled by the LP. Each pool is different, and traders are free to choose with which one to trade according to their settings: some are predefined by the protocol (price feed source, spread and minimum deposit for being a LP) while others are at the discretion of the LP supplying the pool (leverage, isolated or general margin system, supported instruments, spreads and / or commissions, funding fees, daily/hourly/instant settlement, etc.).

Price feed source

The price feeds are chosen according to the possibility for savvy LPs to hedge themselves (later explained); for example, the price feed can be from FXCM, allowing LP to hedge themselves using this broker.

However, in a decentralized system, using data external to the Blockchain, such as the price of a stock, carries a risk: an attacker could interpose between the price feed and the Blockchain, and upload erroneous data to the latter; it could say that a stock has doubled in price to make a profit to the disadvantage of its counterpart. In the future, a network of incentivized validators will check the data integrity so in the event of fraud, the attacker could not benefit from it.

Settlement of trades

Some LP opt for hourly or daily settlement, others for an instant one. In a case of a delayed settlement, final profits and losses of traders are calculated at regular time intervals to make only one payment, while there would be as much payment as there are trades in the case of an instant settlement. For a trader, instant settlement allows them to withdraw their capital at any time, while delayed settlement allows them to withdraw their money only at defined intervals, like once per hour or per day. For a LP, a daily settlement allows better risk and cash flow management and could allow then to offer much better prices than a competing LP which would opt for instant settlement.

Leverage

Each time a trader opens a position, a part of their deposit and a part of the liquidity pool — the required margin — are immobilized and used as collateral for their respective positions. Indeed, since the protocol is the counterpart of traders, the two parties each hold an opposite position.

However, the collateral of the liquidity pool may vary: in the case where a trader opens a position opposite to that of another trader, they are compensated within the same pool, effectively becoming each other counterpart. In fact, the liquidity pool immobilizes a margin corresponding to its total exposure, ie the aggregated volume of the buying and selling open positions (this sum can, therefore, be positive, zero or negative).

Since part of the funds in the liquidity pools are immobilized to collateralize their positions, their size limits their maximum exposure, and it is, therefore, possible that no more positions can be opened due to lack of liquidity. In which case the LP is incentivized to supply more liquidity to avoid that traders move away to go trade with a more liquid pool, or to simply avoid a margin call…

Margin call

The margin is used to limit the maximum exposure and to protect the capital of the parties. Pools can offer an isolated or general margin system.

For the trader with an isolated margin system, their maximum loss on a position will be limited to their collateral: the position will close automatically if their loss equals their required margin.

For example, if the trader has an account of 500 euros, and opens a position of 10,000 euros, 100 euros would be required to collateralize this position (leverage of 100), and it will close automatically if the loss on this position equals 100 euros.

In the event of a general margin call, the positions will close if the trader’s balance minor the net result of all their open positions — usually called the equity of an account — falls below a certain level.

With the same example, if all of the trader’s open positions required 200 euros of margin, and these positions were losing 300 euros, then they would be closed (500-300=200, so it would reach the margin level).

In both cases, it is therefore not possible to lose more than the deposited capital; the maximum loss is, however, smaller in the isolated system.

For the liquidity pools themselves, the margin call system cannot be chosen it is always general. As a counterpart to all traders, the net result of all open positions can be negative (traders win more than they lose) or positive (traders lose more than they win); if the case of a negative net result, if the equity of a pool falls below a certain level, it will be in margin call, and will no longer have enough collateral to maintain its positions. All the positions would be automatically closed and settled. To avoid this situation, the LPs are incentivized to control the level of collateralization of the pools, and to maintain it beyond a certain level, and to provide more liquidity if necessary. If they fail, the rest of their deposit will be confiscated and shared among all traders who were in position against the pool, to compensate them.

LP who would fail to bring more liquidity and who will let a margin call to happen will loose the trust of the traders who probably will never trade with them anymore.

In all cases, maintaining sufficient liquidity and providing it carries a risk to the LPs, which they can offset using market making strategy…

Market making strategy

As a reward for their liquidity, LP receives spreads and commissions. Providing liquidity can be a very lucrative business, but carries the risk of loss. Indeed, in the case where the traders of a pool earn more than they lose, and the net result of the positions is higher than the commissions earned by the LP, the latter will then start to lose money up to the total of their deposit. However, this risk can be managed.

LPs do have two options, which we covered in the article on market makers:

  • A Book: hedge the exposure of the liquidity pools on the real markets to neutralize the risk and only earn on spreads or commissions.
    Remember, the price feed source comes from the eligible entity; for example, if the source is FXCM, the LP can open an account with this broker and connect its API to the protocol so they could automatically hedge each position. Thus, each time a position is opened using the protocol, an exact similar one is opened on the trading account of the LP, covering the risk of all the positions in the pool.

When a trader earns 20 euros, the pool, and therefore the LP, loses them; but, since the position is hedged, the LP earns 21 euros on its FXCM trading account; it therefore collects a spread of 1 euro (fanciful figure for the example). Conversely, when a trader loses 50 euros, the pool and therefore the LP win them, but the latter loses 49 euros in his trading account; it still collects a 1 euro spread.

  • B Book: do not cover the exposure of the pools to compensate for traders’ losses.
    Most traders are losers, incentivizing LP not to hedge but rather to hold the risk. In which case, it is a zero-sum game: traders’ losses go into the pocket of the LP, and vice versa. There is no conflict of interest since LP cannot, in any case, manipulate the platform to put traders in disadvantage.
  • Dealing desk: a third option will exist, the Dealing Desk (DD).
    DD will be a complex algorithm allowing several options for the LP. For example, the algorithm will analyze users’ trading records to rank them, in order to hedge the position of winning traders (A Book) while not hedging the one of losers or of beginners (B Book). LP will have the possibility to buy users data in order to be able to classify them. However, some users would not sell their data, and since a user is anonymous and can create an unlimited number of accounts, it may be difficult to categorize them; in which case the DD will allow LP to offer threshold hedging strategies: LP would choose a threshold, ie an amount to be risked periodically (daily, weekly or monthly); until this threshold is reached, the DD will opt for B Book’s strategy; but if it is, the DD will switch the pool’s positions to an A Book strategy. This option has many advantages and many nuances which will be outlined in a future article when DD is operational.

Anyone can become a LP, by depositing collateral in DAI in an existing pool or create a new one and set rules and the strategy (A Book, B Book or DD), and if necessary connect to the price feed source’s API to cover the positions.

LPs that fail to provide sufficient liquidity, or that allow a margin call to pass, will lose the trust of users, who will probably stop trading with it.

At launch, there will be only one LP with an A Book strategy, operated by one of our subsidiaries, and providing the price of an institutional exchange in Forex and indices.

Income, spreads and commissions

There is a difference between the gross price and the one displayed on the platforms interacting with the protocol: the latter adds a default commission of 0.1% (for both side, so opening a position will cost 0.05%), included in the spread for convenience, and leaves the choice to LP to add theirs as well. LP who opt for an A Book strategy also generally charge funding fees since they are subject to them when they cover the positions.

The commissions perceived by the protocol are paid to the DAO and to the JRT holders, whose responsible for the governance by defining the rules such as the minimum deposit to become a LP, collateral accepted, source of the price feed, price policy, etc.).


Conquer the world

This protocol allows anyone in the world to speculate on any financial market in a few seconds, without the need of creating an account (subject to having Dai and a compatible wallet like MetaMask, Portis, TrustWallet etc. or Jarvis Wallet of course).

It also allows anyone in the world, an individual in Venezuela, a Japanese broker or a German hedge fund, to provide liquidity to support their local markets, and thus offer everyone access to the Japanese, German or Venezuelan markets.


Future developments

The first goal is to make this vision becoming a reality and to reach the highest level of decentralization and then open up new horizons flirting with science-fiction.

More supported collateral

At launch, only DAI will be supported. It will be subsequently deposited on Compound and Bzx (Fulcrum) to generate interests, and the protocol will accept deposits in cDAI and iDAI. Other stablecoins such as USDC will also be supported.

Our Synthetic Protocol, which is currently being developed, will allow to support collateral in almost any fiat currency, and will eventually allow to withdraw one's profits in any desired assets; it would be then possible to deposit swiss franc to trade Forex, and earn Bitcoins, euros or Tesla shares.

Besides our synthetic assets, the protocol will support other liquid tokens such as MKR or BAT, or even tokenized assets such as real estate and other Blockchain coins through the use of Ren Protocol.

Position token

Ultimately, users, traders and LP will be able to tokenize their positions, ie to issue a token tracking the value of their open positions.

We could imagine that these tokens, that would represent one or many trades, would be used as collateral to open new positions; thus, a buying position on AAPL could be used to open a buying position on TSLA. And why not imagine a money market à la Compound where we could borrow Dai against a tokenized stock portfolio. Or even to use such token to collateralize synthetic assets…


Conclusion

This first protocol, born from a crazy idea in 2017, which was to unify and make interoperable all the financial market, allow for DeFi to enter in new era since for the first time investors and traders from legacy markets will be able to taste the superior value proposition of DeFi; this protocol will allow to invite thousands of Forex and CFD traders into DeFi and set them a click away from any financial opportunities. Eventually, this protocol will further push the limit of inclusive finance and gives access to markets to virtually anyone.

Ultimately, the Margin Protocol will become a new building block for DeFi. It will allow to improve and make more scalable synthetic assets issued on UMA, Market Protocol or Synthetix by proving assets issuer with hedging tools to mimic the user experience of an Abra wallet; for projects like MelonPort, Betoken, Cotrader or Set Protocol, the tokenization of position will allow their users to speculate on legacy markets.

And of course, it will allow anyone to become a liquidity provider and have a new source of passive income.

Vsevolod.


This non-technical article describes our long-term vision and may refer to elements that are not yet developed; creating a decentralized product is a long journey that goes through different stages, and we are only at the very beginning with a non-custodial protocol; it is the bare minimum to embrace the path of decentralization; however price feed are centralized, there is only one liquidity pool and only one LP, the current backend is hosted on our servers and is close-source (the backend has been developed using a licensed software which does not allow us to open it). At the end of the trip, the price streams will be decentralized, an LP network will be in place, and the back-end will be distributed and fully open-source.


The possibilities are limitless
Join us in Discord
Find out more on Facebook
Follow us on Twitter
Discuss on our Bitcointalk
Stalk us on Instagram
And visit us at jarvis.market


Risk Warning: Investing in digital financial assets involves a high degree of risk and volatility and is not suitable for all investors; do not risk more money than you can afford to lose. Please consult an independent professional financial or legal advisor to make sure the product is right for you.

Disclaimer: This article contains text, data, graphics, photographs, illustrations and information (“Information”) connected with Jarvis International and/or other entities part of the Jarvis group ( “Jarvis”). Jarvis attempts to ensure Information is accurate, however, Information is provided “AS IS” and on an “AS AVAILABLE” basis and may not be accurate or up to date. The publication of this article does not represent solicitation by Jarvis of buying the token “Jarvis Reward Token” and is not to be considered as a recommendation by Jarvis as to the suitability of any investment, if any, herein described. No action should be taken or omitted to be taken in reliance upon Information in this document. Jarvis accepts no liability for the results of any action taken on the basis of the Information.

Jarvis Network

A set of protocols on Ethereum to make DeFi accessible by…

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store