From bfe9615218963a9ed26c945b347cdd22ed1c2a51 Mon Sep 17 00:00:00 2001 From: "Matt, Park" <45252226+mattverse@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:42:42 +0900 Subject: [PATCH] feat: add external project integration section (#228) * feat: try adding external project * feat: try adding barebone * feat: add Integration External Project readme * feat: aDd external projects * feat: chagne to external projects --- docs/overview/endpoints/index.mdx | 4 +-- .../integrate/external_projects/README.md | 10 ++++++ .../integrate/external_projects/pyth.md | 35 +++++++++++++++++++ .../integrate/external_projects/subquery.md | 33 +++++++++++++++++ docs/overview/integrate/incentives.md | 6 ++-- 5 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 docs/overview/integrate/external_projects/README.md create mode 100644 docs/overview/integrate/external_projects/pyth.md create mode 100644 docs/overview/integrate/external_projects/subquery.md diff --git a/docs/overview/endpoints/index.mdx b/docs/overview/endpoints/index.mdx index 4f9ebcc2c..399061435 100644 --- a/docs/overview/endpoints/index.mdx +++ b/docs/overview/endpoints/index.mdx @@ -11,7 +11,7 @@ This section serves the purpose of different endpoints for different projects on ## Table of Contents [Endpoints](#endpoints) - [Mainnet Chain Endpoints](#mainnet-chain-endpoints) - - [Historical Data](#historical-data) + - [Historical Data / Indexed Data](#historical-data--indexed-data) - [Testnet Networks](#testnet-networks) - [Frontend](#frontend) - [Chain Registry](#chain-registry) @@ -36,7 +36,7 @@ Please visit [API Playground](/api) for more docs and to try interacting with th For more information how to integrate with each endpoints, please refer to the [integrate section](/overview/integrate) -## Historical Data +## Historical Data / Indexed Data Osmosis keeps indexed chain data in a separate endpoint: - [api.osmosis.zone](api.osmosis.zone) diff --git a/docs/overview/integrate/external_projects/README.md b/docs/overview/integrate/external_projects/README.md new file mode 100644 index 000000000..f3cbfce49 --- /dev/null +++ b/docs/overview/integrate/external_projects/README.md @@ -0,0 +1,10 @@ +# External Projects + +Osmosis supports integration with a diverse range of external projects. + +For detailed guidance on integration processes, please consult the links below: + +- Pyth: [How to Integrate with Pyth](./pyth.md) +- SubQuery: [How to Integrate with SubQuery](./subquery.md) + +If you represent a project interested in being listed, we welcome your contribution. Kindly submit a Pull Request at [github.com/osmosis-labs/docs](https://github.com/osmosis-labs/docs). \ No newline at end of file diff --git a/docs/overview/integrate/external_projects/pyth.md b/docs/overview/integrate/external_projects/pyth.md new file mode 100644 index 000000000..8a2ec585f --- /dev/null +++ b/docs/overview/integrate/external_projects/pyth.md @@ -0,0 +1,35 @@ +# Pyth + +## Introduction + +Pyth Network is an oracle that publishes financial market data to multiple blockchains. Our market data is contributed by over 90 first-party publishers(opens in a new tab), including some of the biggest exchanges and market making firms in the world. We offer price feeds for a number of different asset classes, including US equities, commodities, and cryptocurrencies(opens in a new tab). Each price feed publishes a robust aggregate of publisher prices that updates multiple times per second. + +## Pyth on Cosmwasm +Cosmwasm contracts can update and fetch the Pyth prices using the Pyth Cosmwasm Contract, deployed on their network. The documented source code can be found [here](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/cosmwasm/contracts/pyth). The Cosmwasm API reference lets you interactively explore the complete API of the Pyth contract. + + +## Update Price Feeds + +The mechanism by which price feeds are updated on Cosmwasm is explained in the [Pyth documentation](https://docs.pyth.network/documentation/pythnet-price-feeds/pull-updates). The [`@pythnetwork/price-service-client` TypeScript package](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/client/js) can be used to fetch the latest price feed data which then can be passed to the contract as the `UpdatePriceFeeds` ExecuteMsg. + +Pyth publishes prices for two kinds of feeds: + +- **Stable price feeds** consist of prices generated on the pythnet blockchain. These feeds are available on both mainnet and testnet blockchains. Use stable feeds if you would like your test environment to be identical to your production environment. + +- **Edge price feeds** consist of prices generated on the pythtest blockchain, which is Pyth's test environment for new features. Consequently, these feeds are not as reliable as the stable feeds, and there are other differences as well (e.g., different price feed ids). These feeds are only available on testnets. + +## Examples + +- A minimal on-chain [contract example](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/cosmwasm/examples/cw-contract) which queries the Pyth contract. + +## Contract Address for `Osmosis Test 5` + +- Stable: `osmo1hpdzqku55lmfmptpyj6wdlugqs5etr6teqf7r4yqjjrxjznjhtuqqu5kdh` +- Beta: `osmo1lltupx02sj99suakmuk4sr4ppqf34ajedaxut3ukjwkv6469erwqtpg9t3` + +## Price Feed IDs + +The price feed IDs for stable and edge feeds are different and can be found at the following links: + +- [List of stable ids](https://pyth.network/developers/price-feed-ids#cosmwasm-stable) +- [List of beta ids](https://pyth.network/developers/price-feed-ids#cosmwasm-edge) diff --git a/docs/overview/integrate/external_projects/subquery.md b/docs/overview/integrate/external_projects/subquery.md new file mode 100644 index 000000000..3506a60c7 --- /dev/null +++ b/docs/overview/integrate/external_projects/subquery.md @@ -0,0 +1,33 @@ +# SubQuery + +## Intro + +SubQuery is a leading blockchain data indexer that provides developers with fast, flexible, universal, open source and decentralised APIs for web3 projects. SubQuery SDK allows developers to get rich indexed data and build intuitive and immersive decentralised applications in a faster and more efficient way. SubQuery supports 100+ ecosystems including Osmosis, Cosmos, Ethereum, Polygon, Polkadot, Algorand, NEAR, and Avalanche. + +Another one of SubQuery's competitive advantages is the ability to aggregate data not only within a chain but across multiple blockchains all within a single project. This allows the creation of feature-rich dashboard analytics, multi-chain block scanners, or projects that index IBC transactions across zones. + +Other advantages include superior performance with multiple RPC endpoint configurations, multi-worker capabilities and a configurable caching architecture. To find out more, visit our documentation. + +## Useful resources + +- SubQuery General Docs: +- Quick Start Guide: +- Osmosis Starter Project: +- SubQuery Osmosis Example Project: and article +- SubQuery Osmosis Workshop Recording: + +# Getting started + +Take a look at this SubQuery starter project that indexes all swaps on Osmosis' on-chain DEX. + +You can also follow along with this step-by-step guide to get familiar with SubQuery. + +## Running and Hosting your Osmosis SubQuery APIs + +SubQuery is open-source, meaning you have the freedom to run it in the following three ways: + +1. Locally on your own computer (or a cloud provider of your choosing), view the instructions on how to run SubQuery Locally. + +2. By publishing it to SubQuery's enterprise-level Managed Service, where we'll host your SubQuery project in production-ready services for mission-critical data with zero-downtime blue/green deployments. There even is a generous free tier. Find out how. + +3. By publishing it to the decentralised SubQuery Network, the most open, performant, reliable, and scalable data service for dApp developers. The SubQuery Network indexes and services data to the global community in an incentivised and verifiable way and supports Osmosis from launch. diff --git a/docs/overview/integrate/incentives.md b/docs/overview/integrate/incentives.md index a578d9898..ea33b70a2 100644 --- a/docs/overview/integrate/incentives.md +++ b/docs/overview/integrate/incentives.md @@ -5,16 +5,16 @@ sidebar_position: 7 Liquidity Providers on Osmosis receive swap fees by default, but can choose to bond to pools and receive additional liquidity incentives from many sources. -* [External Incentives](https://docs.osmosis.zone/overview/getting-started/#external-incentives) +* [External Incentives](#external-incentives) Osmosis allows for the permissionless creation of (external) liquidity mining gauges, allowing projects to add thier own rewards to further incentivize users to provide liquidity into a pool. -* [Internal Incentives](https://docs.osmosis.zone/overview/getting-started/#internal-incentives) +* [Internal Incentives](#internal-incentives) Osmosis allocates up to 20% of inflation to incentivize users to bond their liquidity on Osmosis. If a pool is included then it will be allocated a share of incentives based on several factors such as type of asset, swap fees generated in the pool, age of listing and sustained volumes. Osmosis currently only incentivises pools composed of a very limited set of tokens as of [Proposal 638](https://www.mintscan.io/osmosis/proposals/638). -* [Superfluid Staking](https://docs.osmosis.zone/overview/getting-started/#superfluid-staking) +* [Superfluid Staking](#superfluid-staking) If enabled on a pool, a portion of the OSMO within can also be staked. Providing additional security to Osmosis as well as giving the liquidity providers additional staking rewards and the ability to participate in governance. Superfluid staking is only available on Classic pools or full range Supercharged Pools.