diff --git a/.gitbook/assets/Swap-1.png b/.gitbook/assets/Swap-1.png deleted file mode 100644 index e6f24f08..00000000 Binary files a/.gitbook/assets/Swap-1.png and /dev/null differ diff --git a/.gitbook/assets/Swap-2.png b/.gitbook/assets/Swap-2.png deleted file mode 100644 index 79608dfd..00000000 Binary files a/.gitbook/assets/Swap-2.png and /dev/null differ diff --git a/.gitbook/assets/Swap-3.png b/.gitbook/assets/Swap-3.png deleted file mode 100644 index 9888497a..00000000 Binary files a/.gitbook/assets/Swap-3.png and /dev/null differ diff --git a/.gitbook/assets/Swap-4.png b/.gitbook/assets/Swap-4.png deleted file mode 100644 index f7445b06..00000000 Binary files a/.gitbook/assets/Swap-4.png and /dev/null differ diff --git a/.gitbook/assets/Swap-5.png b/.gitbook/assets/Swap-5.png deleted file mode 100644 index e3bcef4f..00000000 Binary files a/.gitbook/assets/Swap-5.png and /dev/null differ diff --git a/.gitbook/assets/add-liquidity-1.png b/.gitbook/assets/add-liquidity-1.png deleted file mode 100644 index 101e015a..00000000 Binary files a/.gitbook/assets/add-liquidity-1.png and /dev/null differ diff --git a/.gitbook/assets/add-liquidity-2.png b/.gitbook/assets/add-liquidity-2.png deleted file mode 100644 index 41f2dc60..00000000 Binary files a/.gitbook/assets/add-liquidity-2.png and /dev/null differ diff --git a/.gitbook/assets/add-liquidity-3.png b/.gitbook/assets/add-liquidity-3.png deleted file mode 100644 index 451af75c..00000000 Binary files a/.gitbook/assets/add-liquidity-3.png and /dev/null differ diff --git a/.gitbook/assets/add-liquidity-4.png b/.gitbook/assets/add-liquidity-4.png deleted file mode 100644 index ab83f845..00000000 Binary files a/.gitbook/assets/add-liquidity-4.png and /dev/null differ diff --git a/.gitbook/assets/add-liquidity-5.png b/.gitbook/assets/add-liquidity-5.png deleted file mode 100644 index d9ed0824..00000000 Binary files a/.gitbook/assets/add-liquidity-5.png and /dev/null differ diff --git a/.gitbook/assets/add-liquidity-6.png b/.gitbook/assets/add-liquidity-6.png deleted file mode 100644 index 2546323c..00000000 Binary files a/.gitbook/assets/add-liquidity-6.png and /dev/null differ diff --git a/.gitbook/assets/add-liquidity-connect-wallet.png b/.gitbook/assets/add-liquidity-connect-wallet.png deleted file mode 100644 index 01b4fa51..00000000 Binary files a/.gitbook/assets/add-liquidity-connect-wallet.png and /dev/null differ diff --git a/.gitbook/assets/connect-wallet.png b/.gitbook/assets/connect-wallet.png index feee3631..cf71156a 100644 Binary files a/.gitbook/assets/connect-wallet.png and b/.gitbook/assets/connect-wallet.png differ diff --git a/.gitbook/assets/consume-1.png b/.gitbook/assets/consume-1.png index 562608f8..6e849e5e 100644 Binary files a/.gitbook/assets/consume-1.png and b/.gitbook/assets/consume-1.png differ diff --git a/.gitbook/assets/consume-2.png b/.gitbook/assets/consume-2.png index 5735e447..eb171cd0 100644 Binary files a/.gitbook/assets/consume-2.png and b/.gitbook/assets/consume-2.png differ diff --git a/.gitbook/assets/consume-3.png b/.gitbook/assets/consume-3.png index 51376a61..70486dcf 100644 Binary files a/.gitbook/assets/consume-3.png and b/.gitbook/assets/consume-3.png differ diff --git a/.gitbook/assets/consume-4.png b/.gitbook/assets/consume-4.png index 41581d67..1d9c0767 100644 Binary files a/.gitbook/assets/consume-4.png and b/.gitbook/assets/consume-4.png differ diff --git a/.gitbook/assets/consume-5.png b/.gitbook/assets/consume-5.png index aa6ffb46..617242ba 100644 Binary files a/.gitbook/assets/consume-5.png and b/.gitbook/assets/consume-5.png differ diff --git a/.gitbook/assets/consume-connect-wallet.png b/.gitbook/assets/consume-connect-wallet.png index 34ba0432..ee05b390 100644 Binary files a/.gitbook/assets/consume-connect-wallet.png and b/.gitbook/assets/consume-connect-wallet.png differ diff --git a/.gitbook/assets/datanft and datatoken b/.gitbook/assets/datanft and datatoken deleted file mode 100644 index 2a0c79fb..00000000 Binary files a/.gitbook/assets/datanft and datatoken and /dev/null differ diff --git a/.gitbook/assets/datanft-and-datatoken.png b/.gitbook/assets/datanft-and-datatoken.png new file mode 100644 index 00000000..1457d0d2 Binary files /dev/null and b/.gitbook/assets/datanft-and-datatoken.png differ diff --git a/.gitbook/assets/publish-1.png b/.gitbook/assets/publish-1.png index 155612cb..b9d2604e 100644 Binary files a/.gitbook/assets/publish-1.png and b/.gitbook/assets/publish-1.png differ diff --git a/.gitbook/assets/publish-2.png b/.gitbook/assets/publish-2.png index b918af46..e47421ab 100644 Binary files a/.gitbook/assets/publish-2.png and b/.gitbook/assets/publish-2.png differ diff --git a/.gitbook/assets/publish-3.png b/.gitbook/assets/publish-3.png index 1bf12e6c..371f19e3 100644 Binary files a/.gitbook/assets/publish-3.png and b/.gitbook/assets/publish-3.png differ diff --git a/.gitbook/assets/publish-4.png b/.gitbook/assets/publish-4.png index 65b47328..d77cece1 100644 Binary files a/.gitbook/assets/publish-4.png and b/.gitbook/assets/publish-4.png differ diff --git a/.gitbook/assets/publish-5.png b/.gitbook/assets/publish-5.png index 94621b3e..f0de3f1f 100644 Binary files a/.gitbook/assets/publish-5.png and b/.gitbook/assets/publish-5.png differ diff --git a/.gitbook/assets/publish-6.png b/.gitbook/assets/publish-6.png index 85292a34..5debf4ed 100644 Binary files a/.gitbook/assets/publish-6.png and b/.gitbook/assets/publish-6.png differ diff --git a/.gitbook/assets/publish-7.png b/.gitbook/assets/publish-7.png index b74663e1..c362a36a 100644 Binary files a/.gitbook/assets/publish-7.png and b/.gitbook/assets/publish-7.png differ diff --git a/.gitbook/assets/publish.png b/.gitbook/assets/publish.png index aac3a82d..cd41d29a 100644 Binary files a/.gitbook/assets/publish.png and b/.gitbook/assets/publish.png differ diff --git a/README.md b/README.md index 6c7b5f1a..f2051e98 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,10 @@ Ocean Protocol provides tools for developers to _build data markets_, and to _ma * _Publish and access data services:_ downloadable files or compute-to-data. Use Ocean to deploy a new [ERC721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) and [ERC20](https://github.com/ethereum/EIPs/blob/7f4f0377730f5fc266824084188cc17cf246932e/EIPS/eip-20.md) datatoken contract for each data service, then mint datatokens. * _Transfer datatokens_ to another owner (or approve & transferFrom). -* _Manage pools._ Deploy OCEAN-datatoken [Balancer](https://www.balancer.fi/) pools, buy & sell datatokens (swap), and add & remove liquidity. * _And more._ Use ERC20 support in [web3.js](https://web3js.readthedocs.io/), [web3.py](https://web3py.readthedocs.io/en/stable/examples.html#working-with-an-erc20-token-contract) and Solidity to connect datatokens with crypto wallets and other DeFi services. **Compute-to-Data** Ocean's "Compute-to-Data" feature gives compute access to privately-held data, which never leaves the data owner’s premises. Ocean-based marketplaces enable the monetization of private data while preserving privacy. [Here](tutorials/compute-to-data-architecture/) are details. + +## Supporters + +[GitBook](https://www.gitbook.com/) is a supporter of this open source project by providing hosting for this documentation. \ No newline at end of file diff --git a/SUMMARY.md b/SUMMARY.md index e328d2cc..83ad50c2 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -7,24 +7,19 @@ * [Core Concepts](core-concepts/README.md) * [Architecture Overview](core-concepts/architecture.md) * [Data NFTs and Datatokens](core-concepts/datanft-and-datatoken.md) - * [Data NFTs and datatoken roles](core-concepts/roles.md) - * [Supported Networks](core-concepts/networks.md) + * [Roles](core-concepts/roles.md) + * [Networks](core-concepts/networks.md) + * [Polygon (ex Matic)](building-with-ocean/polygon-bridge.md) + * [Binance Smart Chain (BSC)](building-with-ocean/bsc-bridge.md) * [Fees](core-concepts/fees.md) * [Asset pricing](core-concepts/asset-pricing.md) * [DID & DDO](core-concepts/did-ddo.md) - * [Contributor Code of Conduct](core-concepts/code-of-conduct.md) - * [Ways to Contribute](core-concepts/contributing.md) - * [Funding](core-concepts/get-funding.md) - * [Legal Requirements when Contributing Code](core-concepts/legal-reqs.md) - * [Reporting Vulnerabilities](core-concepts/vulnerabilities.md) -* [API references](api-references/README.md) - * [Aquarius REST API](api-references/aquarius-rest-api.md) - * [Provider REST API](api-references/provider-rest-api.md) -* [Building with ocean](building-with-ocean/README.md) +* [Using Ocean Market](using-ocean-market/README.md) + * [Publish a data asset](using-ocean-market/marketplace-publish-data-asset.md) + * [Download a data asset](using-ocean-market/marketplace-download-data-asset.md) * [Publish assets using hosting services](building-with-ocean/asset-hosting.md) - * [Binance Smart Chain (BSC)](building-with-ocean/bsc-bridge.md) +* [Building with ocean](building-with-ocean/README.md) * [Set Up a Marketplace](building-with-ocean/marketplace.md) - * [Polygon (ex Matic)](building-with-ocean/polygon-bridge.md) * [Compute-to-Data](building-with-ocean/compute-to-data/README.md) * [Architecture](building-with-ocean/compute-to-data/compute-to-data-architecture.md) * [Datasets & Algorithms](building-with-ocean/compute-to-data/compute-to-data-datasets-algorithms.md) @@ -34,10 +29,17 @@ * [Deploying components](building-with-ocean/deploying-components/README.md) * [Deploying Marketplace](building-with-ocean/deploying-components/deploying-marketplace.md) * [Deploying Aquarius](building-with-ocean/deploying-components/deploying-aquarius.md) +<<<<<<< HEAD * [Deploying Provider](building-with-ocean/deploying-components/deploying-provider.md) +======= + * [Contributing](core-concepts/contributing.md) + * [Contributor Code of Conduct](core-concepts/code-of-conduct.md) + * [Legal Requirements when Contributing Code](core-concepts/legal-reqs.md) + * [Reporting Vulnerabilities](core-concepts/vulnerabilities.md) + * [Funding](core-concepts/get-funding.md) +>>>>>>> d687b4e2d8782db2ea7e3e61fa15e9608451e78d * [Projects using Ocean Protocol](building-with-ocean/projects-using-ocean.md) -* [Using Ocean Market](using-ocean-market/README.md) - * [Publish a data asset](using-ocean-market/marketplace-publish-data-asset.md) - * [Download a data asset](using-ocean-market/marketplace-download-data-asset.md) - * [Add liquidity to liquidity pools](using-ocean-market/marketplace-add-liquidity.md) - * [Swap datatokens](using-ocean-market/marketplace-swap.md) +* [API references](api-references/README.md) + * [Aquarius REST API](api-references/aquarius-rest-api.md) + * [Provider REST API](api-references/provider-rest-api.md) + diff --git a/building-with-ocean/compute-to-data/compute-to-data-datasets-algorithms.md b/building-with-ocean/compute-to-data/compute-to-data-datasets-algorithms.md index 8440fd9f..2191d0d6 100644 --- a/building-with-ocean/compute-to-data/compute-to-data-datasets-algorithms.md +++ b/building-with-ocean/compute-to-data/compute-to-data-datasets-algorithms.md @@ -7,7 +7,7 @@ description: Datasets and Algorithms ### Datasets & Algorithms -With Compute-to-Data, datasets are not allowed to leave the premises of the data holder, only algorithms can be permitted to run on them under certain conditions within an isolated and secure environment. Algorithms are an asset type just like datasets. They too can have a pool or a fixed price to determine their price whenever they are used. +With Compute-to-Data, datasets are not allowed to leave the premises of the data holder, only algorithms can be permitted to run on them under certain conditions within an isolated and secure environment. Algorithms are an asset type just like datasets and can be priced in the same way. Algorithms can be public or private by setting `"attributes.main.type"` value in DDO as follows: diff --git a/building-with-ocean/deploying-components/deploying-aquarius.md b/building-with-ocean/deploying-components/deploying-aquarius.md deleted file mode 100644 index 50b53e45..00000000 --- a/building-with-ocean/deploying-components/deploying-aquarius.md +++ /dev/null @@ -1,212 +0,0 @@ -# Deploying Aquarius - -### About Aquarius - -Aquarius is an off-chain component with caches the asset metadata published on-chain. By deploying own Aquarius, developers can control which assets are visible in their marketplace. For example, having a custom Aquarius instance allows assets only from specific addresses to be visible on the marketplace. This tutorial will provide the steps to deploy Aquarius. Ocean Protocol provides Aquarius docker images which can be viewed [here](https://hub.docker.com/r/oceanprotocol/aquarius/tags). Visit [this](https://github.com/oceanprotocol/aquarius) page to view Aquarius source code. - -Aquarius consists of two parts:\ -\- **API:** The Aquarius API offers a convenient way to access the medatata without scanning the chain yourself.\ -\- **Event monitor:** Aquarius continually monitors the chains for MetadataCreated and MetadataUpdated events, processes these events and adds them to the database. - -### Prerequisites - -* Docker and Docker compose are installed. Click [here](https://docs.docker.com/engine/install/) to view guide on installing docker. -* Ethereum API. Aquarius uses Ethereum api for monitoring on-chain events.\ - Choose any api provider of your choice. Some of the commonly used are: - * [Infura](https://infura.io/) - * [Alchemy](https://www.alchemy.com/) - * [Moralis](https://moralis.io/) - -### Create a working directory - -``` -mkdir Aqaurius -cd Aquarius -``` - -### Create a \`.env\` file - -Copy the below content into the \`.env\` file and edit the values as needed. - -{% code title=".env" %} -``` -# check the available versions: https://hub.docker.com/repository/docker/oceanprotocol/aquarius -AQUARIUS_VERSION=latest -ALLOWED_PUBLISHERS='[""]' -# Elastic search credentials -DB_USERNAME=username -DB_PASSWORD=password - -# Replace below value with the API provider of your choice -EVENTS_RPC_RINKEBY=wss://rinkeby.infura.io/ws/v3/INFURA_ID -EVENTS_RPC_POLYGON=wss://rinkeby.infura.io/ws/v3/INFURA_ID -EVENTS_RPC_MAINNET=wss://rinkeby.infura.io/ws/v3/INFURA_ID -``` -{% endcode %} - -### Create docker-compose file - -{% code title="docker-compose.yml" %} -```yaml -version: '3' -services: - elasticsearch: - image: elasticsearch:6.8.17 - container_name: elasticsearch - restart: on-failure - environment: - ES_JAVA_OPTS: "-Xms512m -Xmx512m" - MAX_MAP_COUNT: "64000" - discovery.type: "single-node" - volumes: - - data:/usr/share/elasticsearch/data - ports: - - 9200:9200 - networks: - - ocean_backend - aquarius: - image: oceanprotocol/aquarius:${AQUARIUS_VERSION} - container_name: aquarius - restart: on-failure - ports: - - 5000:5000 - networks: - - ocean_backend - depends_on: - - elasticsearch - environment: - DB_MODULE: elasticsearch - DB_HOSTNAME: elasticsearch - DB_PORT: 9200 - DB_USERNAME: ${DB_USERNAME} - DB_PASSWORD: ${DB_PASSWORD} - DB_NAME: aquarius - DB_SCHEME: http - DB_SSL : "false" - LOG_LEVEL: "DEBUG" - AQUARIUS_BIND_URL : "http://0.0.0.0:5000" - AQUARIUS_WORKERS : "8" - RUN_AQUARIUS_SERVER: "1" - AQUARIUS_CONFIG_FILE: "config.ini" - EVENTS_ALLOW: 0 - RUN_EVENTS_MONITOR: 0 - ALLOWED_PUBLISHERS: ${ALLOWED_PUBLISHERS} -volumes: - data: - driver: local -networks: - ocean_backend: - driver: bridge -``` -{% endcode %} - -### Create events monitor docker compose file - -{% tabs %} -{% tab title="Events monitor - Mainnet" %} -{% code title="docker-compose-events-mainnet.yml" %} -```yaml -version: '3' -services: - aquarius-events-mainnet: - image: oceanprotocol/aquarius:${AQUARIUS_VERSION} - container_name: aquarius-events-mainnet - restart: on-failure - networks: - - ocean_backend - depends_on: - - elasticsearch - environment: - DB_MODULE: elasticsearch - DB_HOSTNAME: elasticsearch - DB_PORT: 9200 - DB_USERNAME: ${DB_USERNAME} - DB_PASSWORD: ${DB_PASSWORD} - DB_NAME: aquarius - DB_SCHEME: http - DB_SSL : "false" - LOG_LEVEL: "DEBUG" - AQUARIUS_BIND_URL: "http://0.0.0.0:5000" - AQUARIUS_WORKERS : "1" - RUN_AQUARIUS_SERVER : "0" - AQUARIUS_CONFIG_FILE: "config.ini" - NETWORK_NAME: "mainnet" - EVENTS_RPC: ${EVENTS_RPC_MAINNET} - BFACTORY_BLOCK: # TODO - METADATA_CONTRACT_BLOCK: # TODO - METADATA_UPDATE_ALL : "0" - OCEAN_ADDRESS : 0x967da4048cD07aB37855c090aAF366e4ce1b9F48 - EVENTS_ALLOW: 0 - RUN_EVENTS_MONITOR: 1 - BLOCKS_CHUNK_SIZE: "5000" -volumes: - data: - driver: local -networks: - ocean_backend: - driver: bridge -``` -{% endcode %} -{% endtab %} - -{% tab title="Events monitor - Polygon" %} -{% code title="docker-compose-events-ploygon.yml" %} -```yaml -version: '3' -services: - aquarius-events-polygon: - image: oceanprotocol/aquarius:${AQUARIUS_VERSION} - container_name: aquarius-events-polygon - restart: on-failure - networks: - - ocean_backend - depends_on: - - elasticsearch - environment: - DB_MODULE: elasticsearch - DB_HOSTNAME: elasticsearch - DB_PORT: 9200 - DB_USERNAME: ${DB_USERNAME} - DB_PASSWORD: ${DB_PASSWORD} - DB_NAME: aquarius - DB_SCHEME: http - DB_SSL : "false" - LOG_LEVEL: "DEBUG" - AQUARIUS_BIND_URL: "http://0.0.0.0:5000" - AQUARIUS_WORKERS : "1" - RUN_AQUARIUS_SERVER : "0" - AQUARIUS_CONFIG_FILE: "config.ini" - NETWORK_NAME: "polygon" - EVENTS_RPC: ${EVENTS_RPC_POLYGON} - BFACTORY_BLOCK: 11005239 - METADATA_CONTRACT_BLOCK: 11005247 - METADATA_UPDATE_ALL: "0" - OCEAN_ADDRESS: "0x282d8efCe846A88B159800bd4130ad77443Fa1A1" - EVENTS_ALLOW: 0 - RUN_EVENTS_MONITOR: 1 - METADATA_CONTRACT_ADDRESS: "0x80E63f73cAc60c1662f27D2DFd2EA834acddBaa8" - BLOCKS_CHUNK_SIZE: "5000" -volumes: - data: - driver: local -networks: - ocean_backend: - driver: bridge -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Start Aquarius - -``` -docker-compose \ --f docker-compose.yml \ --f docker-events-mainnet.yml \ --f docker-events-polygon.yml \ ---env-file .env \ --d \ -up -``` - -After pulling all the asset metadata from the blockchain, Aquarius can be used to query the assets using Elasticsearch query. Aquarius REST API are documented here. diff --git a/building-with-ocean/deploying-components/deploying-marketplace.md b/building-with-ocean/deploying-components/deploying-marketplace.md index 27c57e75..f19cd1c2 100644 --- a/building-with-ocean/deploying-components/deploying-marketplace.md +++ b/building-with-ocean/deploying-components/deploying-marketplace.md @@ -15,13 +15,27 @@ cd my-marketplace Copy the below content into the \`.env\` file. -TODO: explain ALLOWED\_PUBLISHERS and EVENTS\_RPC - {% code title=".env" %} ``` -DB_USERNAME=username -DB_PASSWORD=password -# check the available versions: https://hub.docker.com/repository/docker/oceanprotocol/aquarius +# Update this value if Market should using custom Aquarius +NEXT_PUBLIC_METADATACACHE_URI=https://v4.aquarius.oceanprotocol.com + +#NEXT_PUBLIC_INFURA_PROJECT_ID="xxx" +#NEXT_PUBLIC_MARKET_FEE_ADDRESS="0xxx" +#NEXT_PUBLIC_PUBLISHER_MARKET_ORDER_FEE="1" +#NEXT_PUBLIC_CONSUME_MARKET_ORDER_FEE="1" +#NEXT_PUBLIC_CONSUME_MARKET_FIXED_SWAP_FEE="1" + +# +# ADVANCED SETTINGS +# + +# Toggle pricing options presented during price creation +#NEXT_PUBLIC_ALLOW_FIXED_PRICING="true" +#NEXT_PUBLIC_ALLOW_FREE_PRICING="true" + +# Privacy Preference Center +#NEXT_PUBLIC_PRIVACY_PREFERENCE_CENTER="true" ``` {% endcode %} diff --git a/core-concepts/architecture.md b/core-concepts/architecture.md index 11da77ae..f20a0f3d 100644 --- a/core-concepts/architecture.md +++ b/core-concepts/architecture.md @@ -44,10 +44,7 @@ Once someone has generated datatokens, they can be used in any ERC20 exchange, c The marketplaces are decentralized (no single owner or controller), and non-custodial (only the data owner holds the keys for the datatokens). -Ocean Market supports fixed pricing and automatic price discovery. - -* For **fixed pricing**, there’s a simple contract for users to buy/sell datatokens for OCEAN while avoiding custodianship during value transfer. -* For **automatic price discovery**, Ocean Market uses automated market makers (AMMs) powered by [Balancer](https://www.balancer.fi). Each pool is a datatoken-OCEAN pair. In the Ocean Market GUI, the user adds liquidity then invokes pool creation; the GUI’s React code calls the Ocean JavaScript library, which calls the **Pool Factory** to deploy a **Pool** contract. (The Python library also does this.) Deploying a datatoken pool can be viewed as an “Initial Data Offering” (IDO). +Ocean Market supports fixed pricing or free pricing. For more detials on pricing schema refer [this guide](./asset-pricing.md). Complementary to Ocean Market, Ocean has reference code to ease building **third-party data marketplaces**, such as for logistics ([dexFreight data marketplace](https://blog.oceanprotocol.com/dexfreight-ocean-protocol-partner-to-enable-transportation-logistics-companies-to-monetize-data-7aa839195ac)) or mobility ([Daimler](https://blog.oceanprotocol.com/ocean-protocol-delivers-proof-of-concept-for-daimler-ag-in-collaboration-with-daimler-south-east-564aa7d959ca)). diff --git a/core-concepts/asset-pricing.md b/core-concepts/asset-pricing.md index bf192a5d..15e2b95f 100644 --- a/core-concepts/asset-pricing.md +++ b/core-concepts/asset-pricing.md @@ -15,56 +15,10 @@ With the fixed price model, publishers set the price for the data in OCEAN. Ocea A [FixedRateExchange](https://github.com/oceanprotocol/contracts/blob/v4main/contracts/pools/fixedRate/FixedRateExchange.sol) smart contract stores the information about the price of the assets published using this model. -Publishers can choose this fixed pricing model when they do not want Automated Market Maker(AMM) pools to decide the price discovery. If the publisher has already analyzed and estimated the worth of the dataset and is ready to sell an asset at a constant price, this is the suitable pricing model. - The image below shows how to set the fixed pricing of an asset in the Ocean's Marketplace. Here, the price of the asset is set to 10 Ocean tokens. ![fixed-asset-pricing](../.gitbook/assets/fixed-asset-pricing.png) -### Dynamic pricing - -With the dynamic pricing model, the market defines the price with a mechanism derived from Decentralized Finance (DeFi): liquidity pools. While the publisher sets a base price for the token in OCEAN, the market will organically discover the right price for the data. This can be extremely handy when the value of the data is not known. - -The Ocean Market helps create an Automated Market Maker(AMM) pool of Datatoken and Ocean tokens in dynamic pricing for each asset. _AMM_ enables unstoppable, decentralized trading of assets in the liquidity pool. - -AMM uses a constant product formula to price tokens, which states: **x \* y = k** where **x** and **y** represents the quantity of the two different tokens in the pool and **k** is a constant. - -A _liquidity pool_ is a reserve of tokens locked in the smart contract for market making. A buyer or a seller of an asset exchanges token **x** for token **y** or vice versa. AMM calculates the exchange ratio between the tokens based on the mathematical formula above. - -Ocean Protocol facilitates the creation of Datatoken/OCEAN liquidity pool with [Balancer smart contracts](https://github.com/oceanprotocol/contracts/tree/v4main/contracts/pools/balancer). The publisher needs to only approve a blockchain transaction that creates an AMM while publishing the asset. Thus, Ocean Market hides the complexities of deploying an AMM pool. - -While publishing an asset with dynamic pricing, the publisher decides the initial ratio of Datatokens and Ocean tokens in the pool, thus setting the initial price of an asset. The price of an asset is later dependent on the pool's liquidity and the price impact of trade in the pool. - -Publishers can set the pricing model of an asset to Dynamic pricing if they want the market to decide the asset price and thus enable auto price discovery. - -The image below shows how to set the Dynamic pricing of an asset in the Ocean's Marketplace. Here, the asset price is initially set to 50 Ocean tokens. - -![dynamic-asset-pricing](<../.gitbook/assets/dynamic asset pricing>) - -Ocean Protocol also allows publishers to set the pricing using ocean.js and ocean.py library. - -#### Asset price - -**Action: Add liquidity** - -With one-sided staking, when liquidity is added to the pool, the Ocean tokens are added to the liquidity pool. To protect funds from impermanent loss due to changes in the ratio of tokens in the liquidity pool, Ocean Protocol's bot mints new datatokens and adds them to the pool. Thus, when liquidity is added to the pool, the ratio of tokens remains constant, and there is no price impact on the datatoken. - -**Action: Remove liquidity** - -When the liquidity is removed from the pool, the Ocean tokens are returned to the liquidity provider who initiated the action. Ocean Protocol's bot burns the datatokens from the liquidity pool to protect funds from impermanent loss due to changes in the ratio of tokens in the liquidity pool. Thus, even in this case, there is no price impact on the datatoken. - -**Action: Buy datatoken** - -When a datatoken is bought by paying Ocean tokens to the pool, the ratio of Ocean token and datatoken changes: there are more Ocean tokens and fewer datatokens in the liquidity pool. Therefore, as the ratio of datatokens/Ocean tokens changes, the liquidity pool increases the amount of Ocean tokens required to buy a datatoken in the following transactions(to maintain a constant ratio). Thus, the price of the datatoken increases whenever a datatoken is bought. - -**Action: Buy dataset** - -Buying a dataset involves swapping a datatoken from the liquidity pool by paying Ocean tokens. Thus, if users buy datatokens, the price of datatokens will increase. However, if users already have the datatokens, they can use them to buy the asset or the service without requiring interaction with the pool. In such a case, the price of the datatoken doesn't change. - -**Action: Sell datatoken** - -When a datatoken is sold, Ocean tokens are removed from the liquidity pool in exchange for datatoken. Thus, the ratio of Ocean tokens and datatokens changes: there are fewer Ocean tokens and more datatokens in the liquidity pool. As there are more datatokens, the liquidity pool decreases the amount of Ocean tokens required to buy a datatoken in the following transactions(to maintain a constant ratio). Thus, the price of the datatoken decreases whenever a datatoken is sold. - ### Free pricing With the free pricing model, the buyers can access an asset without requiring them to pay for it except for the transaction fees. diff --git a/core-concepts/datanft-and-datatoken.md b/core-concepts/datanft-and-datatoken.md index f0874f9b..2180f869 100644 --- a/core-concepts/datanft-and-datatoken.md +++ b/core-concepts/datanft-and-datatoken.md @@ -11,15 +11,14 @@ A non-fungible token stored on the blockchain represents a unique asset. NFTs ca Fungible tokens represent fungible assets. If you have 5 ETH and Alice has 5 ETH, you and Alice could swap your ETH and your final holdings remain the same. They're apples-to-apples. Licenses (contracts) to access a copyrighted asset are naturally fungible - they can be swapped with each other. -![Data NFT and datatoken](<../.gitbook/assets/datanft and datatoken>) +![Data NFT and datatoken](../.gitbook/assets/datanft-and-datatoken.png) ### High-Level Architecture The image above describes how ERC721 data NFTs, ERC20 datatokens, and AMMs relate. * Bottom: The publisher deploys an ERC721 data NFT contract representing the base IP for the data asset. They are now the manager of the data NFT. -* Middle: The manager then deploys an ERC20 datatoken contract against the data NFT. The ERC20 represents a license with specific terms like "can download for the next 3 days". They could even publish further ERC20 datatoken contracts, to represent different license terms or for compute-to-data. -* Top: The manager then deploys a pool of the datatoken and OCEAN (or H2O), adds initial liquidity, and receives ERC20 pool tokens in return. Others may also add liquidity to receive pool tokens, i.e. become liquidity providers (LPs). +* Top: The manager then deploys an ERC20 datatoken contract against the data NFT. The ERC20 represents a license with specific terms like "can download for the next 3 days". They could even publish further ERC20 datatoken contracts, to represent different license terms or for compute-to-data. ### Terminology diff --git a/core-concepts/fees.md b/core-concepts/fees.md index 77c6aa22..5bc51034 100644 --- a/core-concepts/fees.md +++ b/core-concepts/fees.md @@ -16,7 +16,7 @@ Ocean Protocol achieves sustainability via the [Web3 sustainability loop](https: ### Swap fee -Swap fees are collected whenever someone swaps a datatoken for base token (e.g., OCEAN) or base token for a datatoken. The swap could be inside a pool (using an automated market maker) or in a fixed-rate exchange. +Swap fees are collected whenever someone swaps a datatoken for base token (e.g., OCEAN) or base token for a datatoken. The swap can be conducted using a a fixed-rate exchange. These are the fees that are applied whenever a user swaps base token or datatoken: - Publisher Marketplace swap fee @@ -67,14 +67,11 @@ The table is periodically updated. Users are advised to confirm new values throu | Swap Fees | Value in Ocean Market, using any Provider | Value in Other Markets | | :------------------------------------------------------------- | :---------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------ | -| publishMarket: Pools | 0% | Set in the market config, by the publishing market.
Min = 0.001%
Max = 10% | | publishMarket: FixedRate | 0% | Set in the market config, by the publishing market.
Min = 0.001%
Max = 50% | -| consumeMarket: Pools | 0% | Set in market config, by the consuming market.
Min = 0.001%
Max = 10% | | consumeMarket: FixedRate
ERC20Template | 0% | 0% | | consumeMarket: FixedRate
EnterpriseTemplate | 0% | Set in market config, by the consuming market. | -| Ocean Community: Pools & FixedRate
OCEAN, H2O as base token | 0.1% | 0.1% | -| Ocean Community: Pools & FixedRate
other base token | 0.2% | 0.2% | -| Pool Liquidity Provider (LP) | 1% | Set by the pool creator on contract deployment.
Contracts
Min = 0.001%
Max = 10%
Market
Min = 0.1%
Max = 10% | +| Ocean Community: FixedRate
OCEAN, H2O as base token | 0.1% | 0.1% | +| Ocean Community: FixedRate
other base token | 0.2% | 0.2% | | Publish Fees | 0% | 0% | | Order Fees
1 datatoken available to get dataset acces | | | | publishMarket
Absolute value, in any token. E.g. 5 USDT | 0 | Set in market config, by the publishing market. | diff --git a/core-concepts/roles.md b/core-concepts/roles.md index cf01da56..c3f66fa6 100644 --- a/core-concepts/roles.md +++ b/core-concepts/roles.md @@ -24,7 +24,6 @@ The permissions are stored in the data NFT (ERC721) smart contract. The data NFT | Action ↓ / Role → | ERC20 Deployer | Minter | NFT owner | Fee manager | | --------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | -| Deploy pool |
**✓**
| | | | | Create Fixed Rate exchange |
**✓**
| | | | | Create Dispenser |
**✓**
| | | | | Add minter |
**✓**
| | | | diff --git a/using-ocean-market/README.md b/using-ocean-market/README.md index 6f2a24f5..ad2de4ad 100644 --- a/using-ocean-market/README.md +++ b/using-ocean-market/README.md @@ -10,4 +10,3 @@ https://v4.market.oceanprotocol.com/ 1. Ocean Market enables publishers to monetize their data and/or algorithms through blockchain technology. 2. Consumers can purchase access to data, algorithms, compute services. -3. Liquidity providers can add their OCEAN tokens to liquidity pools and earn interest on the transactions. diff --git a/using-ocean-market/marketplace-add-liquidity.md b/using-ocean-market/marketplace-add-liquidity.md deleted file mode 100644 index db0360c3..00000000 --- a/using-ocean-market/marketplace-add-liquidity.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -description: Tutorial to add liquidity to Ocean pools using Ocean Market ---- - -# Add liquidity to liquidity pools - -### Access marketplace - -1. Go to Ocean [Marketplace](https://v4.market.oceanprotocol.com/). -2. Search for the data asset. The Ocean Marketplace provides features to search the Data/Algorithms by text, and users can also sort the result by published date. -3. Connect wallet. - -![connect wallet](../.gitbook/assets/add-liquidity-connect-wallet.png) - -### Tutorial - -#### Find an asset - -Search for the desired asset published on the [Ocean Marketplace](https://v4.market.oceanprotocol.com/). - -#### Step 1 - Select pool tab - -After finding the dataset, select **`POOL`** tab and click on **`ADD LIQUIDITY`**. - -![add liquidity part-1](../.gitbook/assets/add-liquidity-1.png) - -#### Step 2 - Liquidity amount - -Enter the amount of OCEAN tokens you want to add. The expected amount of pool shares and percentages for the provided amount will be displayed. - -![add liquidity part-2](../.gitbook/assets/add-liquidity-2.png) - -#### Step 3 - Transaction: Access to OCEAN tokens - -![add liquidity part-3](../.gitbook/assets/add-liquidity-3.png) - -#### Step 4 - Click supply - -![add liquidity part-4](../.gitbook/assets/add-liquidity-4.png) - -#### Step 5 - Transaction: Add liquidty - -![add liquidity part-5](../.gitbook/assets/add-liquidity-5.png) - -![add liquidity part-6](../.gitbook/assets/add-liquidity-6.png) diff --git a/using-ocean-market/marketplace-download-data-asset.md b/using-ocean-market/marketplace-download-data-asset.md index caa8c209..1af02851 100644 --- a/using-ocean-market/marketplace-download-data-asset.md +++ b/using-ocean-market/marketplace-download-data-asset.md @@ -10,7 +10,7 @@ description: Tutorial to download assets using Ocean Market 2. Search for the data asset. The Ocean Marketplace provides features to search the Data/Algorithms by text, and users can also sort the result by published date. 3. Connect wallet. -![connect wallet](../.gitbook/assets/consume-connect-wallet.png) +![Connect wallet](../.gitbook/assets/consume-connect-wallet.png) ``` In this tutorial, we will be using the Rinkeby test network. @@ -22,22 +22,22 @@ In this tutorial, we will be using the Rinkeby test network. The buy button is enabled only if the connected wallet address has enough OCEAN tokens to exchange them with 1 datatoken. -![consume part-1](../.gitbook/assets/consume-1.png) +![Buy](../.gitbook/assets/consume-1.png) #### Step 2 - Allow access to OCEAN token(s) -![consume part-3](../.gitbook/assets/consume-2.png) +![Transaction 1: Permissions to access OCEAN tokens](../.gitbook/assets/consume-2.png) #### Step 3 - Buy a datatoken by exchanging it with OCEAN token(s) -![consume part-4](../.gitbook/assets/consume-3.png) +![Transaction 2: Buy datatoken](../.gitbook/assets/consume-3.png) #### Step 4 - Click download -![consume part-5](../.gitbook/assets/consume-4.png) +![Download asset](../.gitbook/assets/consume-4.png) #### Step 5 - Sign message After signing the message, the file download will start. -![consume part-6](../.gitbook/assets/consume-5.png) +![Sign](../.gitbook/assets/consume-5.png) diff --git a/using-ocean-market/marketplace-publish-data-asset.md b/using-ocean-market/marketplace-publish-data-asset.md index d051dc01..c7edfeaf 100644 --- a/using-ocean-market/marketplace-publish-data-asset.md +++ b/using-ocean-market/marketplace-publish-data-asset.md @@ -15,13 +15,13 @@ Ocean Market provides a convenient interface for individuals and organizations t 1. Go to [Ocean Market](https://v4.market.oceanprotocol.com) 2. Connect wallet. -![connect wallet](../.gitbook/assets/connect-wallet.png) +![Connect wallet](../.gitbook/assets/connect-wallet.png) In this tutorial, we will be using the Rinkeby test network. 3\. Go to the publish page. -![publish page](../.gitbook/assets/publish.png) +![Publish page](../.gitbook/assets/publish.png) #### Step 1 - Metadata @@ -45,7 +45,7 @@ _Mandatory fields are marked with \*_ Tags help the asset to be discoverable. If not provided, the list of tags is empty by default. -![publish part-1](../.gitbook/assets/publish-1.png) +![Asset metadata](../.gitbook/assets/publish-1.png) #### Step 2 - Access details @@ -71,49 +71,43 @@ _Mandatory fields are marked with \*_ This field specifies how long the buyer can access the dataset after the dataset is purchased. This field is editable after the asset publication. -![publish part-2](../.gitbook/assets/publish-2.png) +![Access details](../.gitbook/assets/publish-2.png) #### Step 3 - Pricing The publisher needs to choose a pricing option for the asset before publishing the data asset. The pricing schema is not editable after the asset publication. -There are 3 pricing options for asset publication on Ocean Marketplace. +There are 2 pricing options for asset publication on Ocean Marketplace. 1. Fixed pricing -2. Dynamic pricing (using Balancer pools) -3. Free pricing +2. Free pricing With the _fixed pricing_ schema, the publisher sets the price that buyers will pay to download the data asset. With the _free pricing_ schema, the publisher provides an asset that is free to be downloaded by anyone. -With the _dynamic pricing_ schema, the publisher sets the asset price and creates a datatoken liquidity pool with an initial amount of OCEAN tokens. - For more information on the pricing models, please refer this [document](../core-concepts/asset-pricing.md). -The publisher can also change the **Swap Fee** of the liquidity pool. - For a deep dive into the fee structure, please refer to this [document](../core-concepts/fees.md). -![publish part-3](../.gitbook/assets/publish-3.png) +![Asset pricing](../.gitbook/assets/publish-3.png) #### Step 4 - Preview -![publish part-4](../.gitbook/assets/publish-4.png) +![Preview](../.gitbook/assets/publish-4.png) #### Step 5 - Blockchain transactions -![publish part-5](../.gitbook/assets/publish-5.png) +![Transaction 1 - Deploy data NFT and datatoken](../.gitbook/assets/publish-5.png) -![publish part-6](../.gitbook/assets/publish-6.png) -![publish part-7](../.gitbook/assets/publish-7.png) +![Transaction 2 - Deploy data NFT and datatoken](../.gitbook/assets/publish-6.png) #### Confirmation Now, the asset is successfully published and available in the Ocean Market. -![publish success](../.gitbook/assets/publish-8.png) +![Successful publish](../.gitbook/assets/publish-7.png) On the [profile page](https://v4.market.oceanprotocol.com/profile), the publisher has access to all his published assets. diff --git a/using-ocean-market/marketplace-swap.md b/using-ocean-market/marketplace-swap.md deleted file mode 100644 index 8a5176d9..00000000 --- a/using-ocean-market/marketplace-swap.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -description: Tutorial to swap datatokens for OCEAN tokens using Ocean Market ---- - -# Swap datatokens - -### Access marketplace - -1. Go to Ocean [Marketplace](https://v4.market.oceanprotocol.com/). -2. Search for the data asset. The Ocean Marketplace provides features to search the Data/Algorithms by text, and users can also sort the result by published date. -3. Connect wallet. - -![connect wallet](../.gitbook/assets/consume-connect-wallet.png) - -### Tutorial - -#### Step 1 - Select TRADE tab - -After finding the dataset, select the **`TRADE`** tab. - -#### Step 2 - Trade amount - -Enter the amount of OCEAN tokens to swap. The datatokens amount to receive is displayed with the swap fees information. The reverse operation(swap datatokens to OCEAN tokens) is also available on the trade tab. - -![swap part-1](../.gitbook/assets/Swap-1.png) - -#### Step 3 - Transaction: Access to OCEAN token(s) - -![swap part-2](../.gitbook/assets/Swap-2.png) - -#### Step 4 - Click swap - -![swap part-3](../.gitbook/assets/Swap-3.png) - -#### Step 5 - Transaction: Swap tokens - -![swap part-4](../.gitbook/assets/Swap-4.png) - -![swap part-5](../.gitbook/assets/Swap-5.png)