Issur-#1042: Resolve merge conflict
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 221 KiB After Width: | Height: | Size: 244 KiB |
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 141 KiB |
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 110 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 97 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 209 KiB After Width: | Height: | Size: 159 KiB |
Before Width: | Height: | Size: 44 KiB |
BIN
.gitbook/assets/datanft-and-datatoken.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
.gitbook/assets/feature-compute@2x.webp
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
.gitbook/assets/feature-datascience@2x.webp
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
.gitbook/assets/feature-marketplaces@2x.webp
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
.gitbook/assets/image (10).png
Normal file
After Width: | Height: | Size: 75 KiB |
BIN
.gitbook/assets/image (2).png
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
.gitbook/assets/image (3).png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
.gitbook/assets/image (6).png
Normal file
After Width: | Height: | Size: 75 KiB |
BIN
.gitbook/assets/image (7).png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
.gitbook/assets/image (8).png
Normal file
After Width: | Height: | Size: 98 KiB |
BIN
.gitbook/assets/image (9).png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
.gitbook/assets/image.png
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
.gitbook/assets/market-customisation-10.1.png
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
.gitbook/assets/market-customisation-10.2.png
Normal file
After Width: | Height: | Size: 125 KiB |
BIN
.gitbook/assets/market-customisation-11.1.png
Normal file
After Width: | Height: | Size: 149 KiB |
BIN
.gitbook/assets/market-customisation-12.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
.gitbook/assets/market-customisation-13.png
Normal file
After Width: | Height: | Size: 147 KiB |
BIN
.gitbook/assets/market-customisation-14.png
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
.gitbook/assets/market-customisation-15.png
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
.gitbook/assets/market-customisation-18.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
.gitbook/assets/market-customisation-19.png
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
.gitbook/assets/market-customisation-20.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
.gitbook/assets/market-customisation-21.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
.gitbook/assets/market-customisation-22.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
.gitbook/assets/market-customisation-23.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
.gitbook/assets/market-customisation-24.png
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
.gitbook/assets/market-customisation-25.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
.gitbook/assets/market-customisation-3.png
Normal file
After Width: | Height: | Size: 323 KiB |
BIN
.gitbook/assets/market-customisation-4.1.png
Normal file
After Width: | Height: | Size: 345 KiB |
BIN
.gitbook/assets/market-customisation-4.2.jpg
Normal file
After Width: | Height: | Size: 63 KiB |
BIN
.gitbook/assets/market-customisation-4.png
Normal file
After Width: | Height: | Size: 346 KiB |
BIN
.gitbook/assets/market-customisation-5.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
.gitbook/assets/market-customisation-6.1.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
.gitbook/assets/market-customisation-6.png
Normal file
After Width: | Height: | Size: 93 KiB |
BIN
.gitbook/assets/market-customisation-7.1.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
.gitbook/assets/market-customisation-8.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
.gitbook/assets/market-forking-1.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
.gitbook/assets/market-forking-2.png
Normal file
After Width: | Height: | Size: 186 KiB |
BIN
.gitbook/assets/new-ramp-on-crypto-ramp-off.webp
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
.gitbook/assets/ocean-market-homepage.png
Normal file
After Width: | Height: | Size: 222 KiB |
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 208 KiB |
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 320 KiB |
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 297 KiB |
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 223 KiB After Width: | Height: | Size: 245 KiB |
BIN
.gitbook/assets/remove-liquidity-1 (1).png
Normal file
After Width: | Height: | Size: 236 KiB |
BIN
.gitbook/assets/remove-liquidity-1.png
Normal file
After Width: | Height: | Size: 127 KiB |
BIN
.gitbook/assets/remove-liquidity-2.png
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
.gitbook/assets/remove-liquidity-3.png
Normal file
After Width: | Height: | Size: 69 KiB |
BIN
.gitbook/assets/remove-liquidity-4.png
Normal file
After Width: | Height: | Size: 260 KiB |
BIN
.gitbook/assets/remove-liquidity-5.png
Normal file
After Width: | Height: | Size: 126 KiB |
BIN
.gitbook/assets/remove-liquidity-6.png
Normal file
After Width: | Height: | Size: 224 KiB |
124
README.md
@ -2,21 +2,129 @@
|
||||
description: Ocean Protocol - Tools for the Web3 Data Economy
|
||||
---
|
||||
|
||||
# Orientation
|
||||
# Ocean Documentation
|
||||
|
||||
In Ocean Protocol, each asset gets its own ERC721 **data NFT** and one(or more) ERC20 **datatokens**. This enables data wallets, data exchanges, and data co-ops by directly leveraging crypto wallets, exchanges, and more.
|
||||
## What is Ocean?
|
||||
|
||||
OCEAN token is used for staking, and more. [Here](https://oceanprotocol.com/token) are details.
|
||||
Ocean provides the next generation of tools to unlock data at a large scale. Ocean makes it easy to publish and consume data services.
|
||||
|
||||
Ocean Protocol provides tools for developers to _build data markets_, and to _manage data NFTs and datatokens_ for use in DeFi.
|
||||
Ocean uses Data NFTs (ERC721) and datatokens (ERC20) as the interface to connect data assets with blockchain and DeFi tools. Crypto wallets become data wallets, crypto exchanges become data marketplaces, DAOs for data co-ops, and more via DeFi composability.
|
||||
|
||||
**Build Data Markets.** Use Ocean Protocol software tools to build your own data marketplace, by either forking [Ocean Market](https://v4.market.oceanprotocol.com/) code or building up with Ocean components.
|
||||
![Creating a New Data Economy](./.gitbook/assets/feature-datascience@2x.webp)
|
||||
|
||||
**Manage datatokens and data NFTs for use in DeFi.** Use Ocean [JavaScript](https://github.com/oceanprotocol/ocean.js) or [Python](https://github.com/oceanprotocol/ocean.py) drivers to manage data NFTs and datatokens:
|
||||
The following guides are a greate place to start if you are new to Ocean:
|
||||
|
||||
* [Architecture Overview](core-concepts/architecture.md)
|
||||
* [Data NFTs and Datatokens](core-concepts/datanft-and-datatoken.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)
|
||||
|
||||
## What is our Mission?
|
||||
|
||||
**To unlock data, for more equitable outcomes for users of data, using a thoughtful application of both technology and governance.**
|
||||
|
||||
Society is becoming increasingly reliant on data, especially with the advent of AI. However, a small handful of organizations with both massive data assets and AI capabilities attained worrying levels of control which is a danger to a free and open society.
|
||||
|
||||
Our team and community is committed to kick-starting a New Data Economy that reaches every single person, company and device, giving power back to data owners and enabling people to capture value from data to better our world.
|
||||
|
||||
Find out more about the people building Ocean on our [site](https://oceanprotocol.com/about).
|
||||
|
||||
## What can you do with Ocean?
|
||||
|
||||
### Buy or Sell Data
|
||||
|
||||
Use Ocean Market to publish and sell data, or browse and buy data. Data is published as interoperable ERC721 data NFTs & ERC20 datatokens. It's a decentralized exchange (DEX), tuned for data. The acts of publishing data, purchasing data, and consuming data are all recorded on the blockchain to make a tamper-proof audit trail.
|
||||
|
||||
As a data scientist or AI practitioner, you can benefit from access to more data (including private data), crypto-secured provenance in data & AI training, and income opportunities for selling data and curating data.
|
||||
|
||||
![Decentralized Exchange Marketplaces](./.gitbook/assets/feature-marketplaces@2x.webp)
|
||||
|
||||
The following guides will help you get started with buying and selling data:
|
||||
|
||||
* [Publish a data asset](using-ocean-market/marketplace-publish-data-asset.md)
|
||||
* [Download a data asset](using-ocean-market/marketplace-download-data-asset.md)
|
||||
* [Publishing with hosting services](building-with-ocean/asset-hosting.md)
|
||||
|
||||
### Build Your Own Data Market
|
||||
|
||||
Use Ocean Protocol software tools to build your own data marketplace, by either forking [Ocean Market](https://v4.market.oceanprotocol.com/) code or building up with Ocean components.
|
||||
|
||||
![Ocean Market Homepage](./.gitbook/assets/ocean-market-homepage.png)
|
||||
|
||||
If you're interested in starting your own marketplace checkout the following guides:
|
||||
|
||||
* [Forking Ocean Market](building-with-ocean/build-a-marketplace/forking-ocean-market.md)
|
||||
* [Customising your market](building-with-ocean/build-a-marketplace/customising-your-market.md)
|
||||
* [Deploying your market](building-with-ocean/build-a-marketplace/deploying-market.md)
|
||||
|
||||
### Manage datatokens and data NFTs for use in DeFi
|
||||
|
||||
Ocean makes it easy to publish data services (deploy ERC721 data NFTs and ERC20 datatokens), and to consume data services (spend datatokens). Crypto wallets, exchanges, and DAOs become data wallets, exchanges, and DAOs.
|
||||
|
||||
Use Ocean [JavaScript](https://github.com/oceanprotocol/ocean.js) or [Python](https://github.com/oceanprotocol/ocean.py) drivers to manage data NFTs and datatokens:
|
||||
|
||||
Ocean-based apps make data asset on-ramps and off-ramps easy for end users. Ocean smart contracts and libraries make this easy for developers. The data itself does not need to be on-chain, just the access control.
|
||||
|
||||
![New Data on-ramp and off-ramp](./.gitbook/assets/new-ramp-on-crypto-ramp-off.webp)
|
||||
|
||||
Data NFTs are ERC721 tokens representing the unique asset and datatokens are ERC20 tokens to access data services. Each data service gets its own data NFT and one or more type of datatokens.
|
||||
|
||||
To access the dataset, you send 1.0 datatokens to the data provider (running Ocean Provider). To give access to someone else, send them 1.0 datatokens. That's it.
|
||||
|
||||
Since datatokens are ERC20, and live on Ethereum mainnet, there's a whole ecosystem to leverage.
|
||||
|
||||
* _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.
|
||||
|
||||
### Compute-to-Data
|
||||
|
||||
Ocean's "Compute-to-Data" feature enables private data to be bought & sold. You can sell 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.
|
||||
|
||||
Compute-to-data resolves the tradeoff between the benefits of using private data, and the risks of exposing it. It lets the data stay on-premise, yet allows 3rd parties to run specific compute jobs on it to get useful compute results like averaging or building an AI model.
|
||||
|
||||
The most valuable data is private data — using it can improve research and business outcomes. But concerns over privacy and control make it hard to access. With Compute-to-Data, private data isn’t directly shared but rather specific access to it is granted.
|
||||
|
||||
![Compute-to-data](./.gitbook/assets/feature-compute@2x.webp)
|
||||
|
||||
It can be used for data sharing in science or technology contexts, or in marketplaces for selling private data while preserving privacy, as an opportunity for companies to monetize their data assets.
|
||||
|
||||
Private data can help research, leading to life-altering innovations in science and technology. For example, more data improves the predictive accuracy of modern Artificial Intelligence (AI) models. Private data is often considered the most valuable data because it’s so hard to get at, and using it can lead to potentially big payoffs.
|
||||
|
||||
Checkout these guides if you are aiming to get a deeper understanding on how compute-to-data works:
|
||||
|
||||
* [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)
|
||||
* [Minikube Environment](building-with-ocean/compute-to-data/compute-to-data-minikube.md)
|
||||
* [Writing Algorithms](building-with-ocean/compute-to-data/compute-to-data-algorithms.md)
|
||||
* [Private docker registry](building-with-ocean/compute-to-data/compute-to-data-docker-registry.md)
|
||||
## How does it work?
|
||||
|
||||
In Ocean Protocol, each asset gets its own ERC721 **data NFT** and one(or more) ERC20 **datatokens**. This enables data wallets, data exchanges, and data co-ops by directly leveraging crypto wallets, exchanges, and more.
|
||||
|
||||
Ocean Protocol provides tools for developers to _build data markets_, and to _manage data NFTs and datatokens_ for use in DeFi.
|
||||
|
||||
If you are new to web3 and blockchain technologies then we suggest you first read these introductory guides:
|
||||
|
||||
* [Wallet Basics](building-with-ocean/wallets.md)
|
||||
* [Set Up MetaMask Wallet](orientation/metamask-setup.md)
|
||||
* [Manage Your OCEAN Tokens](building-with-ocean/wallets-and-ocean-tokens.md)
|
||||
|
||||
If ou are looking to get to grips with the inner workings of Ocean, then you'll be interested in the following guides:
|
||||
|
||||
* [Architecture Overview](./core-concepts/architecture.md)
|
||||
* [Data NFTs and Datatokens](./core-concepts/datanft-and-datatoken.md)
|
||||
* [Networks](./core-concepts/networks.md)
|
||||
* [Fees](./core-concepts/fees.md)
|
||||
* [Asset pricing](./core-concepts/asset-pricing.md)
|
||||
* [DID & DDO](./core-concepts/did-ddo.md)
|
||||
* [Roles](./core-concepts/roles.md)
|
||||
* [Set Up a Marketplace](./building-with-ocean/marketplace.md)
|
||||
* [Compute-to-Data](./building-with-ocean/compute-to-data/README.md)
|
||||
* [Deploying components](building-with-ocean/deploying-components/README.md)
|
||||
* [Contributing](core-concepts/contributing.md)
|
||||
|
||||
## Supporters
|
||||
|
||||
[GitBook](https://www.gitbook.com/) is a supporter of this open source project by providing hosting for this documentation.
|
||||
|
56
SUMMARY.md
@ -3,24 +3,27 @@
|
||||
* [Orientation](README.md)
|
||||
* [Wallet Basics](building-with-ocean/wallets.md)
|
||||
* [Set Up MetaMask Wallet](orientation/metamask-setup.md)
|
||||
* [Use Your Wallet to Manage OCEAN Tokens](building-with-ocean/wallets-and-ocean-tokens.md)
|
||||
* [Manage Your OCEAN Tokens](building-with-ocean/wallets-and-ocean-tokens.md)
|
||||
* [FAQ](orientation/faq.md)
|
||||
* [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)
|
||||
* [Bridges](core-concepts/networks/bridges.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)
|
||||
* [Publishing with hosting services](building-with-ocean/asset-hosting.md)
|
||||
* [Liquidity Pools [deprecated]](using-ocean-market/remove-liquidity-using-etherscan.md)
|
||||
* [Building with Ocean](building-with-ocean/README.md)
|
||||
* [Build a Marketplace](building-with-ocean/build-a-marketplace/README.md)
|
||||
* [Forking Ocean Market](building-with-ocean/build-a-marketplace/forking-ocean-market.md)
|
||||
* [Customising your market](building-with-ocean/build-a-marketplace/customising-your-market.md)
|
||||
* [Deploying your market](building-with-ocean/build-a-marketplace/deploying-market.md)
|
||||
* [Obtaining Ethereum node provider API key](building-with-ocean/obtaining-api-key.md)
|
||||
* [Using Ocean libraries](building-with-ocean/using-ocean-libraries/README.md)
|
||||
* [Configuration](building-with-ocean/using-ocean-libraries/configuration.md)
|
||||
@ -29,21 +32,28 @@
|
||||
* [Mint datatoken](building-with-ocean/using-ocean-libraries/mint-datatoken.md)
|
||||
* [Update metadata](building-with-ocean/using-ocean-libraries/update-metadata.md)
|
||||
* [Publish assets using hosting services](building-with-ocean/asset-hosting.md)
|
||||
* [Binance Smart Chain (BSC)](building-with-ocean/bsc-bridge.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)
|
||||
* [Minikube Compute-to-Data Environment](building-with-ocean/compute-to-data/compute-to-data-minikube.md)
|
||||
* [Writing Algorithms for Compute to Data](building-with-ocean/compute-to-data/compute-to-data-algorithms.md)
|
||||
* [Setting up private docker registry](building-with-ocean/compute-to-data/compute-to-data-docker-registry.md)
|
||||
* [Minikube Environment](building-with-ocean/compute-to-data/compute-to-data-minikube.md)
|
||||
* [Writing Algorithms](building-with-ocean/compute-to-data/compute-to-data-algorithms.md)
|
||||
* [Private docker registry](building-with-ocean/compute-to-data/compute-to-data-docker-registry.md)
|
||||
* [Deploying components](building-with-ocean/deploying-components/README.md)
|
||||
* [Setup server](building-with-ocean/deploying-components/setup-server.md)
|
||||
* [Deploying Marketplace](building-with-ocean/deploying-components/deploying-marketplace.md)
|
||||
* [Deploying Aquarius](building-with-ocean/deploying-components/deploying-aquarius.md)
|
||||
* [Deploying Provider](building-with-ocean/deploying-components/deploying-provider.md)
|
||||
* [Deploying Ocean subgraph](building-with-ocean/deploying-components/deploying-ocean-subgraph.md)
|
||||
* [Using Ocean Subgraph](building-with-ocean/using-ocean-subgraph/README.md)
|
||||
* [List data NFTs](building-with-ocean/using-ocean-subgraph/list-data-nfts.md)
|
||||
* [List all tokens](building-with-ocean/using-ocean-subgraph/list-datatokens.md)
|
||||
* [Get data NFT information](building-with-ocean/using-ocean-subgraph/get-data-nft-information.md)
|
||||
* [Get datatoken information](building-with-ocean/using-ocean-subgraph/get-datatoken-information.md)
|
||||
* [List Fixed Rate Exchanges](building-with-ocean/using-ocean-subgraph/list-fixed-rate-exchanges.md)
|
||||
* [Contributing](core-concepts/contributing.md)
|
||||
* [Contributor Code of Conduct](core-concepts/code-of-conduct.md)
|
||||
* [Legal Requirements](core-concepts/legal-reqs.md)
|
||||
* [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)
|
||||
|
@ -1,2 +1,2 @@
|
||||
# Building with ocean
|
||||
# Building with Ocean
|
||||
|
||||
|
@ -3,7 +3,7 @@ title: Publish assets using hosting services
|
||||
description: Tutorial to publish assets using hosting services like Google Drive and Azure.
|
||||
---
|
||||
|
||||
# Publish assets using hosting services
|
||||
# Publishing with hosting services
|
||||
|
||||
### Overview
|
||||
|
||||
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
title: Binance Smart Chain (BSC)
|
||||
---
|
||||
|
||||
# Binance Smart Chain (BSC)
|
||||
|
||||
### Intro to BSC's Bridge
|
||||
|
||||
BSC provides several bridge options, including:
|
||||
|
||||
* withdraw crypto from Binance.com, and
|
||||
* use Binance bridge.
|
||||
|
||||
The article [How to Get Started with BSC](https://academy.binance.com/en/articles/how-to-get-started-with-binance-smart-chain-bsc) by Binance Academy provides further details.
|
||||
|
||||
### Links
|
||||
|
||||
* [BSC Wallet Support](https://docs.binance.org/wallets/bsc-wallets.html). Includes MetaMask and Trust Wallet.
|
||||
* [BSC Bridge](https://www.bnbchain.org/en/bridge)
|
||||
* [How to set up a custom network in MetaMask](../orientation/metamask-setup.md#set-up-custom-network)
|
43
building-with-ocean/build-a-marketplace/README.md
Normal file
@ -0,0 +1,43 @@
|
||||
---
|
||||
title: Forking Ocean Market
|
||||
featuredImage: images/creatures/mantaray/mantaray-full@2x.png
|
||||
description: Forking and customizing Ocean Market (Frontend)
|
||||
---
|
||||
|
||||
# Build a Marketplace
|
||||
|
||||
## Outcome
|
||||
|
||||
Your own fully functioning customized fork of Ocean Market is deployed and working.
|
||||
|
||||
## Introduction
|
||||
|
||||
Have you ever thought about monetizing digital assets over the blockchain? Your first instinct might be to head on over to a popular marketplace - but why not create your own marketplace? It’s a lot easier than you might imagine. This guide will cover everything you need to start your own blockchain marketplace in less than an hour. The reason it’s so easy is that we’ll be starting with a fork of Ocean Market, which provides us with some pretty cool tech under-the-hood (if you’re interested in blockchain, read on).
|
||||
|
||||
Using Ocean Market is already a big improvement on the alternatives that are out there, but it gets even better. Ocean Market is completely open-source and freely available under the Apache 2 license. This means that you can fork Ocean Market and set up your own marketplace in just a few steps. Ocean Market is primarily focused on monetizing data, but it can actually handle the sale of any digital asset. This guide will walk you through the process of forking Ocean Market and starting your own marketplace for selling photos; you’ll be surprised how easy it is. No prior blockchain knowledge is required!
|
||||
|
||||
## Content
|
||||
|
||||
The tutorial covers:
|
||||
|
||||
* Forking and running Ocean Market locally
|
||||
* Customising your fork of Ocean market
|
||||
* Quick deployment of Ocean Market
|
||||
|
||||
## Preparation
|
||||
|
||||
**Prior knowledge**
|
||||
|
||||
If you’re completely unfamiliar with Ocean Market or web3 applications in general, you will benefit from reading these guides first:
|
||||
|
||||
* To use your clone of Ocean Market, you’ll need a [wallet](https://docs.oceanprotocol.com/tutorials/wallets/). We recommend [getting set up with metamask](https://docs.oceanprotocol.com/tutorials/metamask-setup/).
|
||||
* You’ll also need some [Ocean tokens on a testnet](https://docs.oceanprotocol.com/tutorials/wallets-and-ocean-tokens/) to use your marketplace.
|
||||
* When you have the testnet tokens, have a go at [publishing a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-publish-data-asset/) on Ocean Market.
|
||||
* Run through the process of [consuming a data asset](https://docs.oceanprotocol.com/tutorials/marketplace-consume-data-asset/) on Ocean Market.
|
||||
|
||||
**Required Prerequisites**
|
||||
|
||||
* Git. Instructions for installing Git can be found [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
|
||||
* Node.js can be downloaded from [here](https://nodejs.org/en/download/) (we’re using version 16 in this guide)
|
||||
* A decent code editor, such as [Visual Studio Code](https://code.visualstudio.com/).
|
||||
* You’ll need a Github account to fork Ocean market via [Github](https://github.com/).
|
@ -0,0 +1,182 @@
|
||||
---
|
||||
title: Customising Your Market
|
||||
order: 2
|
||||
hideLanguageSelector: true
|
||||
description: Step by step guide to customizing your fork of Ocean market
|
||||
featuredImage: images/creatures/mantaray/mantaray-full@2x.png
|
||||
---
|
||||
|
||||
# Customizing your fork of Ocean market
|
||||
|
||||
So you’ve got a fully functioning data marketplace at this point, which is pretty cool. But it doesn’t really look like your data marketplace. Right now, it’s still just a clone of Ocean Market — the same branding, name, logo, etc. The next few steps focus on personalizing your data marketplace.
|
||||
|
||||
- Change your Market Name
|
||||
|
||||
- Change the Logo
|
||||
|
||||
- Change the Styling
|
||||
|
||||
- Edit the Publish Form
|
||||
|
||||
- Change the Fee Address
|
||||
|
||||
- Build and host your Data Marketplace
|
||||
|
||||
## Change your Market Name
|
||||
|
||||
It’s now time to open up your favorite code editor and start getting stuck into the code. The first thing we will be doing is changing the name of your marketplace. A decent code editor (such as VS Code) makes this incredibly simple by searching and replacing all the places where the name appears.
|
||||
|
||||
Let’s start by searching and replacing “Ocean Marketplace”. In VS Code there is a magnifying glass symbol in the left-hand panel (arrow 1 in the image below) that will open up the interface for searching and replacing text. Type “Ocean Marketplace” into the first textbox, and the name of your marketplace into the second textbox (arrow 2). To make things simple, there is a button to the right of the second textbox (arrow 3) that will replace all instances at once. You can take a moment to review all the text you’re changing if you wish, and then click this button.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-3.png)
|
||||
|
||||
Next up, we need to repeat the process but this time we’ll be searching and replacing “Ocean Market”. As you can see in the screenshot below, we have called our fork “Crypto Photos Market”.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-4.png)
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-4.1.png)
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-4.2.jpg)
|
||||
|
||||
Now let’s change the tagline of your site. Open up the folder called “content” and then open the file called “site.json”.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-5.png)
|
||||
|
||||
On line 3 in this file you can enter the tagline that you want for your marketplace.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-6.png)
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-6.1.png)
|
||||
|
||||
## Change the Logo
|
||||
|
||||
The next important step to personalizing your marketplace is setting your own logo. We highly recommend using your logo in SVG format for this. The site logo is stored in the following location:
|
||||
|
||||
```
|
||||
src/@images/logo.svg
|
||||
```
|
||||
|
||||
Delete the “logo.svg” file from that folder and paste your own logo in the same folder. Then, if you rename your logo “logo.svg” everything will work without any problems.
|
||||
|
||||
At this point, it’s a good idea to check how things are looking. First check that you have saved all of your changes, then cancel the build that’s running in your terminal (Ctrl + C OR Cmnd + C) and start it again `npm start`. Once the build has finished, navigate to http://localhost:8000/ and see how things look.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-7.1.png)
|
||||
|
||||
Awesome! Our logo is looking great!
|
||||
|
||||
## Change the Styling
|
||||
|
||||
Hopefully, you like our pink and purple branding, but we don’t expect you to keep it in your own marketplace. This step focuses on applying your own brand colors and styles.
|
||||
|
||||
### Background
|
||||
|
||||
Let’s start with the background. Open up the following CSS file:
|
||||
|
||||
```
|
||||
src/components/App/index.module.css
|
||||
```
|
||||
|
||||
You’ll notice in the screenshot above that we are setting our “wave” background on line 3. Here, you’ll want to use your own background color or image. For this example, we’ll use an SVG background from [here](https://www.svgbackgrounds.com/). First, we save the new background image into the src/images/ folder (same folder as the logo), then we change the CSS to the file location of the new background (see line 3 in the image below).
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-8.png)
|
||||
|
||||
If we save this file and view the site at this point, we get a white section at the top (see image below). And you’ll also notice that the background doesn’t fill all the way down to the bottom of the screen.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-10.1.png)
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-10.2.png)
|
||||
|
||||
To fix this, we need to change the starting position of the background image and change it from no-repeat to repeat. We can do this on line 3.
|
||||
|
||||
When we view our marketplace, we can see that the new background starts at the top and fills the whole page. Perfect!
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-11.1.png)
|
||||
|
||||
## Brand Colors
|
||||
|
||||
Next up, let’s change the background colors to match your individual style. Open up the following file: src/global/\_variables.css. Here you’ll see the global style colors that are set. Now is the time to get creative, or consult your brand handbook (if you already have one).
|
||||
|
||||
You can change these colors as much as you wish until you’re happy with how everything looks. Each time you save your changes, the site will immediately update so you can see how things look. You can see the styles chosen for this example in the image below.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-12.png)
|
||||
|
||||
## Change Fonts
|
||||
|
||||
The final part of the styling that we’ll alter in this guide is the fonts. This is an important step because the font used in Ocean Market is one of the few elements of the market that are copyright protected. If you want to use the same font you’ll need to purchase a license. The other copyrighted elements are the logo and the name — which we have already changed.
|
||||
|
||||
If you don’t already have a brand font, head over to Google Fonts to pick some fonts that suit the brand you’re trying to create. Google makes it nice and easy to see how they’ll look, and it’s simple to import them into your project.
|
||||
|
||||
The global fonts are set in the same file as the colors, scroll down and you’ll see them on lines 36 to 41.
|
||||
|
||||
If you are importing fonts, such as from Google fonts, you need to make sure that you include the import statement at the top of the \_variables.css file.
|
||||
|
||||
As with the color changes, it’s a good idea to save the file with each change and check if the site is looking the way that you expected it to. You can see our eclectic choices below.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-13.png)
|
||||
|
||||
## Customize the Publish Form
|
||||
|
||||
Let’s head to the publish page to see what it looks like with our new styling - so far, so good. But there is one major issue, the publish form is still telling people to publish datasets. On our new marketplace, we want people to publish and sell their photos, so we’re going to have to make some changes here.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-14.png)
|
||||
|
||||
Open up the index.json file from content/publish/index.json - here we change the text to explain that this form is for publishing photos.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-15.png)
|
||||
|
||||
Additionally, the asset type current says dataset, and we need to change this so that it says photo. The simplest way to do this is to change the title of the asset type without changing anything else. Ocean can handle selling any digital asset that can be accessed via a URL, so no further changes are needed to accommodate selling photos.
|
||||
|
||||
Open up src/components/Publish/Metadata/index.tsx and change line 28 so that it says ‘Photo’
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-18.png)
|
||||
|
||||
Great, now our publish page explains that users should be publishing photos and photo is provided as an asset type option. We’ll also leave algorithm as an option in case some data scientists want to do some analysis or image transformation on the photos.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-19.png)
|
||||
|
||||
There is one more thing that is fun to change before we move away from the publish form. You’ll notice that Ocean Market V4 now has a cool SVG generation feature that creates the images for the Data NFT. It creates a series of pink waves. Let’s change this so that it uses our brand colors in the waves!
|
||||
|
||||
Open up /src/@utils/SvgWaves.ts and have a look at lines 27 to 30 where the colors are specified. Currently, the pink color is the one used in the svg generator. You can replace this with your own brand color:
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-21.png)
|
||||
|
||||
If you’re interested in doing some further customization, take a look at lines 53 to 64. You can change these properties to alter how the image looks. Feel free to play around with it. We’ve increased the number of layers from 4 to 5.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-22.png)
|
||||
|
||||
And now your customized publish page is ready for your customers:
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-20.png)
|
||||
|
||||
## Change the Fee Address
|
||||
|
||||
At this point, we have made a lot of changes and hopefully you’re happy with the way that your marketplace is looking. Given that you now have your own awesome photo marketplace, it’s about time we talked about monetizing it. Yup, that’s right - you will earn a commission when people buy and sell photos in your marketplace. In Ocean V4, there are a whole host of new fees and customization options that you can use (read more about that here).
|
||||
|
||||
When someone sets the pricing for their photos in your marketplace, they are informed that a commission will be sent to the owner of the marketplace. You see that at the moment this fee is set to zero, so you’ll want to increase that. And in order to receive the fees you’ll you need to set the address that you want to recieve these fees in.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-23.png)
|
||||
|
||||
This important step is the last thing that we will change in this guide. To set the marketplace fees and address, you’ll need to save them as environmental variables. Create a new file called .env in the root of your repository.
|
||||
|
||||
Copy and paste the following into the file:
|
||||
|
||||
```
|
||||
|
||||
NEXT_PUBLIC_MARKET_FEE_ADDRESS="0x123abc"
|
||||
NEXT_PUBLIC_PUBLISHER_MARKET_ORDER_FEE="0.01"
|
||||
NEXT_PUBLIC_PUBLISHER_MARKET_FIXED_SWAP_FEE="0.01"
|
||||
NEXT_PUBLIC_CONSUME_MARKET_ORDER_FEE="0.01"
|
||||
NEXT_PUBLIC_CONSUME_MARKET_FIXED_SWAP_FEE="0.01"
|
||||
|
||||
```
|
||||
|
||||
You need to replace “0x123abc” with your ethereum address (this is where the fees will be sent) and alter the fees to the levels that you intend them to be at. If you change you mind, these fees can always be altered later.
|
||||
|
||||
Go to [Fees page](https://docs.oceanprotocol.com/concepts/fees/) to know more details about each type of fee and its relevance.
|
||||
|
||||
It is important that the file is saved in the right place at the root of your repository, your file structure should look the same as below.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-24.png)
|
||||
|
||||
Now that’s it; you now have a fully functioning photo marketplace that operates over the blockchain. Everytime someone uses it, you will receive revenue.
|
||||
|
||||
![Market Customisation](../../.gitbook/assets/market-customisation-25.png)
|
41
building-with-ocean/build-a-marketplace/deploying-market.md
Normal file
@ -0,0 +1,41 @@
|
||||
---
|
||||
title: Deployment of Ocean Market
|
||||
order: 3
|
||||
hideLanguageSelector: true
|
||||
featuredImage: images/creatures/mantaray/mantaray-full@2x.png
|
||||
description: Step by step guide to a quick deployment of Ocean Market
|
||||
---
|
||||
|
||||
# Deploying your market
|
||||
|
||||
All that’s left is for you to host your data marketplace and start sharing it with your future users.
|
||||
|
||||
## **Build and host your Data Marketplace**
|
||||
|
||||
To host your data marketplace, you need to run the build command:
|
||||
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
This takes a few minutes to run. While this is running, you can get prepared to host your new data marketplace. You have many options for hosting your data marketplace (including AWS S3, Vercel, Netlify and many more). In this guide, we will demonstrate how to host it with surge, which is completely free and very easy to use.
|
||||
|
||||
Open up a new terminal window and run the following command to install surge:
|
||||
|
||||
```
|
||||
npm install --global surge
|
||||
```
|
||||
|
||||
When this is complete, navigate back to the terminal window that is building your finished data marketplace. Once the build is completed, enter the following commands to enter the public directory and host it:
|
||||
|
||||
```
|
||||
cd public
|
||||
```
|
||||
|
||||
```
|
||||
surge
|
||||
```
|
||||
|
||||
If this is your first time using surge, you will be prompted to enter an email address and password to create a free account. It will ask you to confirm the directory that it is about to publish, check that you are in the market/public/ directory and press enter to proceed. Now it gives you the option to choose the domain that you want your project to be available on. We have chosen https://crypto-photos.surge.sh which is a free option. You can also set a CNAME value in your DNS to make use of your own custom domain.
|
||||
|
||||
After a few minutes, your upload will be complete, and you’re ready to share your data marketplace. You can view the version we created in this guide [here](https://crypto-photos.surge.sh/).
|
@ -0,0 +1,58 @@
|
||||
---
|
||||
title: Forking Ocean Market
|
||||
order: 1
|
||||
hideLanguageSelector: true
|
||||
featuredImage: images/creatures/mantaray/mantaray-full@2x.png
|
||||
description: Forking and running Ocean Market locally.
|
||||
---
|
||||
|
||||
# Forking Ocean Market
|
||||
|
||||
One of the best use cases for Ocean is running your own marketplace and monetizing your digital assets. With Ocean you can sell your data directly to your customers with no third party in-between, no need to speak to data with data brokers. Ocean makes this all super easy for you with some pretty cool tech under the hood. Furthermore, an Ocean powered market isn't just limited to selling data, you can use it for selling any type of digital asset!
|
||||
|
||||
Using Ocean Market is already a big improvement on the alternatives that are out there, but it gets even better. Ocean Market is completely open-source and made freely available under the Apache 2 license. This means that you can fork Ocean Market and set up your own data marketplace in just a few steps. This guide will walk you through the process, you’ll be surprised how easy it is. No prior blockchain knowledge is required!
|
||||
|
||||
* Fork Ocean Market
|
||||
* Clone the market locally
|
||||
* Install the dependencies
|
||||
* Run your Market fork for the first time
|
||||
|
||||
## Fork Ocean Market
|
||||
|
||||
The first step is to log into Github and navigate to the [Ocean Market repository](https://github.com/oceanprotocol/market), you’ll need to log in or create a Github account. Now you need to click “Fork” in the top right-hand corner. If you are a member of an organization on Github, it will give you the option to clone it into either your personal account or the organization. Choose whichever is suitable for you.
|
||||
|
||||
## Clone the market locally
|
||||
|
||||
Now we need to clone the market fork locally so that we can start making changes to the code. Upon forking Ocean Market, GitHub will take you to the repository page. Here, you should copy the URL of the repository. To do this, click on the green “Code” button and then click the copy icon to copy the HTTPS URL. Make sure that you have git installed and set up and installed on your computer before proceeding. See [this guide](https://git-scm.com/) if you’re not familiar with git.
|
||||
|
||||
## Install the dependencies
|
||||
|
||||
Installing the dependencies is a vital step for running the market. It’s a super simple process, thanks to npm (node package manager). Make sure you have node.js installed, otherwise it will fail. In Ocean Market, we use node.js version 16 and it’s highly recommended that you use the same.
|
||||
|
||||
Enter the following command to install the dependencies:
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
This command will take a few minutes to complete and you’ll see some warnings as it runs (no need to worry about the warnings).
|
||||
|
||||
## Run your Market fork for the first time
|
||||
|
||||
At this point, you are ready to run your data marketplace for the first time. This is another straightforward step that requires just one command:
|
||||
|
||||
```
|
||||
npm start
|
||||
```
|
||||
|
||||
The above command will build the development bundle and run it locally.
|
||||
|
||||
![Forking Ocean Market](../../.gitbook/assets/market-forking-1.png)
|
||||
|
||||
Great news - your marketplace has successfully been built and is now running locally. Let’s check it out! Open your browser and navigate to http://localhost:8000/. You’ll see that you have a full-on clone of Ocean Market running locally. Give it a go and test out publishing and consuming assets - everything works!
|
||||
|
||||
That’s all that’s required to get a clone of Ocean market working. The whole process is made simple because your clone can happily use all the smart contracts and backend components that are maintained by Ocean Protocol Foundation.
|
||||
|
||||
![Forking Ocean Market](../../.gitbook/assets/market-forking-2.png)
|
||||
|
||||
So you’ve got a fully functioning marketplace at this point, which is pretty cool. But it doesn’t really look like your marketplace. Right now, it’s still just a clone of Ocean Market - the same branding, name, logo, etc. The next few steps focus on personalizing your marketplace.
|
@ -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:
|
||||
|
||||
|
@ -10,6 +10,7 @@ Aquarius consists of two parts:\
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* A server for hosting Aquarius. See [this guide](setup-server.md) on creating a server.
|
||||
* 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:
|
||||
@ -20,7 +21,7 @@ Aquarius consists of two parts:\
|
||||
### Create a working directory
|
||||
|
||||
```
|
||||
mkdir Aqaurius
|
||||
mkdir Aquarius
|
||||
cd Aquarius
|
||||
```
|
||||
|
||||
@ -38,9 +39,8 @@ 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
|
||||
EVENTS_RPC_POLYGON=<polygon-key>
|
||||
EVENTS_RPC_MAINNET=<mainnet-key>
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
@ -132,10 +132,8 @@ services:
|
||||
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
|
||||
OCEAN_ADDRESS : "0x967da4048cD07aB37855c090aAF366e4ce1b9F48"
|
||||
EVENTS_ALLOW: 0
|
||||
RUN_EVENTS_MONITOR: 1
|
||||
BLOCKS_CHUNK_SIZE: "5000"
|
||||
@ -178,8 +176,6 @@ services:
|
||||
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
|
||||
@ -202,8 +198,8 @@ networks:
|
||||
```
|
||||
docker-compose \
|
||||
-f docker-compose.yml \
|
||||
-f docker-events-mainnet.yml \
|
||||
-f docker-events-polygon.yml \
|
||||
-f docker-compose-events-mainnet.yml \
|
||||
-f docker-compose-events-polygon.yml \
|
||||
--env-file .env \
|
||||
-d \
|
||||
up
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* Docker and Docker compose are installed
|
||||
* A server for hosting Ocean Marketplace. See [this guide](setup-server.md) on creating a server.
|
||||
|
||||
### Create a directory
|
||||
#### Create a directory
|
||||
|
||||
```
|
||||
mkdir my-marketplace
|
||||
@ -15,18 +15,30 @@ cd my-marketplace
|
||||
|
||||
Copy the below content into the \`.env\` file.
|
||||
|
||||
<mark style="color:red;">TODO: explain ALLOWED\_PUBLISHERS and EVENTS\_RPC</mark>
|
||||
|
||||
{% 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 %}
|
||||
|
||||
### Build a Marketplace container
|
||||
|
||||
#### Create a \`Dockerfile\` file and copy the below content into it.
|
||||
|
||||
{% code title="Dockerfile" %}
|
||||
|
@ -0,0 +1,87 @@
|
||||
# Deploying Ocean subgraph
|
||||
|
||||
### About Ocean subgraph
|
||||
|
||||
Ocean subgraph allows querying the datatoken, dataNFT, and all event information using GraphQL. Hosting the Ocean subgraph saves the cost and time required in querying the data directly from the blockchain. The steps in this tutorial will explain how to host Ocean subgraph for the EVM compatible chains supported by Ocean Protocol.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* A server for hosting Ocean subgraph. See [this guide](setup-server.md) on creating a server.
|
||||
* 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 ocean-subgraph
|
||||
cd ocean-subgraph
|
||||
```
|
||||
|
||||
### Create a \`.env\` file
|
||||
|
||||
Copy the below content into the \`.env\` file and edit the values as needed.
|
||||
|
||||
{% code title=".env" %}
|
||||
```
|
||||
ETHEREUM_NODE_PROVIDER_API='rinkeby:https://rinkeby.infura.io/v3/${INFURA_PROJECT_ID}'
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### Create docker-compose file
|
||||
|
||||
{% code title="docker-compose.yml" %}
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
graph-node:
|
||||
image: graphprotocol/graph-node:v0.26.0
|
||||
ports:
|
||||
- '9000:8000'
|
||||
- '8001:8001'
|
||||
- '8020:8020'
|
||||
- '8030:8030'
|
||||
- '8040:8040'
|
||||
depends_on:
|
||||
- ipfs
|
||||
- postgres
|
||||
environment:
|
||||
postgres_host: postgres
|
||||
postgres_user: graph-node
|
||||
postgres_pass: let-me-in
|
||||
postgres_db: graph-node
|
||||
ipfs: 'ipfs:5001'
|
||||
ethereum: ${ETHEREUM_NODE_PROVIDER_API}
|
||||
RUST_LOG: info
|
||||
ipfs:
|
||||
image: ipfs/go-ipfs:v0.4.23
|
||||
ports:
|
||||
- '5001:5001'
|
||||
volumes:
|
||||
- ./data/ipfs:/data/ipfs
|
||||
postgres:
|
||||
image: postgres
|
||||
ports:
|
||||
- '5432:5432'
|
||||
command: ['postgres', '-cshared_preload_libraries=pg_stat_statements']
|
||||
environment:
|
||||
POSTGRES_USER: graph-node
|
||||
POSTGRES_PASSWORD: let-me-in
|
||||
POSTGRES_DB: graph-node
|
||||
volumes:
|
||||
- ./data/postgres:/var/lib/postgresql/data
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### Start Ocean subgraph
|
||||
|
||||
```
|
||||
docker-compose \
|
||||
-f docker-compose.yml
|
||||
--env-file .env \
|
||||
-d \
|
||||
up
|
||||
```
|
@ -0,0 +1,80 @@
|
||||
# Deploying Provider
|
||||
|
||||
### About Provider
|
||||
|
||||
Provider encrypts the URL and metadata during publish and decrypts the URL when the dataset is downloaded or a compute job is started. It enables the access to data assets by streaming data (and never the URL). It performs checks on chain for buyer permissions and payments. It also Provides compute services (connects to C2D environment).
|
||||
The source code of Provider can be access from [here](https://github.com/oceanprotocol/provider).
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* Docker and Docker compose are installed. Click [here](https://docs.docker.com/engine/install/) to view guide on installing docker.
|
||||
* Ethereum API.
|
||||
See [this](../obtaining-api-key.md) guide on obtaining api key.
|
||||
|
||||
### Create a working directory
|
||||
|
||||
```
|
||||
mkdir Provider
|
||||
cd Provider
|
||||
```
|
||||
|
||||
### Create a \`.env\` file
|
||||
|
||||
Copy the below content into the \`.env\` file and edit the values as needed.
|
||||
|
||||
|
||||
{% code title=".env" %}
|
||||
```
|
||||
# Mandatory variables
|
||||
|
||||
# Update the value to the appropriate tag from here: https://hub.docker.com/r/oceanprotocol/provider-py/tags
|
||||
PROVIDER_VERSION=latest
|
||||
PROVIDER_PRIVATE_KEY=<private-key>
|
||||
NETWORK_URL=<api-key>
|
||||
AQUARIUS_URL=<aquarius-url>
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### Create docker-compose file
|
||||
|
||||
{% code title="docker-compose.provider.yml" %}
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
provider:
|
||||
image: oceanprotocol/provider-py:v1.0.20
|
||||
container_name: provider
|
||||
ports:
|
||||
- 8030:8030
|
||||
networks:
|
||||
- ocean_backend
|
||||
environment:
|
||||
NETWORK_URL: ${NETWORK_URL}
|
||||
PROVIDER_PRIVATE_KEY: ${PROVIDER_PRIVATE_KEY}
|
||||
LOG_LEVEL: DEBUG
|
||||
OCEAN_PROVIDER_URL: "http://0.0.0.0:8030"
|
||||
OCEAN_PROVIDER_WORKERS: "1"
|
||||
OCEAN_PROVIDER_TIMEOUT: "9000"
|
||||
# Defining OPERATOR_SERVICE_URL is optional. Set the value only if Provider should support Compute-to-data.
|
||||
OPERATOR_SERVICE_URL: "<operator-service-url>"
|
||||
# Defining IPFS_GATEWAY is optional. Set the value if Provider should support resolving IPFS urls.
|
||||
IPFS_GATEWAY: "<ipfs-url>"
|
||||
AQUARIUS_URL: ${AQUARIUS_URL}
|
||||
volumes:
|
||||
data:
|
||||
driver: local
|
||||
networks:
|
||||
ocean_backend:
|
||||
driver: bridge
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### Start Provider
|
||||
|
||||
```
|
||||
docker-compose \
|
||||
-f docker-compose.provider.yml
|
||||
--env-file .env \
|
||||
-d \
|
||||
up
|
||||
```
|
64
building-with-ocean/deploying-components/setup-server.md
Normal file
@ -0,0 +1,64 @@
|
||||
---
|
||||
description: >-
|
||||
The following tutorial shows how to create a server ready for hosting Ocean
|
||||
Protocol's components.
|
||||
---
|
||||
|
||||
# Setup server
|
||||
|
||||
## **Using hosting services**
|
||||
|
||||
Ocean Protocol's components can be hosted on any infrastructure providers like AWS, Azure, Heroku, Digitalocean, and many others. The tutorial here explains how to create a server using Digitalocean and installing docker which will be required to host Ocean Protocol's components. Apart from steps for create a server, the remaining part of the tutorial will be same for all hosting providers.
|
||||
|
||||
#### Creating account and setting billing
|
||||
|
||||
Go to [https://www.digitalocean.com/](https://www.digitalocean.com/) and create an account. Provide the appropriate information for billing and accounting.
|
||||
|
||||
#### Create a droplet
|
||||
|
||||
Click on **`Create`** button and choose **`Droplets`** options from dropdown.
|
||||
|
||||
![](../../.gitbook/assets/image.png)
|
||||
|
||||
#### Configure droplet
|
||||
|
||||
Select Ubuntu OS and choose a plan. The required CPU, Memory depends on the number of requests Aquarius is expected to serve.
|
||||
|
||||
![Configure droplet](<../../.gitbook/assets/image (8).png>)
|
||||
|
||||
Also, select the region where you want Aquarius to be hosted and a root password.
|
||||
|
||||
![](<../../.gitbook/assets/image (10).png>)
|
||||
|
||||
![Click Create Droplet](<../../.gitbook/assets/image (7).png>)
|
||||
|
||||
Finalize the parameters for the server, click on `Create Droplet.` After the server is ready, select the `Access console` option from the dropdown.
|
||||
|
||||
![Click Access Console](<../../.gitbook/assets/image (3).png>)
|
||||
|
||||
![Click Launch Droplet Console](<../../.gitbook/assets/image (9).png>)
|
||||
|
||||
A window will open with a terminal session. Now, the required infrastructure is ready for hosting Aquarius, Provider or the Subgraph. Let's install docker and docker-compose on the server. Follow the installation guide [here](https://docs.docker.com/engine/install/ubuntu/).
|
||||
|
||||
The below commands shows the commands executed by following the guide.
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install ca-certificates curl gnupg lsb-release
|
||||
sudo mkdir -p /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
sudo apt-get update
|
||||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
||||
|
||||
# Now install docker-compose
|
||||
sudo apt-get update
|
||||
sudo apt-get install docker-compose-plugin
|
||||
```
|
||||
|
||||
Now that, the server is ready with all the required dependencies are installed for hosting Ocean Components, follow the instructions given in Component specific guide.
|
||||
|
||||
* [Deploying Marketplace](deploying-marketplace.md)
|
||||
* [Deploying Aquarius](deploying-aquarius.md)
|
10
building-with-ocean/using-ocean-subgraph/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
description: >-
|
||||
Ocean subgraph is an off-chain service which provides information about
|
||||
datatokens, users, balances using the GraphQL. Ocean subgraph provides a
|
||||
faster way to fetch data rather than on-chain query.
|
||||
---
|
||||
|
||||
# Using Ocean Subgraph
|
||||
|
||||
For each supported network, an individual Ocean subgraph is deployed. The information about supported networks and the subgraph URL is available on [this page](../../core-concepts/networks.md).
|
@ -0,0 +1,130 @@
|
||||
# Get data NFT information
|
||||
|
||||
The result of following GraphQL query returns the information about a particular datatoken. Here, `0x1c161d721e6d99f58d47f709cdc77025056c544c` is the address of the dataNFT.  
|
||||
|
||||
{% hint style="info" %}
|
||||
Copy the query in the [graphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks, change the domain name with appropriate subgraph domain as mentioned in [this page](../../core-concepts/networks.md).
|
||||
{% endhint %}
|
||||
|
||||
```graphql
|
||||
{
|
||||
nft (id:"0x1c161d721e6d99f58d47f709cdc77025056c544c", subgraphError:deny){
|
||||
id
|
||||
name
|
||||
symbol
|
||||
owner
|
||||
address
|
||||
assetState
|
||||
tx
|
||||
block
|
||||
transferable
|
||||
creator
|
||||
createdTimestamp
|
||||
providerUrl
|
||||
managerRole
|
||||
erc20DeployerRole
|
||||
storeUpdateRole
|
||||
metadataRole
|
||||
tokenUri
|
||||
template
|
||||
orderCount
|
||||
}
|
||||
}b
|
||||
```
|
||||
|
||||
The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed. Change the value of the variable dataNFT\_address with the address of the datatoken of your choice.
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Python" %}
|
||||
{% code title="dataNFT_information.py" %}
|
||||
```python
|
||||
import requests
|
||||
import json
|
||||
|
||||
dataNFT_address = "0x1c161d721e6d99f58d47f709cdc77025056c544c"
|
||||
query = """
|
||||
{{
|
||||
nft (id:"{0}", subgraphError:deny){{
|
||||
id
|
||||
name
|
||||
symbol
|
||||
owner
|
||||
address
|
||||
assetState
|
||||
tx
|
||||
block
|
||||
transferable
|
||||
creator
|
||||
createdTimestamp
|
||||
providerUrl
|
||||
managerRole
|
||||
erc20DeployerRole
|
||||
storeUpdateRole
|
||||
metadataRole
|
||||
tokenUri
|
||||
template
|
||||
orderCount
|
||||
}}
|
||||
}}""".format(
|
||||
dataNFT_address
|
||||
)
|
||||
|
||||
base_url = "https://v4.subgraph.mainnet.oceanprotocol.com"
|
||||
route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
|
||||
|
||||
url = base_url + route
|
||||
|
||||
headers = {"Content-Type": "application/json"}
|
||||
payload = json.dumps({"query": query})
|
||||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
result = json.loads(response.text)
|
||||
|
||||
print(json.dumps(result, indent=4, sort_keys=True))
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Execute script
|
||||
|
||||
```
|
||||
python dataNFT_information.py
|
||||
```
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Sample response</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"nft": {
|
||||
"address": "0x1c161d721e6d99f58d47f709cdc77025056c544c",
|
||||
"assetState": 0,
|
||||
"block": 15185270,
|
||||
"createdTimestamp": 1658397870,
|
||||
"creator": "0xd30dd83132f2227f114db8b90f565bca2832afbd",
|
||||
"erc20DeployerRole": [
|
||||
"0x1706df1f2d93558d1d77bed49ccdb8b88fafc306"
|
||||
],
|
||||
"id": "0x1c161d721e6d99f58d47f709cdc77025056c544c",
|
||||
"managerRole": [
|
||||
"0xd30dd83132f2227f114db8b90f565bca2832afbd"
|
||||
],
|
||||
"metadataRole": null,
|
||||
"name": "Ocean Data NFT",
|
||||
"orderCount": "1",
|
||||
"owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd",
|
||||
"providerUrl": "https://v4.provider.mainnet.oceanprotocol.com",
|
||||
"storeUpdateRole": null,
|
||||
"symbol": "OCEAN-NFT",
|
||||
"template": "",
|
||||
"tokenUri": "<removed>",
|
||||
"transferable": true,
|
||||
"tx": "0x327a9da0d2e9df945fd2f8e10b1caa77acf98e803c5a2f588597172a0bcbb93a"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
@ -0,0 +1,166 @@
|
||||
# Get datatoken information
|
||||
|
||||
|
||||
|
||||
The result of following GraphQL query returns the information about a particular datatoken. Here, `0x122d10d543bc600967b4db0f45f80cb1ddee43eb` is the address of the datatoken.  
|
||||
|
||||
{% hint style="info" %}
|
||||
Copy the query in the [graphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks, change the domain name with appropriate subgraph domain as mentioned in [this page](../../core-concepts/networks.md).
|
||||
{% endhint %}
|
||||
|
||||
```graphql
|
||||
{
|
||||
token(id:"0x122d10d543bc600967b4db0f45f80cb1ddee43eb", subgraphError: deny){
|
||||
id
|
||||
symbol
|
||||
nft {
|
||||
name
|
||||
symbol
|
||||
address
|
||||
}
|
||||
name
|
||||
symbol
|
||||
cap
|
||||
isDatatoken
|
||||
holderCount
|
||||
orderCount
|
||||
orders(skip:0,first:1){
|
||||
amount
|
||||
serviceIndex
|
||||
payer {
|
||||
id
|
||||
}
|
||||
consumer{
|
||||
id
|
||||
}
|
||||
estimatedUSDValue
|
||||
lastPriceToken
|
||||
lastPriceValue
|
||||
}
|
||||
}
|
||||
fixedRateExchanges(subgraphError:deny){
|
||||
id
|
||||
price
|
||||
active
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed. Change the value of the variable `datatoken_address` with the address of the datatoken of your choice.
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Python" %}
|
||||
#### Create script
|
||||
|
||||
{% code title="datatoken_information.py" %}
|
||||
```python
|
||||
import requests
|
||||
import json
|
||||
|
||||
datatoken_address = "0x122d10d543bc600967b4db0f45f80cb1ddee43eb"
|
||||
query = """
|
||||
{{
|
||||
token(id:"{0}", subgraphError: deny){{
|
||||
id
|
||||
symbol
|
||||
nft {{
|
||||
name
|
||||
symbol
|
||||
address
|
||||
}}
|
||||
name
|
||||
symbol
|
||||
cap
|
||||
isDatatoken
|
||||
holderCount
|
||||
orderCount
|
||||
orders(skip:0,first:1){{
|
||||
amount
|
||||
serviceIndex
|
||||
payer {{
|
||||
id
|
||||
}}
|
||||
consumer{{
|
||||
id
|
||||
}}
|
||||
estimatedUSDValue
|
||||
lastPriceToken
|
||||
lastPriceValue
|
||||
}}
|
||||
}}
|
||||
fixedRateExchanges(subgraphError:deny){{
|
||||
id
|
||||
price
|
||||
active
|
||||
}}
|
||||
}}""".format(
|
||||
datatoken_address
|
||||
)
|
||||
|
||||
base_url = "https://v4.subgraph.mainnet.oceanprotocol.com/"
|
||||
route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
|
||||
|
||||
url = base_url + route
|
||||
|
||||
headers = {"Content-Type": "application/json"}
|
||||
payload = json.dumps({"query": query})
|
||||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
result = json.loads(response.text)
|
||||
|
||||
print(json.dumps(result, indent=4, sort_keys=True))
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Execute script
|
||||
|
||||
```
|
||||
python datatoken_information.py
|
||||
```
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Sample response</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"fixedRateExchanges": [
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x06284c39b48afe5f01a04d56f1aae45dbb29793b190ee11e93a4a77215383d44",
|
||||
"price": "33"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x2719862ebc4ed253f09088c878e00ef8ee2a792e1c5c765fac35dc18d7ef4deb",
|
||||
"price": "35"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x2dccaa373e4b65d5ec153c150270e989d1bda1efd3794c851e45314c40809f9c",
|
||||
"price": "33"
|
||||
}
|
||||
],
|
||||
"token": {
|
||||
"cap": "115792089237316195423570985008687900000000000000000000000000",
|
||||
"holderCount": "0",
|
||||
"id": "0x122d10d543bc600967b4db0f45f80cb1ddee43eb",
|
||||
"isDatatoken": true,
|
||||
"name": "Brave Lobster Token",
|
||||
"nft": {
|
||||
"address": "0xea615374949a2405c3ee555053eca4d74ec4c2f0",
|
||||
"name": "Ocean Data NFT",
|
||||
"symbol": "OCEAN-NFT"
|
||||
},
|
||||
"orderCount": "0",
|
||||
"orders": [],
|
||||
"symbol": "BRALOB-11"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
196
building-with-ocean/using-ocean-subgraph/list-data-nfts.md
Normal file
@ -0,0 +1,196 @@
|
||||
# List data NFTs
|
||||
|
||||
The result of following GraphQL query returns the information about data nfts. 
|
||||
|
||||
{% hint style="info" %}
|
||||
Copy the query in the [graphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks, change the domain name with appropriate subgraph domain as mentioned in [this page](../../core-concepts/networks.md).
|
||||
{% endhint %}
|
||||
|
||||
```graphql
|
||||
{
|
||||
nfts (skip:0, first: 10, subgraphError:deny){
|
||||
id
|
||||
name
|
||||
symbol
|
||||
owner
|
||||
address
|
||||
assetState
|
||||
tx
|
||||
block
|
||||
transferable
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed.
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Python" %}
|
||||
{% code title="list_dataNFTs.py" %}
|
||||
```python
|
||||
import requests
|
||||
import json
|
||||
|
||||
|
||||
query = """
|
||||
{
|
||||
nfts (skip:0, first: 10, subgraphError:deny){
|
||||
id
|
||||
name
|
||||
symbol
|
||||
owner
|
||||
address
|
||||
assetState
|
||||
tx
|
||||
block
|
||||
transferable
|
||||
}
|
||||
}"""
|
||||
|
||||
|
||||
base_url = "https://v4.subgraph.mainnet.oceanprotocol.com"
|
||||
route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
|
||||
|
||||
url = base_url + route
|
||||
|
||||
headers = {"Content-Type": "application/json"}
|
||||
payload = json.dumps({"query": query})
|
||||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
result = json.loads(response.text)
|
||||
|
||||
print(json.dumps(result, indent=4, sort_keys=True))
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Execute script
|
||||
|
||||
```
|
||||
python list_dataNFTs.py
|
||||
```
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Sample response</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"nfts": [
|
||||
{
|
||||
"address": "0x1c161d721e6d99f58d47f709cdc77025056c544c",
|
||||
"assetState": 0,
|
||||
"block": 15185270,
|
||||
"id": "0x1c161d721e6d99f58d47f709cdc77025056c544c",
|
||||
"name": "Ocean Data NFT",
|
||||
"owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd",
|
||||
"symbol": "OCEAN-NFT",
|
||||
"transferable": true,
|
||||
"tx": "0x327a9da0d2e9df945fd2f8e10b1caa77acf98e803c5a2f588597172a0bcbb93a"
|
||||
},
|
||||
{
|
||||
"address": "0x1e06501660623aa973474e3c59efb8ba542cb083",
|
||||
"assetState": 0,
|
||||
"block": 15185119,
|
||||
"id": "0x1e06501660623aa973474e3c59efb8ba542cb083",
|
||||
"name": "Ocean Data NFT",
|
||||
"owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd",
|
||||
"symbol": "OCEAN-NFT",
|
||||
"transferable": true,
|
||||
"tx": "0xd351ccee22b505d811c29fa524db920815936672b20b8f3a09485e389902fd27"
|
||||
},
|
||||
{
|
||||
"address": "0x2eaa55236f799c6ebec72e77a1a6296ea2e704b1",
|
||||
"assetState": 0,
|
||||
"block": 15185009,
|
||||
"id": "0x2eaa55236f799c6ebec72e77a1a6296ea2e704b1",
|
||||
"name": "Ocean Data NFT",
|
||||
"owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd",
|
||||
"symbol": "OCEAN-NFT",
|
||||
"transferable": true,
|
||||
"tx": "0xf6d55306ab4dc339dc1655a2d119af468a79a70fa62ea11de78879da61e89e7b"
|
||||
},
|
||||
{
|
||||
"address": "0x2fbe924f6c92825929dc7785fe05d15e35f2612b",
|
||||
"assetState": 0,
|
||||
"block": 15185235,
|
||||
"id": "0x2fbe924f6c92825929dc7785fe05d15e35f2612b",
|
||||
"name": "Ocean Data NFT",
|
||||
"owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd",
|
||||
"symbol": "OCEAN-NFT",
|
||||
"transferable": true,
|
||||
"tx": "0xa9ff9d461b4b7344ea181de32fa6412c7ea8e21f485ab4d8a7b9cfcdb68d9d51"
|
||||
},
|
||||
{
|
||||
"address": "0x4c04433bb1760a66be7713884bb6370e9c567cef",
|
||||
"assetState": 0,
|
||||
"block": 15185169,
|
||||
"id": "0x4c04433bb1760a66be7713884bb6370e9c567cef",
|
||||
"name": "Ocean Data NFT",
|
||||
"owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd",
|
||||
"symbol": "OCEAN-NFT",
|
||||
"transferable": true,
|
||||
"tx": "0x54c5463e8988b5fa4e4cfe71ee391505801931abe9e94bf1588dd538ec3aa4c9"
|
||||
},
|
||||
{
|
||||
"address": "0x619c500dcb0251b31cd480030db2dcc19866c0c3",
|
||||
"assetState": 0,
|
||||
"block": 15236619,
|
||||
"id": "0x619c500dcb0251b31cd480030db2dcc19866c0c3",
|
||||
"name": "abc",
|
||||
"owner": "0x12fe650c86cd4346933ef1bcab21a1979d4c6786",
|
||||
"symbol": "GOAL-9956",
|
||||
"transferable": true,
|
||||
"tx": "0x6178b03589cda98573ff52a1afbcc07b14a2fddacc0132595949e9d8a0ed1b32"
|
||||
},
|
||||
{
|
||||
"address": "0x6d45a5b38a122a6dbc042601236d6ecc5c8e343e",
|
||||
"assetState": 0,
|
||||
"block": 15109853,
|
||||
"id": "0x6d45a5b38a122a6dbc042601236d6ecc5c8e343e",
|
||||
"name": "Ocean Data NFT",
|
||||
"owner": "0xbbd33afa85539fa65cc08a2e61a001876d2f13fe",
|
||||
"symbol": "OCEAN-NFT",
|
||||
"transferable": true,
|
||||
"tx": "0x27aa77a0bf3f7878910dc7bfe2116d9271138c222b3d898381a5c72eefefe624"
|
||||
},
|
||||
{
|
||||
"address": "0x7400078c5d4fd7704afca45a928d9fc97cbea744",
|
||||
"assetState": 0,
|
||||
"block": 15185056,
|
||||
"id": "0x7400078c5d4fd7704afca45a928d9fc97cbea744",
|
||||
"name": "Ocean Data NFT",
|
||||
"owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd",
|
||||
"symbol": "OCEAN-NFT",
|
||||
"transferable": true,
|
||||
"tx": "0x2025374cd347e25e2651feec2f2faa2feb26664698eaea42b5dad1a31eda57f8"
|
||||
},
|
||||
{
|
||||
"address": "0x81decdb59dce5b4323e683a76f8fa8dd0eabc560",
|
||||
"assetState": 0,
|
||||
"block": 15185003,
|
||||
"id": "0x81decdb59dce5b4323e683a76f8fa8dd0eabc560",
|
||||
"name": "Ocean Data NFT",
|
||||
"owner": "0xd30dd83132f2227f114db8b90f565bca2832afbd",
|
||||
"symbol": "OCEAN-NFT",
|
||||
"transferable": true,
|
||||
"tx": "0x6ad6ec2ce86bb70e077590a64c886d72975374bd2e993f143d9da8edcaace82b"
|
||||
},
|
||||
{
|
||||
"address": "0x8684119ecf77c5be41f01760ad466725ffd9b960",
|
||||
"assetState": 0,
|
||||
"block": 14933034,
|
||||
"id": "0x8684119ecf77c5be41f01760ad466725ffd9b960",
|
||||
"name": "Ocean Data NFT",
|
||||
"owner": "0x87b5606fba13529e1812319d25c6c2cd5c3f3cbc",
|
||||
"symbol": "OCEAN-NFT",
|
||||
"transferable": true,
|
||||
"tx": "0x55ba746cd8e8fb4c739b8544a9034848082b627500b854cb8db0802dd7beb172"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
150
building-with-ocean/using-ocean-subgraph/list-datatokens.md
Normal file
@ -0,0 +1,150 @@
|
||||
# List all tokens
|
||||
|
||||
The result of following GraphQL query returns the information about datatokens.  
|
||||
|
||||
{% hint style="info" %}
|
||||
Copy the query in the [graphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks, change the domain name with appropriate subgraph domain as mentioned in [this page](../../core-concepts/networks.md).
|
||||
{% endhint %}
|
||||
|
||||
```graphql
|
||||
{
|
||||
tokens(skip:0, first: 2, subgraphError: deny){
|
||||
id
|
||||
symbol
|
||||
nft {
|
||||
name
|
||||
symbol
|
||||
address
|
||||
}
|
||||
name
|
||||
symbol
|
||||
cap
|
||||
isDatatoken
|
||||
holderCount
|
||||
orderCount
|
||||
orders(skip:0,first:1){
|
||||
amount
|
||||
serviceIndex
|
||||
payer {
|
||||
id
|
||||
}
|
||||
consumer{
|
||||
id
|
||||
}
|
||||
estimatedUSDValue
|
||||
lastPriceToken
|
||||
lastPriceValue
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed.
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Python" %}
|
||||
#### Create script
|
||||
|
||||
{% code title="list_all_tokens.py" %}
|
||||
```python
|
||||
import requests
|
||||
import json
|
||||
|
||||
query = """
|
||||
{{
|
||||
tokens(skip:0, first: 2, subgraphError: deny){{
|
||||
id
|
||||
symbol
|
||||
nft {{
|
||||
name
|
||||
symbol
|
||||
address
|
||||
}}
|
||||
name
|
||||
symbol
|
||||
cap
|
||||
isDatatoken
|
||||
holderCount
|
||||
orderCount
|
||||
orders(skip:0,first:1){{
|
||||
amount
|
||||
serviceIndex
|
||||
payer {{
|
||||
id
|
||||
}}
|
||||
consumer{{
|
||||
id
|
||||
}}
|
||||
estimatedUSDValue
|
||||
lastPriceToken
|
||||
lastPriceValue
|
||||
}}
|
||||
|
||||
|
||||
}}
|
||||
}}"""
|
||||
|
||||
base_url = "https://v4.subgraph.mainnet.oceanprotocol.com"
|
||||
route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
|
||||
|
||||
url = base_url + route
|
||||
|
||||
headers = {"Content-Type": "application/json"}
|
||||
payload = json.dumps({"query": query})
|
||||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
result = json.loads(response.text)
|
||||
|
||||
print(json.dumps(result, indent=4, sort_keys=True))
|
||||
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Execute script
|
||||
|
||||
```
|
||||
python list_all_tokens.py
|
||||
```
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Sample Response</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"tokens": [
|
||||
{
|
||||
"cap": null,
|
||||
"holderCount": "0",
|
||||
"id": "0x0642026e7f0b6ccac5925b4e7fa61384250e1701",
|
||||
"isDatatoken": false,
|
||||
"name": "H2O",
|
||||
"nft": null,
|
||||
"orderCount": "0",
|
||||
"orders": [],
|
||||
"symbol": "H2O"
|
||||
},
|
||||
{
|
||||
"cap": "115792089237316195423570985008687900000000000000000000000000",
|
||||
"holderCount": "0",
|
||||
"id": "0x122d10d543bc600967b4db0f45f80cb1ddee43eb",
|
||||
"isDatatoken": true,
|
||||
"name": "Brave Lobster Token",
|
||||
"nft": {
|
||||
"address": "0xea615374949a2405c3ee555053eca4d74ec4c2f0",
|
||||
"name": "Ocean Data NFT",
|
||||
"symbol": "OCEAN-NFT"
|
||||
},
|
||||
"orderCount": "0",
|
||||
"orders": [],
|
||||
"symbol": "BRALOB-11"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
@ -0,0 +1,176 @@
|
||||
# List Fixed Rate Exchanges
|
||||
|
||||
The result of following GraphQL query returns the information about the Fixed Rate Exchanges.  
|
||||
|
||||
{% hint style="info" %}
|
||||
Copy the query in the [graphiQL interface](https://v4.subgraph.mainnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph/graphql) to fetch the results from the mainnet. For other networks, change the domain name with appropriate subgraph domain as mentioned in [this page](../../core-concepts/networks.md).
|
||||
{% endhint %}
|
||||
|
||||
```graphql
|
||||
{
|
||||
fixedRateExchanges(skip:0, first:2, subgraphError:deny){
|
||||
id
|
||||
contract
|
||||
exchangeId
|
||||
owner{id}
|
||||
datatoken{
|
||||
id
|
||||
name
|
||||
symbol
|
||||
}
|
||||
price
|
||||
datatokenBalance
|
||||
active
|
||||
totalSwapValue
|
||||
swaps(skip:0, first:1){
|
||||
tx
|
||||
by {
|
||||
id
|
||||
}
|
||||
baseTokenAmount
|
||||
dataTokenAmount
|
||||
createdTimestamp
|
||||
}
|
||||
updates(skip:0, first:1){
|
||||
oldPrice
|
||||
newPrice
|
||||
newActive
|
||||
createdTimestamp
|
||||
tx
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The python script below can be used to run the the query. If you wish to change the network, then replace the value of variable `base_url` as needed. 
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Python" %}
|
||||
#### Create script
|
||||
|
||||
{% code title="list_fixed_rate_exchanges.py" %}
|
||||
```python
|
||||
import requests
|
||||
import json
|
||||
|
||||
|
||||
query = """
|
||||
{
|
||||
fixedRateExchanges(skip:0, first:2, subgraphError:deny){
|
||||
id
|
||||
contract
|
||||
exchangeId
|
||||
owner{id}
|
||||
datatoken{
|
||||
id
|
||||
name
|
||||
symbol
|
||||
}
|
||||
price
|
||||
datatokenBalance
|
||||
active
|
||||
totalSwapValue
|
||||
swaps(skip:0, first:1){
|
||||
tx
|
||||
by {
|
||||
id
|
||||
}
|
||||
baseTokenAmount
|
||||
dataTokenAmount
|
||||
createdTimestamp
|
||||
}
|
||||
updates(skip:0, first:1){
|
||||
oldPrice
|
||||
newPrice
|
||||
newActive
|
||||
createdTimestamp
|
||||
tx
|
||||
}
|
||||
}
|
||||
}"""
|
||||
|
||||
|
||||
base_url = "https://v4.subgraph.mainnet.oceanprotocol.com"
|
||||
route = "/subgraphs/name/oceanprotocol/ocean-subgraph"
|
||||
|
||||
url = base_url + route
|
||||
|
||||
headers = {"Content-Type": "application/json"}
|
||||
payload = json.dumps({"query": query})
|
||||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
result = json.loads(response.text)
|
||||
|
||||
print(json.dumps(result, indent=4, sort_keys=True))
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
#### Execute script
|
||||
|
||||
```
|
||||
python list_fixed_rate_exchanges.py
|
||||
```
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Sample response</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
"fixedRateExchanges": [
|
||||
{
|
||||
"active": true,
|
||||
"contract": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02",
|
||||
"datatoken": {
|
||||
"id": "0x9b39a17cc72c8be4813d890172eff746470994ac",
|
||||
"name": "Delightful Pelican Token",
|
||||
"symbol": "DELPEL-79"
|
||||
},
|
||||
"datatokenBalance": "0",
|
||||
"exchangeId": "0x06284c39b48afe5f01a04d56f1aae45dbb29793b190ee11e93a4a77215383d44",
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x06284c39b48afe5f01a04d56f1aae45dbb29793b190ee11e93a4a77215383d44",
|
||||
"owner": {
|
||||
"id": "0x03ef3f422d429bcbd4ee5f77da2917a699f237ed"
|
||||
},
|
||||
"price": "33",
|
||||
"swaps": [
|
||||
{
|
||||
"baseTokenAmount": "33.033",
|
||||
"by": {
|
||||
"id": "0x9b39a17cc72c8be4813d890172eff746470994ac"
|
||||
},
|
||||
"createdTimestamp": 1656563684,
|
||||
"dataTokenAmount": "1",
|
||||
"tx": "0x0b55482f69169c103563062e109f9d71afa01d18f201c425b24b1c74d3c282a3"
|
||||
}
|
||||
],
|
||||
"totalSwapValue": "0",
|
||||
"updates": []
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"contract": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02",
|
||||
"datatoken": {
|
||||
"id": "0x2cf074e36a802241f2f8ddb35f4a4557b8f1179b",
|
||||
"name": "Arcadian Eel Token",
|
||||
"symbol": "ARCEEL-17"
|
||||
},
|
||||
"datatokenBalance": "0",
|
||||
"exchangeId": "0x2719862ebc4ed253f09088c878e00ef8ee2a792e1c5c765fac35dc18d7ef4deb",
|
||||
"id": "0xfa48673a7c36a2a768f89ac1ee8c355d5c367b02-0x2719862ebc4ed253f09088c878e00ef8ee2a792e1c5c765fac35dc18d7ef4deb",
|
||||
"owner": {
|
||||
"id": "0x87b5606fba13529e1812319d25c6c2cd5c3f3cbc"
|
||||
},
|
||||
"price": "35",
|
||||
"swaps": [],
|
||||
"totalSwapValue": "0",
|
||||
"updates": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
@ -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)).
|
||||
|
||||
|
@ -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.
|
||||
|
@ -9,7 +9,9 @@ To report a bug that isn't a vulnerability, go to the relevant GitHub repository
|
||||
|
||||
Before reporting a bug, search existing open and closed issues and PRs to see if something has already been reported. If not, then go ahead and create a new bug report, following the structure suggested in the issue template.
|
||||
|
||||
To report a vulnerability, you may do so in a [less public manner](./vulnerabilities.md).
|
||||
## Report Vulnerabilities
|
||||
|
||||
You may be able to earn a bounty for reporting vulnerabilities in sensitive parts of our code. Check our page on [Immunify](https://immunefi.com/bounty/oceanprotocol/) for the latest bug bounties available. You can also responsibly disclose flaws by emailing us at <a href="mailto:security@oceanprotocol.com">security@oceanprotocol.com</a>.
|
||||
|
||||
## Suggest a new feature
|
||||
|
||||
@ -68,6 +70,12 @@ If you found a technical bug or have an improvement suggestion, head over to the
|
||||
|
||||
Really love building on Ocean and want to dive deeper? Consider joining us full time. Our openings are listed at https://github.com/oceanprotocol/devjobs.
|
||||
|
||||
## Get Funding
|
||||
|
||||
Funding can be for contributing to the core software, building apps, doing integrations, fixing bugs, community outreach, and more.
|
||||
|
||||
**[This page](https://www.oceanprotocol.com/fund)** has more information.
|
||||
|
||||
## Other ways to get involved
|
||||
|
||||
Please go to the [Ocean Community Page](https://www.oceanprotocol.com/community) for more ideas on how to get involved.
|
||||
|
@ -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
|
||||
|
||||
|