diff --git a/README.md b/README.md index aaba2fa..d66d5de 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,15 @@ $ yarn start This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. +### Multilanguage Development(i18n) + +``` +$ yarn build +$ yarn serve +``` + +This command generates static content includes multilanguage feature(i18n).And it starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. + ### Build ``` diff --git a/docs/Concepts Explained/Basis trade.md b/docs/Concepts Explained/Basis trade.md index 3bde8c5..0a986b2 100644 --- a/docs/Concepts Explained/Basis trade.md +++ b/docs/Concepts Explained/Basis trade.md @@ -1,3 +1,74 @@ --- -sidebar_position: 5 ---- \ No newline at end of file +sidebar_position: 3 +--- +# Basis Position + + +## Introduction + +The basis position on Overlay enables users to earn yield on delta neutral positions. If a user takes a position on Overlay that earns funding, the user can hedge that position (by opening a second position of the same size on the opposite side of the market), and get paid funding rates while maintaining no/minimal market exposure. + + +> WARNING +> EXECUTING THE BASIS POSITION REQUIRES CONSTANT SUPERVISION OF POSITIONS TAKEN AND THE FUNDING RATES INVOLVED. + + + +## When is funding paid to users on Overlay Markets? + +If the open interest (OI) of long positions is greater than the OI of short positions on an Overlay market, short positions earn funding on that market. The opposite also holds true, if OI of shorts are greater than that of longs. + + +
| OI imbalance + | +Funding paid to + | +
| OIshorts > OIlongs + | +Longs + | +
| OIlongs > OIshorts + | +Shorts + | +
+Last updated on Oct 18, 2022
+ diff --git a/docs/Concepts Explained/OVL.md b/docs/Concepts Explained/OVL.md index d4284e5..b0e615f 100644 --- a/docs/Concepts Explained/OVL.md +++ b/docs/Concepts Explained/OVL.md @@ -1,3 +1,46 @@ --- -sidebar_position: 4 ---- \ No newline at end of file +sidebar_position: 2 +--- +# OVL + +OVL is the proposed native token of Overlay Protocol. It is an ERC-20 token on the Ethereum Mainnet. OVL serves a dual purpose and will be used to participate in trading and DAO governance after launch. + +OVL may be used by holders to: + + + +1. vote on governance proposals of the DAO governing Overlay Protocol +2. open positions on the markets offered on Overlay by using OVL as collateral + + +## Building Position + +To enter a position, a user of Overlay Protocol will lock OVL into the Overlay smart contract as collateral/margin. A user could leverage this collateral on either side of any market offered by Overlay. + +On closing a position, the position could either be profitable, unprofitable or at a break even. If the position is profitable, the protocol will mint OVL tokens equivalent to the delta difference of the market between build and unwind. These tokens are added to the circulating supply of OVL. + +If the position is unprofitable, the protocol burns OVL tokens of a value equivalent to the loss sustained. These tokens are removed from the circulating supply of OVL. No tokens are minted or burned in case a position is closed at a break even. + + +## Governance + +Currently, Overlay Protocol is governed by Planck Cat DAO. Members of Planck Cat DAO are issued ERC-721 tokens/NFTs depending on their contribution to the protocol. For more details on the structure of Overlay governance at this time and how one can start contributing to Planck Cat Dao, please click [here](https://www.notion.so/PlanckCat-DAO-7a3fe097aa5c4acaac2d89e142467e53). + + +> TIP +> PCD minting is live with a soft cap of 500 PCDs. Contribute to Overlay and earn CRED in order to mint a PCD. For more details, go [here](https://www.notion.so/What-is-PlanckCat-DAO-PCD-330510eae9864129aa511668a8a594c8). Hop into the [discord](https://discord.com/invite/m2U5vSr4gD) here to start contributing. + + + +In the future, OVL will be the governance token of Overlay Protocol and may be used by holders to vote on governance proposals made by the community. + +This is similar to other existing DAOs like Maker DAO, Yearn Finance, etc. that also use their respective native tokens for voting on governance proposals for functioning and decision making. + + +## Supply + +There were 8 million OVL tokens when the token was first deployed. The OVL supply, by function, is dynamic. OVL will be dynamically minted and burned by the smart contracts when positions are unwound by users. + ++Last updated on Oct 18, 2022
+ diff --git a/docs/Concepts Explained/Oracles.md b/docs/Concepts Explained/Oracles.md new file mode 100644 index 0000000..c8ca524 --- /dev/null +++ b/docs/Concepts Explained/Oracles.md @@ -0,0 +1,24 @@ +--- +sidebar_position: 5 +--- + +# Oracles + +Pricing data on Overlay markets is based on values intermittently fetched from oracles. Oracles are third-party services that help protocols get information/data (related to price data or other data) required from outside of the protocol’s smart contract ecosystem. Any tool that helps get price data about an asset is a “price oracle.” Overlay has the ability to onboard nearly any oracle, as long as the oracle feed is non-manipulable and non-predictable. + + +> TIP +> To learn more about oracles, a great place to start is the Ethereum Foundation's doc on oracles [here](https://ethereum.org/en/developers/docs/oracles/) or Chainlink's introduction [here](https://chain.link/education/blockchain-oracles). + + +The first oracle that will be used by Overlay is the Uniswap v3 TWAP oracle. Overlay markets using this oracle will use the price feed from pre-existing market pairs on Uniswap v3. Which market pairs will be onboarded as Overlay markets will be decided through governance. TWAP oracles help deter frontrunning of the oracle feed and protect the protocol from price oracle attacks. + + +> TIP +> To learn more about Uniswap v3 TWAP oracles, a great place to start is Uniswap's doc on TWAP oracles [here](https://ethereum.org/en/developers/docs/oracles/) and Chaos Labs' more accessible writeup [here](https://chaoslabs.xyz/posts/chaos-labs-uniswap-v3-twap-deep-dive-pt-1). + + +The second type of oracle to be implemented by Overlay would be Chainlink oracle feeds. Adding Chainlink feeds would help provide Overlay with the ability to offer any market/data stream available on Chainlink. This would also offer the protocol the ability to offer non-traditional markets based on data streams, like the Consumer Price Index (CPI), a metric for the level of inflation. Adding Chainlink oracles and other markets are a governance decision. + ++Last updated on Oct 18, 2022
diff --git a/docs/Concepts Explained/Oracles/Chainlink.md b/docs/Concepts Explained/Oracles/Chainlink.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/Concepts Explained/Oracles/Uni V3 TWAP.md b/docs/Concepts Explained/Oracles/Uni V3 TWAP.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/Concepts Explained/Trading on Overlay explained.md b/docs/Concepts Explained/Trading on Overlay explained.md deleted file mode 100644 index deadfb1..0000000 --- a/docs/Concepts Explained/Trading on Overlay explained.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -sidebar_position: 3 ---- \ No newline at end of file diff --git a/docs/Concepts Explained/What is the protocol.md b/docs/Concepts Explained/What is the protocol.md deleted file mode 100644 index ef0119d..0000000 --- a/docs/Concepts Explained/What is the protocol.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -sidebar_position: 1 ---- \ No newline at end of file diff --git a/docs/Contracts/Contract Addresses.md b/docs/Contracts/Contract Addresses.md new file mode 100644 index 0000000..a158666 --- /dev/null +++ b/docs/Contracts/Contract Addresses.md @@ -0,0 +1,83 @@ +# Contract Addresses + + + +> INFO +> Overlay Protocol is currently only available to participants in the gated and sandboxed Litter Box 1 program. The OVL token is NOT available on any exchanges as of now, nor have any liquidity pools been deployed. To learn more about Litter Box 1, please check out our blog post, available here. + + + + +## OVL Token + +The OVL token is deployed on the Ethereum mainnet, and is meant only for the sandboxed and gated Litter box 1 program at this point in time. The OVL token address on Ethereum mainnet is [0xdc77acc82cce1cc095cba197474cc06824ade6f7](https://etherscan.io/address/0xdc77acc82cce1cc095cba197474cc06824ade6f7#code). + + +## Overlay Smart Contracts + +Overlay smart contracts are currently deployed only on the Ethereum mainnet exclusively for testing purposes. + + +| Contract + | +Address + | +
| OverlayV1Factory + | +0x9a74758c2A80fA1B1d899E0E1f24CF505a4Dea33 + | +
| OverlayV1State + | +0x477122219aa1F76E190f480a85af97DE0A643320 + | +
| OverlayV1Market + | +0x7f72986e190BBd1D02daC52b8DdA82eEa363d313 + | +
| OverlayV1NoReserveUniswapV3Factory + | +0x40a9C6E8d60bE1CE297Bef6a9aC3337d45193D87 + | +
| OverlayV1NoReserveUniswapV3Feed ETH/USDC (0.05%) + | +0xFFDd8e8D16AEd8CadF4b46DcAf4Ba620Dc269De1 + | +
+Last updated on Oct 18, 2022
+ + + diff --git a/docs/Contribute/Contributor tools.md b/docs/Contribute/Contributor tools.md deleted file mode 100644 index ef0119d..0000000 --- a/docs/Contribute/Contributor tools.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -sidebar_position: 1 ---- \ No newline at end of file diff --git a/docs/Contribute/Documentation.md b/docs/Contribute/Documentation.md deleted file mode 100644 index d4284e5..0000000 --- a/docs/Contribute/Documentation.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -sidebar_position: 4 ---- \ No newline at end of file diff --git a/docs/Contribute/Governance/Foundation.md b/docs/Contribute/Governance/Foundation.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/Contribute/Governance/How governance works.md b/docs/Contribute/Governance/How governance works.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/Contribute/Governance/PlanckCat DAO.md b/docs/Contribute/Governance/PlanckCat DAO.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/Contribute/Governance/_category_.json b/docs/Contribute/Governance/_category_.json deleted file mode 100644 index 5738dcf..0000000 --- a/docs/Contribute/Governance/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 3, - "collapsible": true, - "collapsed": false - } \ No newline at end of file diff --git a/docs/Contribute/Operations.md b/docs/Contribute/Operations.md deleted file mode 100644 index fb78fd4..0000000 --- a/docs/Contribute/Operations.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -sidebar_position: 2 ---- \ No newline at end of file diff --git a/docs/Contribute/_category_.json b/docs/Contribute/_category_.json deleted file mode 100644 index 60910a0..0000000 --- a/docs/Contribute/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 7, - "collapsible": true, - "collapsed": true - } \ No newline at end of file diff --git a/docs/Getting Started/Communication channels.md b/docs/Getting Started/Communication channels.md index d4284e5..0b34276 100644 --- a/docs/Getting Started/Communication channels.md +++ b/docs/Getting Started/Communication channels.md @@ -1,3 +1,12 @@ --- sidebar_position: 4 ---- \ No newline at end of file +--- +Official Communication Channels (Beware of Scams - these are the only official channels for Overlay Protocol) + +**Discord: _[https://discord.gg/m2U5vSr4gD](https://discord.gg/m2U5vSr4gD)_** + +**Twitter: _[https://twitter.com/OverlayProtocol](https://twitter.com/OverlayProtocol)_** + +**Governance Forum:_ https://commonwealth.im/overlay/_** + +**Deprecated:** Telegram channel diff --git a/docs/Getting Started/Governance.md b/docs/Getting Started/Governance.md index deadfb1..9be44ed 100644 --- a/docs/Getting Started/Governance.md +++ b/docs/Getting Started/Governance.md @@ -1,3 +1,14 @@ ---- -sidebar_position: 3 ---- \ No newline at end of file + +# Governance + +As of today, Overlay Protocol is governed by Planck Cat DAO, a DAO for Overlay contributors to participate in the protocol governance via PlanckCat (PCD) NFT’s. +Discussions are currently being had about OVL taking the place of governance. These discussions will be had in the appropriate channels on Discord and Forum. + +1 PCD NFT equals one vote and PCD NFT holders can vote for governance proposals on [Snapshot](https://snapshot.org/#/planckcatdao.eth). Moreover, any PCD NFT holder can start a discussion on both [Overlay Discord](http://discord.gg/m2U5vSr4gD) and/or the [Forum](https://gov.overlay.market/), and then after a temperature check, can open a governance proposal on Snapshot. + +PlanckCat DAO can and will decide on what markets will be listed or delisted on the protocol, as well as set protocol risk parameters which will dictate the experience for all users. + +Non-PCD NFT holders can still get involved with discussions on Discord and the Governance Forum. + + +If community members want to actively participate in governance,they must earn an NFT by contributing to Overlay Protocol. Participation is judged by community members, and contributors are rewarded with Cred. As of today, community members must collect 1000 Cred to claim one PCD NFT. The soft cap supply of the PCD NFT is currently set to 500. More NFT’s can be minted on a one off basis once the 500 limit has been set. diff --git a/docs/Getting Started/Token addresses.md b/docs/Getting Started/Token addresses.md deleted file mode 100644 index 3bde8c5..0000000 --- a/docs/Getting Started/Token addresses.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -sidebar_position: 5 ---- \ No newline at end of file diff --git a/docs/Getting Started/Using Overlay/High-level concept.md b/docs/Getting Started/Using Overlay/High-level concept.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/Getting Started/Using Overlay/Step by step walkthrough.md b/docs/Getting Started/Using Overlay/Step by step walkthrough.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/Getting Started/Using Overlay/Video walkthrough.md b/docs/Getting Started/Using Overlay/Video walkthrough.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/Getting Started/Using Overlay/_category_.json b/docs/Getting Started/Using Overlay/_category_.json deleted file mode 100644 index 13e6dd9..0000000 --- a/docs/Getting Started/Using Overlay/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 2, - "collapsible": true, - "collapsed": false - } \ No newline at end of file diff --git a/docs/Guides/Get OVL.md b/docs/Guides/Get OVL.md deleted file mode 100644 index ef0119d..0000000 --- a/docs/Guides/Get OVL.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -sidebar_position: 1 ---- \ No newline at end of file diff --git a/docs/Guides/Trade on Overlay (how to).md b/docs/Guides/Trade on Overlay (how to).md deleted file mode 100644 index fb78fd4..0000000 --- a/docs/Guides/Trade on Overlay (how to).md +++ /dev/null @@ -1,3 +0,0 @@ ---- -sidebar_position: 2 ---- \ No newline at end of file diff --git a/docs/Guides/Video guides.md b/docs/Guides/Video guides.md deleted file mode 100644 index deadfb1..0000000 --- a/docs/Guides/Video guides.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -sidebar_position: 3 ---- \ No newline at end of file diff --git a/docs/Guides/_category_.json b/docs/Guides/_category_.json deleted file mode 100644 index f129621..0000000 --- a/docs/Guides/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 3, - "collapsible": true, - "collapsed": true - } \ No newline at end of file diff --git a/docs/Introduction.md b/docs/Introduction.md index 0815e40..7115b23 100644 --- a/docs/Introduction.md +++ b/docs/Introduction.md @@ -3,4 +3,60 @@ slug: / sidebar_position: 1 --- -Welcome to the Overlay Documentation Center! \ No newline at end of file +# Introduction to Overlay + + +## What is Overlay? + +Overlay Protocol is a decentralized platform built on Ethereum, and offers users the ability to build positions on a market or data stream without traditional counterparties (liquidity providers or market makers) taking the other side of the position. Ideally, the protocol will offer markets based on (i) price data feeds and (ii) non-manipulable & non-predictable data feeds. + + + +> INFO +> For a deep dive into Overlay Protocol, please refer to our white paper [here](https://planckcat.mypinata.cloud/ipfs/QmVMX7DH8Kh22kxMyDFGUJcw1a3irNPvyZBtAogkyJYJEv). + + + + +## Types of markets + +Overlay aims to offer several types of markets, based on price data feeds and non-manipulable & non-predictable data feeds. These include: + + + +* non-traditional crypto markets such as markets letting users build positions on hash rate, gas, BTC difficulty, NFT floors, social tokens, yield rates, etc. +* non-traditional markets such as e-sports & sports, sneaker prices, scalar social-political markets, nature and science markets, etc. +* traditional crypto markets +* And the list goes on + + +## How does Overlay offer markets without counterparties? + +Users build positions against the entire protocol itself, or perhaps most tellingly: against every other OVL holder simultaneously. This enables Overlay markets to have deep liquidity without the need for liquidity providers or traditional swap-based counterparties (including market makers). To read more about how the protocol negates the potential OVL inflation risk from this mechanism, please refer to this write-up. + + +## Pricing based on oracle feeds + +Pricing on Overlay markets is not dynamic in the traditional sense; it is based on values intermittently fetched from oracles. These oracle values are then adjusted by certain mechanisms built-in to the protocol (for more details, please see our article on Pricing on Overlay). Overlay has the ability to onboard nearly any oracle, as long as the oracle feed is non-manipulable and non-predictable. + + ## How does trading work (Collateral and PnL)? + +Users would be required to lock OVL as collateral to a position in an Overlay market. PnL is settled in OVL. OVL is minted by the protocol and sent to the user as PnL if a position is in profit; on the other hand, if the position is at a loss, locked OVL is burned (to the extent of the loss). + + +## OVL + +OVL is the proposed native token of Overlay Protocol. It is an ERC-20 token on the Ethereum Mainnet. OVL serves a dual purpose and will be used to participate in trading and DAO governance after launch. OVL acts as liquidity and governance in the Overlay system - all PnL for users is denominated in OVL, creating a flywheel effect where utility, liquidity and community incentives are fed back into the system. For more on OVL, please refer to our section on OVL here. + + +## Nature of Contracts entered by users + +Positions on Overlay Protocol resemble perpetual futures contracts (perps) - similar to perps, the contracts keep rolling over, with no expiration date or actual settlement. However, contracts offered on Overlay markets have several key features differing from conventional perps. For more on this, please refer to our section on this. + + +> DISCLAIMER +> Building positions can result in financial loss, especially with the use of leverage. Do your research about Overlay Protocol and the markets it offers before deploying your resources. A good rule of thumb is to not build positions with more than you can afford to lose. Overlay Protocol is a nascent and untested technology. While measures have been taken to secure the code/network/protocol, that does not ensure real funds cannot be lost. + + ++Last updated on Oct 18, 2022
diff --git a/docs/Resources/_category_.json b/docs/Resources/_category_.json deleted file mode 100644 index 5de9a08..0000000 --- a/docs/Resources/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 8, - "collapsible": true, - "collapsed": true - } \ No newline at end of file diff --git a/docs/Risks/Summary of risks.md b/docs/Risks/Summary of risks.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/Risks/_category_.json b/docs/Risks/_category_.json deleted file mode 100644 index f2caac3..0000000 --- a/docs/Risks/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 6, - "collapsible": true, - "collapsed": true - } \ No newline at end of file diff --git a/docs/Security/Risks.md b/docs/Security/Risks.md index e69de29..628c9c9 100644 --- a/docs/Security/Risks.md +++ b/docs/Security/Risks.md @@ -0,0 +1,69 @@ +# Summary of risks + +## I. Inflation risk + +Overlay settles all PnL in its native token OVL - OVL is used as collateral to open a position, it’s minted to pay out profits, and is burned in case of a loss. Thus, the primary risk the protocol faces is risk of excessive inflation of OVL. This risk is managed through a range of mechanisms, detailed below. + +### A. Funding payments + +While other perpetual futures platforms charge funding to bring the contract price and spot price closer in case of a deviation, Overlay charges funding based on the imbalance of open interest between longs and shorts. Overlay does not require funding to reduce the basis (deviation between contract and spot price) as price is intermittently fetched from oracles. + +For example, if there are more longs than shorts, then longs pay funding to shorts. Since the size of the open interest imbalance is potential inflation risk for the protocol, funding payments are used to incentivize users to reduce this imbalance + +### B. Caps + +The protocol limits PnL or addition of new positions to mitigate inflation risk when and where necessary, based on risk parameters set by governance. The risk parameters through which this is achieved are detailed below: + +- Payoff caps: Overlay will have a per-position payoff cap that will limit the PnL of each position on the protocol; this cap will be determined by the community/DAO through a formal governance process for each market. This will help the protocol limit inflation risk from the trading of heavy tail assets. +- Open interest caps: OI caps will be imposed on the aggregate open interest for the long and short sides to limit the amount of position contracts an Overlay market is willing to take on at any point in time. The payoff cap does not work without an OI cap as it is trivial for a user to open several small positions to undermine the payoff cap. +- Circuit breakers: Together, payoff caps and open interest caps limit the amount the market can print on any single position. Circuit breakers take this a step further by limiting the amount the market can print over multiple positions in a given period of time. When an excess amount of OVL has been printed in the recent past, the possible notional size of new positions offered is significantly reduced for an period of time to cool down the market, and bring the rate of inflation in a particular market in line with the protocol’s expected inflation level. + +### C. Liquidations + +Loss making positions that have reached the liquidation threshold are liquidatable by anyone who calls the liquidate function on the market contract. The liquidator earns a reward for doing this. Some of the OVL loss incurred by the user is burnt, and some is sent to the fee repo. + +A key point to note is that risk parameters associated with the above features are set by Overlay governance. So, it is up to token holders to decide the balance between inflation risk vs increased potential volumes and platform usage. On one end of the spectrum, the risk parameters can be tuned so strictly as to inhibit all trading volume for zero inflation risk. On the other end of the spectrum, they can be tuned so loose as to enable large trading volumes but with significant risk of inflation. + +## II. Smart Contract Risk + +The deterministic nature of smart contracts is a huge positive for transparency, but also makes them prone to vulnerabilities. Changes to the smart contract are usually not possible after deployment, unless such capabilities are incorporated during the creation of the smart contract (which creates a different nature of risk). + +If there are errors/bugs in the code, this may cause the protocol to be unusable. Bugs may even open up the protocol to attacks from bad actors, potentially leading to a loss of funds. While the risk stemming from smart contracts can be mitigated through audits and testing, there is still a risk of errors/bugs persisting. + +Overlay has undergone two comprehensive audits: Spearbit and Least Authority. For more details on Overlay’s audits, read about them here. + +## III. Smart contract control/access + +If access to the smart contract is not implemented correctly, this can lead to a vulnerability that then may be exploited to gain control of the smart contract. This puts the protocol and the funds in the smart contract at risk. + +## IV. Oracle Risk + +Pricing data on Overlay markets is based on values intermittently fetched from oracles. Oracles are third-party services that help protocols get information/data (related to price data or other data) required from outside of the protocol’s smart contract ecosystem. Any tool that helps get price data about an asset is a “price oracle.” Overlay has the ability to onboard nearly any oracle, as long as the oracle feed is non-manipulable and non-predictable. + +There is sometimes a time delay between manipulation-resistant information available at the current time and the actual most recent value of the data stream. That is, the price feed of the oracle may not be up to date with the actual price at any given point of time. This latency can be exploited to turn a profit by frontrunning users. Frontrunning is an issue especially on the Ethereum mainnet. + +Several crypto exploits have focused on corrupting oracle data through manipulation of the oracle price feeds. This can lead to large gains for exploiters on another platform using the corrupted oracle data. Such attacks usually involve flash loans to manipulate oracle data and are completed within the same block (due to the nature of flash loans). + +Overlay attempts to mitigate oracle risks by implementing the following features: + +### A. Time Weighted Average Price (TWAP) + +TWAP or “Time-Weighted Average Price” is the average price of an asset over a certain time period. TWAP price is often used by market participants in traditional markets and crypto to execute large orders (in chunks) while minimizing market impact. + +Using TWAPs instead of spot prices as a price oracle is common practice in DeFi. TWAPs make oracle manipulation attacks significantly more expensive and cumbersome. This is because TWAP feeds require that attacks be sustained across multiple blocks, which is extremely expensive to do and can generally not be executed through flash loans - such an attack would require an attacker to put up real liquidity. + +### B. Bid-ask spread + +A bid-ask spread refers to the difference or “spread” in the price between which an asset can be bought or sold at any given particular point of time. In traditional exchanges (based on the CLOB model), this can be thought of as the difference between the highest price a buyer is willing to pay and the lowest price a seller is offering. + +Overlay introduces a static spread between bid and ask prices in order for users to not profit from the latency inherent in a TWAP price feed (since it is the average of the price over a certain period of time). + +### C. Market impact + +Market impact is the change in price of an asset due to the execution of a particular position. Price Impact is generally a function of liquidity in a market - the more liquid a market, the less the price impact would be for the same size of position. + +Large positions on Overlay markets suffer slippage, emulating a real market and severely limiting the potential profit of attackers (as compared to Overlay markets where market impact was not emulated). This market impact is determined by a combination of a per-market price impact constant (which could be changed for any market in governance) and the cumulative open interest on the ask/bid side in a rolling time window. Thus, price impact on Overlay is added to bid and ask prices based on the size of the order and a per-market impact constant. + +### D. Spot price manipulation + +Wherever applicable, such as when the price oracle is a Uniswap v3 oracle, the protocol keeps track of liquidity and price movements in the pool and adjusts its risk parameters accordingly. diff --git a/docs/Security/Security assumptions.md b/docs/Security/Security assumptions.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/Security/Third party audits.md b/docs/Security/Third party audits.md index e69de29..168afae 100644 --- a/docs/Security/Third party audits.md +++ b/docs/Security/Third party audits.md @@ -0,0 +1,101 @@ +# Smart Contract Audits + +Overlay’s v1 contracts have been audited twice, at first by [Spearbit](https://spearbit.com/) and then [Least Authority](https://leastauthority.com/). + +| Auditor + | +Date + | +Report + | +
| Spearbit + | +May 5 2022 + | +Spearbit Overlay Security Review + | +
| Least Authority + | +June 8 2022 + | +Least Authority Security Audit Report + | +
| Type + | +Number of Issues + | +Status + | +
| Critical Risk + | +0 + | +- + | +
| High Risk + | +2 + | +Fixed + | +
| Medium Risk + | +2 + | +Fixed + | +
| Low Risk + | +5 + | +Fixed + | +
| OI 失衡 + | +资金支付给 + | +
| OI空头 > OI多头 + | +多头 + | +
| OI多头 > OI空头 + | +空头 + | +
+Last updated on Oct 18, 2022
+ diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/Concepts Explained/OVL.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Concepts Explained/OVL.md new file mode 100644 index 0000000..16c937f --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Concepts Explained/OVL.md @@ -0,0 +1,46 @@ +--- +sidebar_position: 4 +--- +# OVL + +OVL是Overlay Protocol提出的原生代币。它是以太坊主网上的ERC-20代币。 OVL具有双重作用,将在发布后用于参与交易和DAO治理。 + +持有者可以使用OVL进行以下操作: + + + +1. 投票支持治理Overlay Protocol的DAO提案 +2. 使用OVL作为抵押品在Overlay上开设头寸 + + +## 建立头寸 + +要进入头寸,Overlay Protocol的用户将OVL作为抵押品/保证金锁定到Overlay智能合约中。用户可以在Overlay提供的任何市场的任一方利用此抵押品进行杠杆操作。 + +在平仓头寸时,头寸可能是盈利、亏损或持平的。如果头寸盈利,协议将铸造与头寸及市场差额等价的OVL代币。这些代币将添加到OVL的流通供应中。 + +如果头寸亏损,协议将烧毁相当于所遭受损失的OVL代币价值。这些代币将从OVL的流通供应中移除。如果头寸持平,将不会铸造或烧毁任何代币。 These tokens are removed from the circulating supply of OVL. No tokens are minted or burned in case a position is closed at a break even. + + +## 治理 + +目前,Overlay Protocol由Planck Cat DAO治理。 Planck Cat DAO的成员将根据其对协议的贡献获发ERC-721代币/NFT。请点击[此处](https://www.notion.so/PlanckCat-DAO-7a3fe097aa5c4acaac2d89e142467e53),了解当前Overlay治理结构的更多详细信息以及可以如何为Planck Cat Dao做出贡献的详细信息。 + + +> 提示 +> PCD铸造已上线,软顶为500个PCD。为Overlay做出贡献并赚取CRED以铸造PCD。有关更多详细信息,请点击[此处](https://www.notion.so/What-is-PlanckCat-DAO-PCD-330510eae9864129aa511668a8a594c8)。单击此处进入[Discord](https://discord.com/invite/m2U5vSr4gD)开始做出贡献。 + + + +将来,OVL将成为Overlay Protocol的治理代币,并且持有者可以使用它来投票支持社区提出的治理提案。 + +这与其他现有的DAO(如Maker DAO,Yearn Finance等)类似,它们也使用各自的原生代币投票决定治理提案以实现Overlay运作和决策。 + + +## 供给 + +代币首次部署时,OVL代币有800万枚。 OVL供给是动态的。当用户解除头寸时,智能合约将动态铸造和销毁OVL。 + ++Last updated on Oct 18, 2022
+ diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/Concepts Explained/Oracles.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Concepts Explained/Oracles.md new file mode 100644 index 0000000..bc227b8 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Concepts Explained/Oracles.md @@ -0,0 +1,20 @@ +# Oracles + +Overlay市场的价格数据是基于从预言机间歇性获取的数值。预言机是帮助协议从智能合约生态外获取所需信息/数据(与价格数据或其他数据有关)的第三方服务。任何帮助获取资产价格数据的工具都是“价格预言机”。只要数据源是不可操纵和不可预测的,Overlay就有能力接入几乎任何预言机。 + + +> 提示 +> 要了解更多关于预言机的信息,可以访问以太坊基金会的预言机[文档](https://ethereum.org/en/developers/docs/oracles/)或Chainlink的[介绍](https://chain.link/education/blockchain-oracles)。 + + +Overlay将使用的第一个预言机是Uniswap v3 TWAP预言机。使用此预言机的Overlay市场将使用Uniswap v3上现有交易对的价格数据。哪些交易对会上线Overlay市场将由治理决定。TWAP预言机有助于防止对预言机数据源的抢先交易(frontrunning),保护协议免受价格预言机的攻击。 + + +> 提示 +> 要了解更多关于Uniswap v3 TWAP预言机的信息,可以从Uniswap的TWAP预言机[文档](https://ethereum.org/en/developers/docs/oracles/) 或Chaos Labs的更通俗易懂的[文章](https://chaoslabs.xyz/posts/chaos-labs-uniswap-v3-twap-deep-dive-pt-1)开始。 + + +Overlay将实施的第二种预言机类型是Chainlink预言机数据源。添加Chainlink预言机源将有助于Overlay提供Chainlink上可用的任何市场/数据流的能力。这也将允许协议提供基于数据流的非传统市场,例如消费者价格指数(CPI),即通货膨胀水平的衡量标准。同样的,添加Chainlink预言机源和其他市场是社区治理决定。 + ++Last updated on Oct 18, 2022
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/Contracts/Contract Addresses.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Contracts/Contract Addresses.md new file mode 100644 index 0000000..4de3c0e --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Contracts/Contract Addresses.md @@ -0,0 +1,82 @@ +# 合约地址 + + + +> 相关信息 +> Overlay协议目前仅限沙盒环境的Litter Box 1项目的参与者使用。截至目前,OVL代币未在任何交易所上线,也未部署任何流动性池。要了解有关Litter Box 1的更多信息,请查看我们的博客文章。 + + + + +## OVL代币 + +OVL代币已部署在以太坊主网和Arbitrum主网上,两个主网的的OVL代币地址分别为[0xdc77acc82cce1cc095cba197474cc06824ade6f7](https://etherscan.io/address/0xdc77acc82cce1cc095cba197474cc06824ade6f7#code)和[0x4305C4Bc521B052F17d389c2Fe9d37caBeB70d54](https://arbiscan.io/address/0x4305C4Bc521B052F17d389c2Fe9d37caBeB70d54)。 + +## Overlay智能合约 + +Overlay智能合约目前仅部署在以太坊主网和Arbitrum主网上。 + + +| 合约 + | +合约地址 + | +
| OverlayV1Factory + | +0x9a74758c2A80fA1B1d899E0E1f24CF505a4Dea33 + | +
| OverlayV1State + | +0x477122219aa1F76E190f480a85af97DE0A643320 + | +
| OverlayV1Market + | +0x7f72986e190BBd1D02daC52b8DdA82eEa363d313 + | +
| OverlayV1NoReserveUniswapV3Factory + | +0x40a9C6E8d60bE1CE297Bef6a9aC3337d45193D87 + | +
| OverlayV1NoReserveUniswapV3Feed ETH/USDC (0.05%) + | +0xFFDd8e8D16AEd8CadF4b46DcAf4Ba620Dc269De1 + | +
+Last updated on Oct 18, 2022
+ + + diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/Getting Started/Communication channels.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Getting Started/Communication channels.md new file mode 100644 index 0000000..d281e54 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Getting Started/Communication channels.md @@ -0,0 +1,12 @@ +--- +sidebar_position: 4 +--- +官方沟通渠道(谨防诈骗 - 以下是Overlay协议仅有的官方渠道) + +**Discord: _[https://discord.gg/m2U5vSr4gD](https://discord.gg/m2U5vSr4gD)_** + +**Twitter: _[https://twitter.com/OverlayProtocol](https://twitter.com/OverlayProtocol)_** + +**治理论坛: _https://commonwealth.im/overlay/_** + +**停用:** Telegram channel diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/Getting Started/Governance.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Getting Started/Governance.md new file mode 100644 index 0000000..35d10fb --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Getting Started/Governance.md @@ -0,0 +1,22 @@ + +# 治理 + +截至今日,Overlay协议由Planck Cat DAO管理,这是一个允许Overlay贡献者通过PlanckCat(PCD)NFT参与协议治理的DAO。目前正在讨论治理权是否替代为OVL代币。这些讨论将在Discord和论坛的相关频道中进行。 + +1个PCD NFT等于1票,持有PCD NFT的人可以在[Snapshot](https://snapshot.org/#/planckcatdao.eth)上投票支持治理提案。此外,任何PCD NFT持有者都可以在[Overlay的Discord](http://discord.gg/m2U5vSr4gD)和/或[论坛](https://gov.overlay.market/)上发起讨论,并在经过初步沟通后,在Snapshot上发起治理提案。 + +PlanckCat DAO可以并且将决定哪些市场将在协议上架或者下架,以及设置协议风险参数,这将决定所有用户的体验。 + +非PCD NFT持有者仍然可以参与在Discord和治理论坛上的讨论。 + + +如果社区成员希望积极参与治理,他们必须通过为Overlay协议做出贡献来获得NFT。参与由社区成员评判,贡献者将获得Cred奖励。截至今日,社区成员必须获得1000个Cred才能获得一个PCD NFT。PCD NFT的软顶限额目前设置为500。一旦达到500的限额,可以一次性铸造更多的NFT。 + + + + + + + + + diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/Introduction.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Introduction.md new file mode 100644 index 0000000..f8569b8 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Introduction.md @@ -0,0 +1,62 @@ +--- +slug: / +sidebar_position: 1 +--- + +# Overlay产品介绍 + + +## Overlay是什么? + +Overlay协议是建立在以太坊上的去中心化平台,为用户提供在无需传统的交易对手(流动性提供者或做市商)来承担对手盘情况之下,依旧能在市场或数据流中建立头寸的能力。理想情况下,该协议将提供基于以下两点的衍生品市场(i)价格数据源和(ii)不可操纵且不可预测的数据源。 + + + +> 额外信息 +> 请参阅我们的[白皮书](https://planckcat.mypinata.cloud/ipfs/QmVMX7DH8Kh22kxMyDFGUJcw1a3irNPvyZBtAogkyJYJEv)进一步了解Overlay协议的相关细节。 + + + + +## 交易市场类型 + +Overlay致力于提供基于价格数据源和不可操纵且不可预测的数据源之上的多种类型的交易市场。这些包括: + + + +* 非传统的加密货币市场,如让用户基于哈希率、矿工费、BTC 难度、NFT 地板价、社交代币、收益率等建立头寸 +* 非传统市场,如电子竞技和体育、运动鞋价格、标量社会政治市场、自然和科学市场等 +* 传统的加密货币市场 +* 更多其它交易市场类型 + + +## Overlay如何在没有交易对手的情况下提供交易市场? + +用户建立头寸的交易对手方是整个协议本身,或者也可以说是其它所有的OVL持有者。这使得Overlay市场在无需流动性提供者或传统的基于掉期交易(Swap)的交易对手(包括做市商)依旧能具有深度流动性。如需了解更多有关本协议如何避免此机制所带来的潜在OVL通胀风险,请参阅此篇文章。 + + +## 基于预言机数据源的定价模式 + +Overlay市场的定价不是传统意义上的动态定价,而是基于Oracle预言机喂送的数据。然后,这些预言机数值会通过协议内置的特定机制进行调整(请参阅我们Overlay定价的文章了解更多详情)。只要预言机数据源是不可操纵且不可预测的,Overlay几乎可以适配相关预言机。 + + ## 交易是如何运作的(抵押和盈亏)? + +用户需要将OVL作为抵押物锁定在Overlay市场头寸中。盈亏也以OVL结算。如果头寸获利,协议将铸造OVL并发放给用户;另一方面,如果头寸亏损,锁定的OVL将被销毁(直至亏损额度)。 + + +## OVL + +OVL是Overlay协议提出的原生代币,为以太坊主网上的ERC-20代币。OVL具有双重作用,将在正式发布后可用于参与交易以及DAO治理。OVL在Overlay体系中充当流动性和治理的作用——所有用户的盈亏以OVL计价,将实用性、流动性和社区激励反馈到系统中,从而产生飞轮效应。请参阅我们有关OVL的部分了解OVL的更多信息。 + + +## 用户进入的合约的本质 + +在Overlay协议上建立的头寸类似于永续合约(perps)- 类似于perps,该合约会不断滚动,没有到期日或实际结算。然而,Overlay市场上提供的合约与传统perps有几个不同的关键点。请参阅我们有关此问题的部分了解更多信息。 + + +> 免责声明 +> 建立头寸可能会导致财务损失,特别是在使用杠杆的情况下。在使用之前,请研究Overlay协议和其提供的市场。一般来说,不要建立超出自己负担范围的头寸。Overlay协议是一项创新性的,未经测试的新技术。虽然已采取各种措施确保代码/网络/协议的安全性,但这并不能确保真实资金不会损失。 + + ++Last updated on Oct 18, 2022
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/Security/Risks.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Security/Risks.md new file mode 100644 index 0000000..6d3b22d --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Security/Risks.md @@ -0,0 +1,80 @@ +# 风险概述 + +## I. 通胀风险 + +Overlay协议使用原生代币OVL结算所有的PnL,OVL作为建仓的抵押品,在赢利时被铸造,而在亏损时被销毁。因此,该协议面临的主要风险是OVL通胀过度。该风险通过以下一系列机制来管理。 + +### A.资金费用 + +一般而言,其他永续合约平台通过收取资金费用来平衡合约价格和现货价格的差异,而Overlay则基于多空持仓之间的差别收取资金费用。由于Overlay从预言机获取价格,因此不需要通过资金费用来减少基差(合约价格和现货价格之间的差异)。 + +例如,如果多头持仓比空头多,那么多头将向空头支付资金费用。由于多空持仓之间不平衡的程度导致协议的潜在通货膨胀风险,因此资金费用会用于激励用户减少此不平衡。 + +### B.上限 + +该协议在需要的时候会通过限制PnL或增加新仓位来避免通胀风险,具体则取决于由DAO治理设置的风险参数。以下是相关风险参数的细节: + +- 收益上限:Overlay将设定每个仓位的收益上限,以限制该协议中每个仓位的PnL;此上限将由社区/DAO通过官方的治理流程为每个市场制定。这将有助于该协议限制长尾资产交易的通胀风险。 +- 未平仓量(OI)上限:OI上限将被强制执行,以限制Overlay市场可承担的仓位数量。如若没有OI上限,收益上限不会有效,因为用户可以打开多个小仓位来规避收益上限。 +- 熔断机制:收益上限和OI上限共同限制市场在任何单个仓位上可以铸造的代币数量。熔断机制则进一步限制了市场在给定时间内由于多个仓位需要铸造的数量。当近期铸造的OVL数量超过预期时,可创建的新仓位的规模将被显著降低一段时间,以冷却市场,并将特定市场的通胀率带回与该协议预期的通胀相一致的水平。 + +### C. 清算 + +达到清算阈值的亏损头寸可以被任何调用合约上清算函数的人进行清算,并且清算者会获得奖励。用户遭受的 OVL 亏损中的一部分会被销毁,而另一部分会被存到费用资金库。 + +需要注意的一点是,与上述功能相关的风险参数都由 Overlay 治理机构设置。因此,决定通货膨胀风险与平台潜在交易量之间的平衡取决于代币持有人。在一个极端下,风险参数太过严格,虽然实现了零通膨风险,但也抑制了所有交易量。在另一端,风险参数设置的过于松散,虽然实现了大规模交易量,但却伴随着重大的通货膨胀风险。 + +## II. 智能合约风险 + +智能合约不可篡改的特性对于透明度来说是极好的,但同时也使它们更脆弱。除非相关的功能在智能合约创建时就被纳入(这会导致其它不同类型的风险),通常智能合约在部署后无法修改。 + +如果代码中存在错误/漏洞,可能会导致无法使用该协议。漏洞甚至可能导致协议暴露在黑客的攻击下,进而导致可能的资金损失。虽然智能合约带来的风险可以通过审核和测试进行缓解,但仍然存在错误/漏洞风险。 + +Overlay已经通过了两次全面的审计:分别为Spearbit和Least Authority。有关Overlay的审计的更多详细信息,请在这里了解。 + +## III. 智能合约控制/访问 + +如果没有正确实施对智能合约的访问,这可能被恶意利用,从而导致被夺取智能合约的控制权。这会使协议和智能合约中的资金处于风险之中。 + +## IV. 预言机风险 + +Overlay市场的价格数据基于从预言机间接性获取的数值。预言机是帮助协议从智能合约生态系统之外获取所需的信息/数据(涉及价格数据或其他数据)的第三方服务。任何帮助获取资产价格数据的工具都是“价格预言机”。Overlay就能接入几乎任何预言机,只要预言机提供的信息流是不可操控且不可预测的。 + +有些时候,在当前时间可用的数据和数据流的实际最新数值之间存在一定的时间延迟。也就是说,预言机的价格可能没有及时反应最新的实际价格。这种延迟可以被抢先交易(frontrunning)用户滥用获利。抢先交易在以太坊主网上是一个更为明显的问题。 + +几种加密攻击都集中于通过操作预言机价格提供来破坏预言机数据。这可能会导致攻击者在使用了被破坏的预言机数据的另一个平台上获得巨额收益。这些攻击通常涉及闪电贷来操纵预言机数据,并且在同一区块内完成(闪电贷的本质)。 + +Overlay通过实现以下功能来缓解预言机风险: + +### A. 时间加权平均价格(TWAP) + +TWAP或“时间加权平均价格”是资产在一定时间段内的平均价格。 TWAP价格通常由传统市场和加密市场参与者用于在最小化市场影响的同时执行大额订单(分批次)。 + +在DeFi中,使用TWAP而不是现货价格作为价格预言机是一种常见做法。 TWAP使预言机操纵攻击变得显著的更昂贵及繁琐。这是因为TWAP数据需要在多个区块中持续进行攻击,这是非常昂贵的,并且通常不能通过闪电贷来执行此攻击 - 这种攻击需要攻击者提供实际流动性。 + +### B. 买卖价差 + +买卖价差是在任何特定时间点可以买入或卖出资产的价格之间的差异或“价差”。在传统交易所(基于CLOB模型)中,这可以被视为买家愿意支付的最高价格和卖家提供的最低价格之间的差异。 + +Overlay在买价和卖价之间引入了一个固定价差,以便用户无法从TWAP价格预言机固有的延迟中获利(因为它是在一定时间段内的价格平均值)。 + +### C. 市场影响 + +市场影响是由于执行特定头寸而导致资产价格的变化。价格影响通常是市场流动性的一个函数-市场流动性越强,相同规模头寸带来的价格影响越小。 + +Overlay市场上的大额头寸会受到滑点的影响,其模拟真实市场的方式能大幅限制攻击者的潜在利润(与Overlay市场如果不模拟市场影响的情况相比)。这种市场影响是由1.滚动时间窗口中的买/卖一方的累积未平仓合约和2.每个市场的价格影响常数的组合确定的(其中价格影响常数可通过DAO治理更改)。因此,在Overlay上,根据订单大小和每个市场的影响常数,价格影响被添加到买价和卖价中。 + +### D. 现价操纵 + +在特定情况下,例如当价格预言机是Uniswap v3 预言机时,协议会追踪流动性池中的流动性和价格变动,并相应调整其风险参数。 + + + + + + + + + + + diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/Security/Third party audits.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Security/Third party audits.md new file mode 100644 index 0000000..a04d856 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/Security/Third party audits.md @@ -0,0 +1,107 @@ +# 智能合约审计 + +Overlay的v1合约已经经过了两次审计,首先是由[Spearbit](https://spearbit.com/)进行的,然后是[Least Authority](https://leastauthority.com/)。 + +| 审计公司 + | +日期 + | +报告 + | +
| Spearbit + | +2022年5月5日 + | +Spearbit Overlay安全审查 + | +
| Least Authority + | +2022年6月8日 + | +Least Authority安全审计报告 + | +
| 类型 + | +问题数量 + | +状态 + | +
| 关键风险 + | +0 + | +- + | +
| 高风险 + | +2 + | +已修复 + | +
| 中风险 + | +2 + | +已修复 + | +
| 低风险 + | +5 + | +已修复 + | +