diff --git a/bun.lockb b/bun.lockb index 15139a66..8c17c515 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/docs/api/01-overview.mdx b/docs/api/01-overview.mdx index 697cd7c7..32fa24fe 100644 --- a/docs/api/01-overview.mdx +++ b/docs/api/01-overview.mdx @@ -11,78 +11,125 @@ import LinkPreview from "@site/src/components/LinkPreview"; Sablier relies on specific dependencies to source data or manage off-chain flows. All of these are either public or fully open-source, so feel free to roam around and suggest improvements or optimizations where needed. -## Subgraphs and Indexers (GraphQL) +We document below: + +1. The [solutions](#solutions) we use to index and query data +2. The [product-to-protocol](#products) links between these solutions and the raw entities emitted by the contracts + +## Solutions + +![Banner Sablier APIs](/banner/docs-banner-apis.png) As an alternative to reading data from the contracts or listening to onchain events, we use a set of subgraphs and indexers. These act as a middleware between the chain and our interfaces and allow for caching, formatting and querying -data. +data. For more advanced features like merkle generation (used in Drops) we've written out own SDKs and open sourced some +of them. -### The Graph's Subgraphs +:::tip Playground -[The Graph](https://thegraph.com/) has been the vendor of choice for the EVM space for the past few years. We've been -integrating The Graph since 2019 with Sablier V1. For Sablier Lockup, we designed a special set of feature-oriented -subgraphs used not only by us (in the official apps) but by 3rd party services (e.g. snapshot) and integrators alike. +To preview the GraphQL APIs for subgraphs and indexers you can plug them into +[Hasura's](https://cloud.hasura.io/public/graphiql) online explorer. +[Here](https://cloud.hasura.io/public/graphiql?endpoint=https://api.studio.thegraph.com/query/57079/sablier-v2/version/latest)'s +an example setup for the `sablier-v2` mainnet subgraph inside Hasura's explorer. + +::: + +## Subgraphs + +### The Graph + +[The Graph](https://thegraph.com/) has been the vendor of choice in the EVM space for the past few years. We've been +integrating The Graph since 2019 with Sablier V1. For our current apps, we designed a special set of feature-oriented +subgraphs used internally as well as by 3rd party services (e.g. snapshot) and integrators alike. These subgraphs are hosted on The Graph Network, as well as on the The Graph Hosted Service. They can be used to query -Sablier data from the official [endpoints](/api/subgraphs/endpoints). Every network has its own subgraph endpoints. +Sablier data from the official [endpoints](/api/lockup/endpoints). Every network has its own subgraph endpoints. -Read more on the dedicated pages about our `protocol` and `merkle` [subgraphs](/api/subgraphs/endpoints) or check out -the [official vendor docs](https://thegraph.com/docs/en/quick-start/). +- [Lockup endpoints](/api/lockup/endpoints) +- [Lockup subgraph](https://github.com/sablier-labs/subgraphs/apps/lockup) (Vesting) +- [Flow endpoints](/api/flow/endpoints) +- [Flow subgraph](https://github.com/sablier-labs/subgraphs/apps/flow) (Payments) +- [Drops endpoints](/api/drops/endpoints) +- [Drops subgraph](https://github.com/sablier-labs/subgraphs/apps/merkle) (Drops, Airstreams) +- [The Graph docs](https://thegraph.com/docs/en/quick-start/) -### Envio's Indexers +### Envio [Envio](https://envio.dev/) offers a suite of fast and flexible tools to access onchain data. Their HyperIndex service provides for a similar GraphQL driven API to access cached data and serve it into our client interfaces. We designed a set of indexers that mimic the features and entities exposed by subgraphs and take advantage of the speed -and optimized environment configured through HyperIndex. Read more on the dedicated page about our `protocol-envio` and -`merkle-envio` [indexers](/api/indexers/endpoints). +and optimized environment configured through HyperIndex. All networks share the same indexer endpoint (for one indexer type), as Envio promotes a cross-chain indexing architecture. -:::tip - -Before diving into integrating Envio's indexer as a data source for your application, please read the -[main differences](/api/indexers/differences) between subgraphs and indexers (generally as well as applied to the -Sablier deployments). - -::: +- [Caveats](/api/caveats) between subgraphs and indexers +- [Lockup endpoints](/api/lockup/endpoints) +- [Lockup indexer](https://github.com/sablier-labs/subgraphs/apps/lockup-envio) (Vesting) +- [Flow endpoints](/api/lockup/endpoints) +- [Flow indexer](https://github.com/sablier-labs/subgraphs/apps/flow-envio) (Payments) +- [Drops endpoints](/api/drops/endpoints) +- [Drops indexer](https://github.com/sablier-labs/subgraphs/apps/merkle-envio) (Drops, Airstreams) +- [The Graph docs](https://thegraph.com/docs/en/quick-start/) -## Merkle API (Rust) +## Sablier SDKs -To support our Merkle distribution (a.k.a. [Airstreams](/apps/features/airstreams)) system we developed a backend -service called `@sablier/v2-merkle-api`. This backend deals with the validation, creation and management of Merkle -trees, used to define eligibility and claiming rules for Sablier's Airstream campaigns. +### Merkle API + +To support our merkle distribution ([Drops](/apps/features/drops) / Airstreams) system we developed a backend service +called `@sablier/merkle-api`. This API deals with the validation, creation and management of merkle trees, used to +define eligibility and claiming rules for Sablier's Airstream campaigns. This service is open-source and can be used by integrators as a plug-n-play solution to support (and even deploy) similar campaigns from their own dashboards. Read more on the dedicated page about the `merkle-api` -[backend](/api/merkle-api/intro). +[service](/api/drops/merkle-api/overview). + +- [Endpoints](/api/drops/endpoints) -## Explorer +## Products -To preview the GraphQL APIs for subgraphs and indexers you can plug them into -[Hasura's](https://cloud.hasura.io/public/graphiql) online explorer. -[Here](https://cloud.hasura.io/public/graphiql?endpoint=https://api.studio.thegraph.com/query/57079/sablier-v2/version/latest)'s -an example setup for the `sablier-v2` mainnet subgraph inside Hasura's explorer. +### Lockup + +The [vesting](/apps/features/vesting) side of the application will be powered by: + +- The `@sablier/subgraphs/apps/lockup` subgraph +- The `@sablier/subgraphs/apps/lockup-envio` indexer + +### Drops (Airstreams) + +The [drops](/apps/features/drops) side of the application will be powered by: + +- The `@sablier/subgraphs/apps/merkle` subgraph +- The `@sablier/subgraphs/apps/merkle-envio` indexer +- The `@sablier/merkle-api` rust service for drops + +These will work for both Airstreams and Instant Drops 🔜. + +### Flow + +The [payments](/apps/features/payments) side of the application will be powered by: + +- The `@sablier/subgraphs/apps/flow` subgraph +- The `@sablier/subgraphs/apps/flow-envio` indexer diff --git a/docs/api/05-development.mdx b/docs/api/05-development.mdx new file mode 100644 index 00000000..a023d41d --- /dev/null +++ b/docs/api/05-development.mdx @@ -0,0 +1,226 @@ +--- +id: "development" +sidebar_position: 5 +title: "Development" +--- + +import LinkPreview from "@site/src/components/LinkPreview"; + +## The Graph + +### Integrate + +To integrate the Sablier subgraphs or indexers into your own product, start from the official `@sablier/subgraphs` +repository. We recommend using: + +- [GraphQL Code Generator](https://the-guild.dev/graphql/codegen/docs/getting-started) to create types from your GraphQL + fragments and queries +- [TanStack Query](https://tanstack.com/query) to fetch results from the exposed endpoints. + + + +### Contribute + +To contribute to the V2 subgraphs or deploy your own, head over to the GitHub +[`subgraphs`](https://github.com/sablier-labs/subgraphs) repository. Get started by reviewing the `apps/lockup` +directory. + +To bootstrap a subgraph project, run the following commands. They will install the requisite dependencies and generate +the code for a Sepolia deployment. + +```bash +cd ./packages/core +yarn install +yarn setup:sepolia +``` + +To deploy a new subgraph on Sepolia: + +1. Create a new item using The Graph's hosted network +2. Add its name/endpoint under the `deploy:sepolia` script in `package.json` +3. Add your own Sablier contract addresses in `../constants/chains/sepolia.ts` +4. Make sure you're [authenticated][the-graph-auth] on your local machine +5. Run `yarn deploy:sepolia` + +You can read more about how the The Graph works in their [official docs][the-graph-docs]. + +To publish on the hosted service: + +1. [Authenticate](https://thegraph.com/docs/en/deploying/hosted-service/) with the hosted service credentials + + ``` + graph auth --product hosted-service + ``` + +2. Generate configuration + + Run `yarn deploy:` to generate imports, configurations and deploy in the same script. + +[the-graph-auth]: https://thegraph.com/docs/en/deploying/deploying-a-subgraph-to-hosted/#store-the-access-token +[the-graph-docs]: https://thegraph.com/docs/en/ + +## Envio + +### Integrate + +To integrate the Sablier indexers into your own product, start from the official `@sablier/subgraphs` repository. We +recommend using: + +- [GraphQL Code Generator](https://the-guild.dev/graphql/codegen/docs/getting-started) to create types from your GraphQL + fragments and queries +- [TanStack Query](https://tanstack.com/query) to fetch results from the exposed endpoints. + +If you're integrated the Sablier subgraphs, we recommend using request and response wrappers/middleware to format +results coming from Envio's indexer in the same shape as those from The Graph. Suggestions: + +1. Write queries in both systems (based on the [querying language specifics](differences#querying-language)) using the + same `operationName` and swap query strings between vendors based on it +2. Write response middleware that converts results into similar shapes (see these [important notes](differences)) + + + +### Test + +To ensure Envio indexers deliver the same data as The Graph's subgraphs, we've written differential tests over our +indexer configurations. + +Check them out inside the `apps/[...]/test/` folders. + + + +#### Run + +The differentials tests are powered by Jest. Inside `test/setup/constants.ts`, you will find the full configuration for +these tests. This is where you'll also be able to toggle between using the local endpoint (see +[development](/api/development) to bootstrap a project locally) and the hosted-service one, using the `REMOTE` flag. + +```bash +pnpm run test +``` + +:::info + +As the set of streams or campaigns grows, the final tests (full coverage over the entire list of elements) may time out. +We suggest either splitting them in chunks or setting a manual limit to the number of iterations the loop can cover at +once. Alternatively, you could also try increasing the timeout of the tests. + +::: + +### Contribute + +To contribute to the V2 indexers (Envio x Sablier) or deploy your own, head over to the GitHub +[`subgraphs`](https://github.com/sablier-labs/subgraphs) repository. Get started by reviewing the `apps/lockup-envio` +directory. + +To bootstrap an indexer project, run the following commands. They will install the requisite dependencies and generate +the code for a multi-chain deployment. + +```bash +cd ./packages/core +pnpm install +pnpm run setup + +# OR + +pnpm dev +``` + +You'll find a local Hasura process at `http://localhost:8080` which also includes a `GraphQL` endpoint to query locally. +To deploy without hosting yourself, have a look at the Envio +[Hosted Service](https://docs.envio.dev/docs/hosted-service) docs. + +:::info + +Prior to starting the `Envio` process (`pnpm dev`) please make sure your Docker app is running. For installation see the +official docs at https://docs.envio.dev/. + +::: + +## Sablier SDK: Merkle API + +### Integrate + +To integrate the Sablier Merkle API into your own product, start from the official `@sablier/merkle-api` repository. We +recommend using: + + + +### Contribute + +To contribute to the V2 Merkle API or deploy your own, head over to the GitHub +[`merkle-api`](https://github.com/sablier-labs/merkle-api) repository. Get started by reviewing the `controllers` +directory. + +### Run an instance + +#### Locally + +In order to make the API work properly, you will need to create a `.env` file by following the `.env.example` file: + +```text +PINATA_ACCESS_TOKEN= +PINATA_API_KEY= +PINATA_API_SERVER= +PINATA_SECRET_API_KEY= +IPFS_GATEWAY= +``` + +After a campaign is created via the API, we use Pinata to upload and pin the file to IPFS. In order to obtain the +`PINATA_API_KEY`, `PINATA_SECRET_API_KEY` and `PINATA_ACCESS_TOKEN`, follow these steps: + +1. Sign up or log in on https://app.pinata.cloud/ +1. Select the API Keys tab +1. Select New Key +1. The key should have the permissions `pinFileToIPFS` and `pinJSONToIPFS` +1. Set a name for the key +1. Click Create Key +1. From the popup, take the API Key and the API Secret and put them in the `.env` file. The `IPFS_GATEWAY` variable can + be any IPFS gateway but we recommend using a private one (Pinata offers this as well). For more details about the + interactions with IPFS, check + [`src/services/ipfs.rs`](https://github.com/sablier-labs/merkle-api/blob/main/src/services/ipfs.rs). +1. Select the "Access Controls" tab +1. Click on the "Request Token" button +1. Copy the token and put in th `.env` file in the `PINATA_ACCESS_TOKEN` variable + +Simulate the cloud environment by finally running: + +```sh +$ cargo run --bin sablier_merkle_api +``` + +This command will run a standard web API and expose it on port 3000 on localhost. + +### Vercel + +We use Vercel for hosting, and this is why we have separate binaries for each endpoint. For local development, use this +command: + +```sh +$ vercel dev +``` + +This command will run a standard web API and expose it on port 3000 on localhost. + +If you wish to deploy your backend to vercel, check the official +[Github Actions](https://github.com/sablier-labs/merkle-api/blob/main/.github/workflows/deploy-merkle-api.yml) workflow +for deploying. Rust is supported through Vercel's [`rust runtime`](https://github.com/vercel-community/rust). diff --git a/docs/api/indexers/02-differences.mdx b/docs/api/06-differences.mdx similarity index 97% rename from docs/api/indexers/02-differences.mdx rename to docs/api/06-differences.mdx index 063c9ac7..5ed30319 100644 --- a/docs/api/indexers/02-differences.mdx +++ b/docs/api/06-differences.mdx @@ -1,10 +1,12 @@ --- -id: "differences" -sidebar_position: 1 -title: "Differences" +id: "caveats" +sidebar_position: 6 +title: "Caveats" --- -# Differences (The Graph vs. Envio) +# Caveats + +# The Graph vs. Envio :::warning @@ -120,7 +122,7 @@ they're unique across the board. At the same time, there are some minor features differences listed below. - For Envio indexers, entities will have fully specified identifiers (meaning chainId included) - 1. `protocol-envio`: the `Action`, `Asset`, `Batch`, `Batcher`, `Contract` have a `-chainId` appended to the ID + 1. `lockup-envio`: the `Action`, `Asset`, `Batch`, `Batcher`, `Contract` have a `-chainId` appended to the ID 2. `merkle-envio`: the `Action`, `Asset` and `Factory` have a `-chainId` appended to the ID While we've tried to refactor our The Graph entities to share similar identifiers, please double check in cases when you diff --git a/docs/api/07-legacy-v1.mdx b/docs/api/07-legacy-v1.mdx new file mode 100644 index 00000000..990c35ce --- /dev/null +++ b/docs/api/07-legacy-v1.mdx @@ -0,0 +1,69 @@ +--- +id: "legacy-v1" +sidebar_position: 7 +title: "Legacy V1" +--- + +import LinkPreview from "@site/src/components/LinkPreview"; + +# Sablier Legacy V1 + +For the [first version](/apps/v1) of Sablier ([v1-app](https://v1-app.sablier.com), +[v1-pay](https://v1-pay.sablier.com)) here are the subgraphs powering those dashboards. + +## The Graph + +### Endpoints + +| Chain | Id | Studio | Decentralized Network [^1] | +| --------------- | ----------------- | ----------------------------- | ----------------------------------- | +| Ethereum | sablier | [Studio][v1-studio-ethereum] | [De. Network][v1-network-ethereum] | +| Arbitrum | sablier-arbitrum | [Studio][v1-studio-arbitrum] | [De. Network][v1-network-arbitrum] | +| Optimism | sablier-optimism | [Studio][v1-studio-optimism] | [De. Network][v1-network-optimism] | +| Polygon | sablier-matic | [Studio][v1-studio-polygon] | [De. Network][v1-network-polygon] | +| Avalanche | sablier-avalanche | [Studio][v1-studio-avalanche] | [De. Network][v1-network-avalanche] | +| BNB Smart Chain | sablier-bsc | [Studio][v1-studio-bsc] | [De. Network][v1-network-bsc] | + +### Code + + + +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} + +[v1-network-ethereum]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/DkSXWkgJD5qVqfsrfzkLC5WELVX3Dbj3ByWcYjDJieCh +[v1-network-arbitrum]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/94SP9QVcxmGV9e2fxuTxUGcZfcv4tjpPCGyyPVyMfLP +[v1-network-optimism]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BEnQbvBdXnohC1DpM9rSb47C1FbowK39HfPNCEHjgrBt +[v1-network-bsc]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/3Gyy7of99oBRqHcCMGJXpHw2xxxZgXxVmFPFR1vL6YhT +[v1-network-avalanche]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/DK2gHCprwVaytwzwb5fUrkFS9xy7wh66NX6AFcDzMyF9 +[v1-network-polygon]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/6UMNQfMeh3pV5Qmn2NDX2UKNeUk9kh4oZhzzzn5e8rSz +[v1-studio-arbitrum]: https://api.studio.thegraph.com/query/57079/sablier-arbitrum/version/latest +[v1-studio-avalanche]: https://api.studio.thegraph.com/query/57079/sablier-avalanche/version/latest +[v1-studio-bsc]: https://api.studio.thegraph.com/query/57079/sablier-bsc/version/latest +[v1-studio-ethereum]: https://api.studio.thegraph.com/proxy/30310/sablier/version/latest/ +[v1-studio-optimism]: https://api.studio.thegraph.com/query/57079/sablier-optimism/version/latest +[v1-studio-polygon]: https://api.studio.thegraph.com/query/57079/sablier-polygon/version/latest + +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} + +[^1]: + Endpoints could include: The Graph's Decentralized Network (paid) or Custom Nodes (e.g. Lightlink). Because the + "Decentralized Network" subgraph flavors (e.g. V1 Ethereum) operate on The Graph Network, you will need to + substitute the `YOUR_API_KEY` placeholder in the + [Query URL](https://thegraph.com/docs/en/deploying/subgraph-studio-faqs/#6-how-do-i-find-query-urls-for-subgraphs-if-im-not-the-developer-of-the-subgraph-i-want-to-use) + with your own API key. If you require assistance with managing your API keys and configuring indexer preferences, + [this article](https://thegraph.com/docs/en/studio/managing-api-keys/) serves as an excellent guide diff --git a/docs/api/drops/01-overview.mdx b/docs/api/drops/01-overview.mdx new file mode 100644 index 00000000..60e48e00 --- /dev/null +++ b/docs/api/drops/01-overview.mdx @@ -0,0 +1,41 @@ +--- +id: "overview" +sidebar_position: 1 +title: "Overview" +--- + +import LinkPreview from "@site/src/components/LinkPreview"; + +# Drops + +Sablier's [lockup](/concepts/lockup/overview) streams are used for the [vesting](/apps/features/vesting) and (part of) +the [drops](/apps/features/drops) components of the Sablier Interfaces. The drops section, supported by our +[merkle](/concepts/lockup/airstreams) utilities focuses on the functionality of the merkle factory peripheries. + +For the drops-native functionality, these sides are powered by: + +- The `@sablier/subgraphs/apps/merkle` subgraph +- The `@sablier/subgraphs/apps/merkle-envio` indexer +- The `@sablier/merkle-api` sdk + +For the lockup-native functionality, please check the dedicated [documentation](/api/lockup/overview). + +:::note + +[Airstreamed](/apps/features/drops) drops, will reward users a lockup stream once a claim is made. + +::: + + + + diff --git a/docs/api/drops/02-endpoints.mdx b/docs/api/drops/02-endpoints.mdx new file mode 100644 index 00000000..509f173c --- /dev/null +++ b/docs/api/drops/02-endpoints.mdx @@ -0,0 +1,241 @@ +--- +id: "endpoints" +sidebar_position: 2 +title: "Endpoints" +--- + +import LinkPreview from "@site/src/components/LinkPreview"; + +# Drops / Airstreams + +## The Graph + +This subgraph tracks events emitted by the `@sablier/lockup-periphery` contracts, specifically the ones in charge of +merkle distributions. It deals with drops-specific actions like the factory creating an airstream campaign, admin +clawbacks, or users claiming stream NFTs as defined in the attached Merkle tree. + +Drops work in tandem with [vesting](/apps/features/vesting) as merkle distributions will produce new +[lockup](/api/lockup/overview) streams. Be sure to check out that part of the docs too. + +:::important + +Since The Graph has [sunset](https://thegraph.com/blog/sunsetting-hosted-service/) their Hosted Service we've +transitioned our subgraphs to either the Studio or The Decentralized Network (see +[supported networks](https://thegraph.com/docs/en/developing/supported-networks/) and our endpoints below). + +::: + +### Endpoints + +| Chain | Explorer | Studio[^2] | Decentralized Network[^1] | +| ---------------- | ----------------------------------------------------------------- | --------------------------------------- | --------------------------------------------- | +| Ethereum | [sablier-v2-ms][v2-explorer-ms-ethereum] | [Studio][v2-studio-ms-ethereum] | [De. Network][v2-network-ms-ethereum] | +| Arbitrum | [sablier-v2-ms-arbitrum][v2-explorer-ms-arbitrum] | [Studio][v2-studio-ms-arbitrum] | [De. Network][v2-network-ms-arbitrum] | +| Arbitrum Sepolia | [sablier-v2-ms-arbitrum-sepolia][v2-explorer-ms-arbitrum-sepolia] | [Studio][v2-studio-ms-arbitrum-sepolia] | [De. Network][v2-network-ms-arbitrum-sepolia] | +| Avalanche | [sablier-v2-ms-avalanche][v2-explorer-ms-avalanche] | [Studio][v2-studio-ms-avalanche] | [De. Network][v2-network-ms-avalanche] | +| Base | [sablier-v2-ms-base][v2-explorer-ms-base] | [Studio][v2-studio-ms-base] | [De. Network][v2-network-ms-base] | +| Blast | [sablier-v2-ms-blast][v2-explorer-ms-blast] | [Studio][v2-studio-ms-blast] | [De. Network][v2-network-ms-blast] | +| BNB Chain | [sablier-v2-ms-bsc][v2-explorer-ms-bsc] | [Studio][v2-studio-ms-bsc] | [De. Network][v2-network-ms-bsc] | +| Gnosis | [sablier-v2-ms-gnosis][v2-explorer-ms-gnosis] | [Studio][v2-studio-ms-gnosis] | [De. Network][v2-network-ms-gnosis] | +| Lightlink | [sablier-v2-ms-lightlink\*][v2-explorer-ms-lightlink] | N/A | [Lightlink Node\*][v2-custom-ms-lightlink] | +| Optimism | [sablier-v2-ms-optimism][v2-explorer-ms-optimism] | [Studio][v2-studio-ms-optimism] | [De. Network][v2-network-ms-optimism] | +| Optimism Sepolia | [sablier-v2-ms-optimism-sepolia][v2-explorer-ms-optimism-sepolia] | [Studio][v2-studio-ms-optimism-sepolia] | [De. Network][v2-network-ms-optimism-sepolia] | +| Polygon | [sablier-v2-ms-polygon][v2-explorer-ms-polygon] | [Studio][v2-studio-ms-polygon] | [De. Network][v2-network-ms-polygon] | +| Scroll | [sablier-v2-ms-scroll][v2-explorer-ms-scroll] | [Studio][v2-studio-ms-scroll] | [De. Network][v2-network-ms-scroll] | +| Sepolia | [sablier-v2-ms-sepolia][v2-explorer-ms-sepolia] | [Studio][v2-studio-ms-sepolia] | [De. Network][v2-network-ms-sepolia] | +| zkSync | [sablier-v2-ms-zksync][v2-explorer-ms-zksync] | [Studio][v2-studio-ms-zksync] | [De. Network][v2-network-ms-zksync] | + +### Code + + + +## Envio + +This indexers tracks the events emitted by the `@sablier/lockup-periphery` contracts, specifically the ones in charge of +merkle distributions. It deals with drops-specific actions like the factory creating an airstream campaign, admin +clawbacks, or users claiming stream NFTs as defined in the attached Merkle tree. + +:::tip Chains: Individual vs. Aggregated + +While subgraphs are chain-tethered (one subgraph endpoint per chain), Envio indexes all chains within the same +deployment. The data from all of chains that Sablier is deployed on can be queried from a single endpoint. + +::: + +### Endpoints + +| Chain | Endpoint on the Hosted Network | +| ---------------- | --------------------------------------------------------------------- | +| All-Networks[^3] | [https://indexer.bigdevenergy.link/[...]/v1/graphql][endpoint-merkle] | + +The endpoint is meant to be plugged into a query client. Use +[Hasura's online explorer](https://cloud.hasura.io/public/graphiql?) to view the entities and query API. + +### Code + + + +## Sablier SDK: Merkle API + +Sablier's Airstreams rely on a pre-configured merkle tree. This data structure contains the list of recipients as well +as their individual claim details. We use the following service to create the merkle tree, as well as proofs for the +recipient's claims. + +### Endpoints + +| Host | Endpoint | +| ------- | ------------------------------ | +| Sablier | https://v2-services.vercel.app | + +### Code + + + +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} + +{/* Chain: Arbitrum */} + +[v2-network-ms-arbitrum]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/CPCMKbUFEM8CzVbfic1y34qKbTrKADX9Du9QxsAMAwqU +[v2-explorer-ms-arbitrum]: https://thegraph.com/explorer/subgraphs/CPCMKbUFEM8CzVbfic1y34qKbTrKADX9Du9QxsAMAwqU +[v2-studio-ms-arbitrum]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-arbitrum/version/latest + +{/* Chain: Arbitrum Sepolia */} + +[v2-network-ms-arbitrum-sepolia]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BBJgy9RANbViGedeWTrVpH2bwm22E3niEzWcqHPMGtna +[v2-explorer-ms-arbitrum-sepolia]: https://thegraph.com/explorer/subgraphs/BBJgy9RANbViGedeWTrVpH2bwm22E3niEzWcqHPMGtna +[v2-studio-ms-arbitrum-sepolia]: + https://api.studio.thegraph.com/query/57079/sablier-v2-ms-arbitrum-sepolia/version/latest + +{/* Chain: Avalanche */} + +[v2-network-ms-avalanche]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/2beDuAvmwbyFzJ95HAwfqNjnYT6nEnzbEfSNhfWGMyhJ +[v2-explorer-ms-avalanche]: https://thegraph.com/explorer/subgraphs/2beDuAvmwbyFzJ95HAwfqNjnYT6nEnzbEfSNhfWGMyhJ +[v2-studio-ms-avalanche]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-avalanche/version/latest + +{/* Chain: Base */} + +[v2-network-ms-base]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/DrfN5cbvcCmpQUSc5RE9T1UxtcnMREi1Rd2PgLzDZCo3 +[v2-explorer-ms-base]: https://thegraph.com/explorer/subgraphs/DrfN5cbvcCmpQUSc5RE9T1UxtcnMREi1Rd2PgLzDZCo3 +[v2-studio-ms-base]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-base/version/latest + +{/* Chain: Blast */} + +[v2-network-ms-blast]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/HVqkPvCRAvbxjx6YVmkk6w6rHPrqqtiymcGiQiMKPw8f +[v2-explorer-ms-blast]: https://thegraph.com/explorer/subgraphs/HVqkPvCRAvbxjx6YVmkk6w6rHPrqqtiymcGiQiMKPw8f +[v2-studio-ms-blast]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-blast/version/latest + +{/* Chain: BSC */} + +[v2-network-ms-bsc]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/8uU9qAw9fSzdjqebymGRXWCjtZ5DQCmUA6QzRA14ARpz +[v2-explorer-ms-bsc]: https://thegraph.com/explorer/subgraphs/8uU9qAw9fSzdjqebymGRXWCjtZ5DQCmUA6QzRA14ARpz +[v2-studio-ms-bsc]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-bsc/version/latest + +{/* Chain: Gnosis */} + +[v2-network-ms-gnosis]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/FViBHgu2TtaZZXspDBzACjuPYKtqVDysmH35pk3W3zJJ +[v2-explorer-ms-gnosis]: https://thegraph.com/explorer/subgraphs/FViBHgu2TtaZZXspDBzACjuPYKtqVDysmH35pk3W3zJJ +[v2-studio-ms-gnosis]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-gnosis/version/latest + +{/* Chain: Lightlink */} + +[v2-explorer-ms-lightlink]: + https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/sablier-v2-ms-lightlink/graphql +[v2-custom-ms-lightlink]: https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/sablier-v2-ms-lightlink + +{/* Chain: Mainnet | Ethereum */} + +[v2-explorer-ms-ethereum]: https://thegraph.com/explorer/subgraphs/FigCYTmdPtXbf4tgNiy5ZrtnYefz92hsMcwM4f9N5ZeZ +[v2-studio-ms-ethereum]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms/version/latest +[v2-network-ms-ethereum]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/FigCYTmdPtXbf4tgNiy5ZrtnYefz92hsMcwM4f9N5ZeZ + +{/* Chain: Optimism */} + +[v2-network-ms-optimism]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/7iSmF69W4mQqtx6EfWXXn5s27Hrdh72etsPKVC9iE62U +[v2-explorer-ms-optimism]: https://thegraph.com/explorer/subgraphs/7iSmF69W4mQqtx6EfWXXn5s27Hrdh72etsPKVC9iE62U +[v2-studio-ms-optimism]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-optimism/version/latest + +{/* Chain: Optimism Sepolia */} + +[v2-network-ms-optimism-sepolia]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/CG5QddHKoABuN6KHZHYTHL7upg2iPTMYxi35Ey7jspkX +[v2-explorer-ms-optimism-sepolia]: https://thegraph.com/explorer/subgraphs/CG5QddHKoABuN6KHZHYTHL7upg2iPTMYxi35Ey7jspkX +[v2-studio-ms-optimism-sepolia]: + https://api.studio.thegraph.com/query/57079/sablier-v2-ms-optimism-sepolia/version/latest + +{/* Chain: Polygon */} + +[v2-network-ms-polygon]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/4r2pC3iyLbzytNa5phat3SWdMEyXG8fmnf1K89D7zP2G +[v2-explorer-ms-polygon]: https://thegraph.com/explorer/subgraphs/4r2pC3iyLbzytNa5phat3SWdMEyXG8fmnf1K89D7zP2G +[v2-studio-ms-polygon]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-polygon/version/latest + +{/* Chain: Scroll */} + +[v2-network-ms-scroll]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/F1QnrgBpsVKtiVzkLisEC2PDo6cjzLoAy5HhPdFRdjW +[v2-explorer-ms-scroll]: https://thegraph.com/explorer/subgraphs/F1QnrgBpsVKtiVzkLisEC2PDo6cjzLoAy5HhPdFRdjW +[v2-studio-ms-scroll]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-scroll/version/latest + +{/* Chain: Sepolia */} + +[v2-network-ms-sepolia]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/8UVeHt7rHA27XZhViugaW4nStiN332dHTDWVTNBLCqPc +[v2-explorer-ms-sepolia]: https://thegraph.com/explorer/subgraphs/8UVeHt7rHA27XZhViugaW4nStiN332dHTDWVTNBLCqPc +[v2-studio-ms-sepolia]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-sepolia/version/latest + +{/* Chain: zkSync */} + +[v2-network-ms-zksync]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BboiKY7JCdznoqurdXRizL9UYD1YdQKajaj4gvUrPPEA +[v2-explorer-ms-zksync]: https://thegraph.com/explorer/subgraphs/BboiKY7JCdznoqurdXRizL9UYD1YdQKajaj4gvUrPPEA +[v2-studio-ms-zksync]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-zksync/version/latest + +{/* --------------------------------------------------------------------------------------------------------------------------------- */} + +[endpoint-merkle]: https://indexer.bigdevenergy.link/508d217/v1/graphql + +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} + +[^1]: + Endpoints could include the following types: (1) The Graph's Decentralized Network (paid) or (2) Custom Nodes (e.g. + Lightlink). Because the "Decentralized Network" subgraph flavors (e.g. V1 Ethereum) operate on The Graph Network, + you will need to substitute the `YOUR_API_KEY` placeholder in the + [Query URL](https://thegraph.com/docs/en/deploying/subgraph-studio-faqs/#6-how-do-i-find-query-urls-for-subgraphs-if-im-not-the-developer-of-the-subgraph-i-want-to-use) + with your own API key. If you require assistance with managing your API keys and configuring indexer preferences, + [this article](https://thegraph.com/docs/en/studio/managing-api-keys/) serves as an excellent guide + +[^2]: The Graph's Studio endpoints are considered for testing purposes and may be rate-limited + +[^3]: + All-Networks means most of the networks supported by Sablier, e.g., Mainnet, Optimism, Polygon, Sepolia. The full + list can be found [here](https://github.com/sablier-labs/subgraphs/tree/main/packages/constants/src). To add a new + chain to our Envio indexer, create a new list of contracts (`/addresses`) and import that configuration into our + bundles (see `/bundles`). diff --git a/docs/api/indexers/merkle/_category_.json b/docs/api/drops/_category_.json similarity index 53% rename from docs/api/indexers/merkle/_category_.json rename to docs/api/drops/_category_.json index 6cedbfd5..013d0e75 100644 --- a/docs/api/indexers/merkle/_category_.json +++ b/docs/api/drops/_category_.json @@ -1,5 +1,5 @@ { "collapsed": false, - "label": "Indexer: Merkle-Envio", + "label": "Drops", "position": 4 } diff --git a/docs/api/drops/envio/01-similarities.mdx b/docs/api/drops/envio/01-similarities.mdx new file mode 100644 index 00000000..f7c5b41c --- /dev/null +++ b/docs/api/drops/envio/01-similarities.mdx @@ -0,0 +1,19 @@ +--- +id: "similarities" +sidebar_position: 1 +title: "Similarities" +--- + +# Similarities + +Envio indexers are designed to mirror the functionality and structure of the The Graph subgraphs. + +For an introduction into the base Sablier primitives and some architectural choices, make sure to check out the +[merkle subgraph](/api/drops/the-graph/entities) before reading about the `merkle-envio` indexer. + +The same (or similar) entities are used throughout both The Graph and Envio setups, as well as protocol and merkle +deployments. + +- [Entities](/api/drops/the-graph/entities) +- [Structure](/api/drops/the-graph/structure) +- [Architecture and Data Flow](/api/lockup/the-graph/architecture) diff --git a/docs/api/indexers/merkle/02-queries.md b/docs/api/drops/envio/02-queries.md similarity index 94% rename from docs/api/indexers/merkle/02-queries.md rename to docs/api/drops/envio/02-queries.md index 5da9a9c7..1bda34e7 100644 --- a/docs/api/indexers/merkle/02-queries.md +++ b/docs/api/drops/envio/02-queries.md @@ -4,8 +4,8 @@ sidebar_position: 2 title: "Queries" --- -Building on top of the [entity structure](/api/subgraphs/merkle/entities) defined earlier, here are some common GraphQL -queries for fetching data from the Sablier V2 subgraph. +Building on top of the [entity structure](/api/drops/the-graph/entities) defined earlier, here are some common GraphQL +queries for fetching data from the Sablier subgraph. ### Recent streams diff --git a/docs/api/drops/envio/_category_.json b/docs/api/drops/envio/_category_.json new file mode 100644 index 00000000..84b76022 --- /dev/null +++ b/docs/api/drops/envio/_category_.json @@ -0,0 +1,5 @@ +{ + "collapsed": true, + "label": "Envio", + "position": 4 +} diff --git a/docs/api/merkle-api/01-intro.mdx b/docs/api/drops/merkle-api/01-overview.mdx similarity index 63% rename from docs/api/merkle-api/01-intro.mdx rename to docs/api/drops/merkle-api/01-overview.mdx index 34c05fc6..23f46fbd 100644 --- a/docs/api/merkle-api/01-intro.mdx +++ b/docs/api/drops/merkle-api/01-overview.mdx @@ -1,32 +1,32 @@ --- -id: "intro" +id: "overview" sidebar_position: 1 -title: "Introduction" +title: "Overview" --- import LinkPreview from "@site/src/components/LinkPreview"; ## Overview -Sablier's Airstreams rely on a pre-configured Merkle tree. This data structure contains the list of recipients as well -as their individual claim details. +Sablier's Drops rely on pre-configured merkle trees. This data structure contains the list of recipients as well as +their individual claim details. ### General data flow -It allows us to store minimal data at the contract level, while being able to cryptographically prove someone is +Trees allow us to store minimal data at the contract level, while being able to cryptographically prove someone is entitled to claim from the contract, using proofs generated with a separate off-chain dataset (and the onchain root). The root hash of the tree will be stored inside the deployed Airstream contract. The tree itself, as well as the initial list will be stored in an IPFS file. Any action such as checking for eligibility or requesting the claim details of a certain user will involve reading from -the IPFS file, generating proofs based on the Merkle tree and interacting with the contract using the data obtained +the IPFS file, generating proofs based on the merkle tree and interacting with the contract using the data obtained previously. ### Open-source solution To make this functionality available to both Sablier client interfaces and 3rd party integrators we've created a Rust -backend service called `v2-merkle-api`. Through a REST API, it provides access to creating, storing and reading from +backend service called `merkle-api`. Through a REST API, it provides access to creating, storing and reading from Airstream related Merkle trees. #### Integrations @@ -36,8 +36,8 @@ the backend in your own environment. We're keen to improve and optimize this ser be flagged directly in the Github repository. diff --git a/docs/api/merkle-api/02-functionality.mdx b/docs/api/drops/merkle-api/02-functionality.mdx similarity index 82% rename from docs/api/merkle-api/02-functionality.mdx rename to docs/api/drops/merkle-api/02-functionality.mdx index 0aa3a573..7835b45f 100644 --- a/docs/api/merkle-api/02-functionality.mdx +++ b/docs/api/drops/merkle-api/02-functionality.mdx @@ -1,7 +1,7 @@ --- id: "functionality" sidebar_position: 2 -title: "Functionality and API" +title: "Functionality" --- import LinkPreview from "@site/src/components/LinkPreview"; @@ -18,13 +18,7 @@ keys). Feel free to reach out for any guidance or feedback. -## Endpoints - -| Host | Endpoint | -| ------- | ------------------------------ | -| Sablier | https://v2-services.vercel.app | - ---- +The official endpoints can be seen in the [drops-endpoints](/api/drops/endpoints) registry. ## Create: `/api/create` @@ -56,13 +50,13 @@ the API deals with the padding of each value (with the decimals of the token) on ### Description -| | | -| :--------------- | --------------------------------------------------------------------------------------------------------------------------- | -| **Endpoint** | `/api/create` | -| **Method** | `POST` | -| **Query Params** | `{decimals: number}` | -| **Body** | `FormData` on `{data: File}` | -| **Response** | See in [Rust](https://github.com/sablier-labs/v2-merkle-api/blob/main/src/data_objects/response.rs#L22) Overview TS (below) | +| | | +| :--------------- | ------------------------------------------------------------------------------------------------------------------------ | +| **Endpoint** | `/api/create` | +| **Method** | `POST` | +| **Query Params** | `{decimals: number}` | +| **Body** | `FormData` on `{data: File}` | +| **Response** | See in [Rust](https://github.com/sablier-labs/merkle-api/blob/main/src/data_objects/response.rs#L22) Overview TS (below) | ```typescript type Response = { @@ -106,9 +100,9 @@ The `/api/create` route will perform the following actions: For more insight, check out the implementation details. @@ -129,20 +123,20 @@ This endpoint uses an authentication scheme. Please reach out if you need to use To check eligibility for an address, you'll be required to provide: - the address of the user -- the CID of the IPFS file (see the [create](/api/merkle-api/functionality#create-apicreate) flow above for context) the - campaign is linked to +- the CID of the IPFS file (see the [create](/api/drops/merkle-api/functionality#create-apicreate) flow above for + context) the campaign is linked to To get a hold of the second item you can see some options here in the -[Common flows](/api/merkle-api/examples#get-a-campaigns-cid) page. +[Common flows](/api/drops/merkle-api/examples#get-a-campaigns-cid) page. ### Description -| | | -| :--------------- | --------------------------------------------------------------------------------------------------------------------------- | -| **Endpoint** | `/api/eligibility` | -| **Method** | `GET` | -| **Query Params** | `{address: string, cid: string}` | -| **Response** | See in [Rust](https://github.com/sablier-labs/v2-merkle-api/blob/main/src/data_objects/response.rs#L32) Overview TS (below) | +| | | +| :--------------- | ------------------------------------------------------------------------------------------------------------------------ | +| **Endpoint** | `/api/eligibility` | +| **Method** | `GET` | +| **Query Params** | `{address: string, cid: string}` | +| **Response** | See in [Rust](https://github.com/sablier-labs/merkle-api/blob/main/src/data_objects/response.rs#L32) Overview TS (below) | ```typescript type Response = { @@ -169,9 +163,9 @@ The `/api/eligibility` route will perform the following actions: For more insight, check out the implementation details. @@ -189,17 +183,17 @@ To check eligibility for an address, you'll be required to provide: - the CID of the IPFS file the campaign is linked to -To get a hold of it you can see some options here in the [Common flows](/api/merkle-api/examples#get-a-campaigns-cid) -page. +To get a hold of it you can see some options here in the +[Common flows](/api/drops/merkle-api/examples#get-a-campaigns-cid) page. ### Description -| | | -| :--------------- | --------------------------------------------------------------------------------------------------------------------------- | -| **Endpoint** | `/api/validity` | -| **Method** | `GET` | -| **Query Params** | `{cid: string}` | -| **Response** | See in [Rust](https://github.com/sablier-labs/v2-merkle-api/blob/main/src/data_objects/response.rs#L41) Overview TS (below) | +| | | +| :--------------- | ------------------------------------------------------------------------------------------------------------------------ | +| **Endpoint** | `/api/validity` | +| **Method** | `GET` | +| **Query Params** | `{cid: string}` | +| **Response** | See in [Rust](https://github.com/sablier-labs/merkle-api/blob/main/src/data_objects/response.rs#L41) Overview TS (below) | ```typescript type Response = { @@ -226,8 +220,8 @@ The `/api/validity` route will perform the following actions: For more insight, check out the implementation details. diff --git a/docs/api/merkle-api/03-examples.mdx b/docs/api/drops/merkle-api/03-examples.mdx similarity index 86% rename from docs/api/merkle-api/03-examples.mdx rename to docs/api/drops/merkle-api/03-examples.mdx index 105cadd6..3c6979a8 100644 --- a/docs/api/merkle-api/03-examples.mdx +++ b/docs/api/drops/merkle-api/03-examples.mdx @@ -10,7 +10,7 @@ import Tabs from "@theme/Tabs"; # Examples of common flows Here are some common architectural flows you may need to integrate into your application. These include ways to gather -the prerequisite data necessary for each backend [functionality](/api/merkle-api/functionality) described earlier. +the prerequisite data necessary for each backend [functionality](/api/drops/merkle-api/functionality) described earlier. ## Get a campaign's CID @@ -21,7 +21,7 @@ To get a hold of a campaign's IPFS CID you can: Check the [create](/reference/lockup/periphery/interfaces/interface.ISablierV2MerkleLockupFactory#events) events emitted by the Merkle factory -
  • Use the Sablier V2 [subgraphs / indexers](/api/overview) to query for that particular piece of information.
  • +
  • Use the Sablier [subgraphs / indexers](/api/overview) to query for that particular piece of information.
  • For approach "B", run the following query against the official endpoints: @@ -64,7 +64,7 @@ For approach "B", run the following query against the official endpoints: ## Check eligibility for an address To check if an address is eligible, you'll have to use the [/api/eligibility](functionality#eligibility-apieligibility) -route provided by the v2-merkle-api backend. +route provided by the merkle-api backend. #### Steps @@ -90,7 +90,7 @@ To get a hold of a `tokenId` linked to a claim you can: Listen to the [claim](/reference/lockup/periphery/interfaces/interface.ISablierV2MerkleLL#claim) method and the Claim event emitted by the Merkle contract instance -
  • Use the Sablier V2 [subgraphs / indexers](/api/overview) to query for that particular piece of information.
  • +
  • Use the Sablier [subgraphs / indexers](/api/overview) to query for that particular piece of information.
  • For approach "B", run the following query against the official endpoints (make sure the address is lowercased): @@ -167,7 +167,7 @@ To check if a user has already claimed their stream from a campaign you can: Call the [hasClaimed](/reference/lockup/periphery/interfaces/interface.ISablierV2MerkleLockup#hasclaimed) method form the Merkle contract instance -
  • Use the Sablier V2 [subgraphs / indexers](/api/overview) to query for that particular piece of information.
  • +
  • Use the Sablier [subgraphs / indexers](/api/overview) to query for that particular piece of information.
  • #### Approach A @@ -175,9 +175,9 @@ To check if a user has already claimed their stream from a campaign you can: For approach "A" you'll need to perform the following actions: 1. Get a hold of the campaign's CID, lockup contract and user address (for the first items, see the - [Get a campaign's CID](/api/merkle-api/examples#get-a-campaigns-cid) example above) -2. Check the eligibility of a user (see [Eligibility](/api/merkle-api/examples#check-eligibility-for-an-address) example - above) and extract their `index` + [Get a campaign's CID](/api/drops/merkle-api/examples#get-a-campaigns-cid) example above) +2. Check the eligibility of a user (see [Eligibility](/api/drops/merkle-api/examples#check-eligibility-for-an-address) + example above) and extract their `index` 3. Call the `hasClaimed` method inside the `lockup` contract using the `index` retrieved at step 2 :::note @@ -190,8 +190,8 @@ generate a proof in case the recipient is eligible and to register their claim d #### Approach B For approach "B", run the same query as in the -[Get the tokenId after a claim](/api/merkle-api/examples#get-the-tokenid-after-a-claim) example. If the query yields any -results, that means the user has claimed their stream. +[Get the tokenId after a claim](/api/drops/merkle-api/examples#get-the-tokenid-after-a-claim) example. If the query +yields any results, that means the user has claimed their stream. :::tip diff --git a/docs/api/drops/merkle-api/_category_.json b/docs/api/drops/merkle-api/_category_.json new file mode 100644 index 00000000..6e21f9b7 --- /dev/null +++ b/docs/api/drops/merkle-api/_category_.json @@ -0,0 +1,5 @@ +{ + "collapsed": true, + "label": "Merkle API", + "position": 5 +} diff --git a/docs/api/subgraphs/merkle/01-entities.mdx b/docs/api/drops/the-graph/01-entities.mdx similarity index 87% rename from docs/api/subgraphs/merkle/01-entities.mdx rename to docs/api/drops/the-graph/01-entities.mdx index 01680cd2..ecc60ca3 100644 --- a/docs/api/subgraphs/merkle/01-entities.mdx +++ b/docs/api/drops/the-graph/01-entities.mdx @@ -1,21 +1,21 @@ --- id: "entities" sidebar_position: 1 -title: "Entities (+)" +title: "Entities" --- :::info For an introduction into the base Sablier primitives and some architectural choices, make sure to check out the -[protocol subgraph](/api/subgraphs/protocol/entities) before reading about the merkle subgraph. +[lockup subgraph](/api/lockup/the-graph/entities) before reading about the merkle subgraph. ::: ## Entity Architecture Inside the **merkle** subgraph, the -[`schema.graphql`](https://github.com/sablier-labs/v2-subgraphs/blob/main/apps/merkle/schema.graphql) file is -responsible of defining the following Sablier entities: +[`schema.graphql`](https://github.com/sablier-labs/subgraphs/blob/main/apps/merkle/schema.graphql) file is responsible +of defining the following Sablier entities: ### Primary @@ -36,7 +36,7 @@ responsible of defining the following Sablier entities: ## Structure The structure of these entities is built on the same rules and mindset which was applied on the -[protocol entities](/api/subgraphs/protocol/structure). +[lockup entities](/api/lockup/the-graph/entities). ### Identifying @@ -63,7 +63,7 @@ name or an alias to be used in the URL. ::: -## Data Flow +## Architecture and Data Flow The data flow applied to this subgraph is identical to the one used in the -[protocol subgraph](/api/subgraphs/protocol/flow). +[lockup subgraph](/api/lockup/the-graph/architecture). diff --git a/docs/api/subgraphs/merkle/02-queries.md b/docs/api/drops/the-graph/02-queries.md similarity index 93% rename from docs/api/subgraphs/merkle/02-queries.md rename to docs/api/drops/the-graph/02-queries.md index 2e720694..cdc31768 100644 --- a/docs/api/subgraphs/merkle/02-queries.md +++ b/docs/api/drops/the-graph/02-queries.md @@ -4,8 +4,8 @@ sidebar_position: 2 title: "Queries" --- -Building on top of the [entity structure](/api/subgraphs/merkle/entities) defined earlier, here are some common GraphQL -queries for fetching data from the Sablier V2 subgraph. +Building on top of the [entity structure](/api/drops/the-graph/entities) defined earlier, here are some common GraphQL +queries for fetching data from the Sablier subgraph. ### Recent streams diff --git a/docs/api/drops/the-graph/_category_.json b/docs/api/drops/the-graph/_category_.json new file mode 100644 index 00000000..d24628e9 --- /dev/null +++ b/docs/api/drops/the-graph/_category_.json @@ -0,0 +1,5 @@ +{ + "collapsed": true, + "label": "The Graph", + "position": 3 +} diff --git a/docs/api/flow/01-overview.mdx b/docs/api/flow/01-overview.mdx new file mode 100644 index 00000000..be2d8c97 --- /dev/null +++ b/docs/api/flow/01-overview.mdx @@ -0,0 +1,24 @@ +--- +id: "overview" +sidebar_position: 1 +title: "Overview" +--- + +import LinkPreview from "@site/src/components/LinkPreview"; + +# Flow + +Sablier's [flow](/concepts/flow/overview) streams are used for the [payments](/apps/features/payments) component of the +Sablier Interfaces. + +For the flow-native functionality, these sides are powered by: + +- The `@sablier/subgraphs/apps/flow` subgraph +- The `@sablier/subgraphs/apps/flow-envio` indexer + + diff --git a/docs/api/flow/02-endpoints.mdx b/docs/api/flow/02-endpoints.mdx new file mode 100644 index 00000000..bbf671c7 --- /dev/null +++ b/docs/api/flow/02-endpoints.mdx @@ -0,0 +1,201 @@ +--- +id: "endpoints" +sidebar_position: 2 +title: "Endpoints" +--- + +import LinkPreview from "@site/src/components/LinkPreview"; + +# Lockup + +## The Graph + +This subgraph tracks events emitted by the `@sablier/flow` contracts. It deals with base protocol actions like creating, +depositing or voiding flow streams. + +:::important + +Since The Graph has [sunset](https://thegraph.com/blog/sunsetting-hosted-service/) their Hosted Service we've +transitioned our subgraphs to either the Studio or The Decentralized Network (see +[supported networks](https://thegraph.com/docs/en/developing/supported-networks/) and our endpoints below). + +::: + +### Endpoints + +| Chain | Explorer | Studio[^2] | Decentralized Network[^1] | +| ---------------- | --------------------------------------------------------------------- | ----------------------------------------- | ----------------------------------------------- | +| Ethereum | [sablier-v2-flow][v2-flow-explorer-ethereum] | [Studio][v2-flow-studio-ethereum] | [De. Network][v2-flow-network-ethereum] | +| Arbitrum | [sablier-v2-flow-arbitrum][v2-flow-explorer-arbitrum] | [Studio][v2-flow-studio-arbitrum] | [De. Network][v2-flow-network-arbitrum] | +| Arbitrum Sepolia | [sablier-v2-flow-arbitrum-sepolia][v2-flow-explorer-arbitrum-sepolia] | [Studio][v2-flow-studio-arbitrum-sepolia] | [De. Network][v2-flow-network-arbitrum-sepolia] | +| Avalanche | [sablier-v2-flow-avalanche][v2-flow-explorer-avalanche] | [Studio][v2-flow-studio-avalanche] | [De. Network][v2-flow-network-avalanche] | +| Base | [sablier-v2-flow-base][v2-flow-explorer-base] | [Studio][v2-flow-studio-base] | [De. Network][v2-flow-network-base] | +| Blast | [sablier-v2-flow-blast][v2-flow-explorer-blast] | [Studio][v2-flow-studio-blast] | [De. Network][v2-flow-network-blast] | +| BNB Chain | [sablier-v2-flow-bsc][v2-flow-explorer-bsc] | [Studio][v2-flow-studio-bsc] | [De. Network][v2-flow-network-bsc] | +| Gnosis | [sablier-v2-flow-gnosis][v2-flow-explorer-gnosis] | [Studio][v2-flow-studio-gnosis] | [De. Network][v2-flow-network-gnosis] | +| Lightlink | [sablier-v2-flow-lightlink\*][v2-flow-explorer-lightlink] | N/A | [Lightlink Node\*][v2-flow-custom-lightlink] | +| Optimism | [sablier-v2-flow-optimism][v2-flow-explorer-optimism] | [Studio][v2-flow-studio-optimism] | [De. Network][v2-flow-network-optimism] | +| Optimism Sepolia | [sablier-v2-flow-optimism-sepolia][v2-flow-explorer-optimism-sepolia] | [Studio][v2-flow-studio-optimism-sepolia] | [De. Network][v2-flow-network-optimism-sepolia] | +| Polygon | [sablier-v2-flow-polygon][v2-flow-explorer-polygon] | [Studio][v2-flow-studio-polygon] | [De. Network][v2-flow-network-polygon] | +| Scroll | [sablier-v2-flow-scroll][v2-flow-explorer-scroll] | [Studio][v2-flow-studio-scroll] | [De. Network][v2-flow-network-scroll] | +| Sepolia | [sablier-v2-flow-sepolia][v2-flow-explorer-sepolia] | [Studio][v2-flow-studio-sepolia] | [De. Network][v2-flow-network-sepolia] | +| zkSync | [sablier-v2-flow-zksync][v2-flow-explorer-zksync] | [Studio][v2-flow-studio-zksync] | [De. Network][v2-flow-network-zksync] | + +### Code + + + +## Envio + +:::tip Chains: Individual vs. Aggregated + +While subgraphs are chain-tethered (one subgraph endpoint per chain), Envio indexes all chains within the same +deployment. The data from all of chains that Sablier is deployed on can be queried from the same place. + +::: + +The `flow-envio` indexer tracks events emitted by the the `@sablier/flow` contracts. It deals with core protocol actions +like creating, depositing, or voiding flow streams. + +### Endpoints + +| Chain | Endpoint (Hosted Network) | +| ---------------- | ------------------------------------------------------------------- | +| All-Networks[^3] | [https://indexer.bigdevenergy.link/[...]/v1/graphql][endpoint-flow] | + +The endpoint is meant to be plugged into a query client. Use +[Hasura's online explorer](https://cloud.hasura.io/public/graphiql?) to view the entities and query API. + +### Code + + + +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} + +{/* Chain: Arbitrum */} + +[v2-flow-network-arbitrum]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-arbitrum]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-arbitrum]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow-arbitrum/version/latest + +{/* Chain: Arbitrum Sepolia */} + +[v2-flow-network-arbitrum-sepolia]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-arbitrum-sepolia]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-arbitrum-sepolia]: + https://api.studio.thegraph.com/query/57079/sablier-v2-flow-arbitrum-sepolia/version/latest + +{/* Chain: Avalanche */} + +[v2-flow-network-avalanche]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-avalanche]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-avalanche]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow-avalanche/version/latest + +{/* Chain: Base */} + +[v2-flow-network-base]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-base]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-base]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow-base/version/latest + +{/* Chain: Blast */} + +[v2-flow-network-blast]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-blast]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-blast]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow-blast/version/latest + +{/* Chain: BSC */} + +[v2-flow-network-bsc]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-bsc]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-bsc]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow-bsc/version/latest + +{/* Chain: Gnosis */} + +[v2-flow-network-gnosis]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-gnosis]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-gnosis]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow-gnosis/version/latest + +{/* Chain: Lightlink */} + +[v2-flow-explorer-lightlink]: + https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/sablier-v2-flow-lightlink/graphql +[v2-flow-custom-lightlink]: https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/sablier-v2-flow-lightlink + +{/* Chain: Mainnet | Ethereum */} + +[v2-flow-explorer-ethereum]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-ethereum]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow/version/latest +[v2-flow-network-ethereum]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ + +{/* Chain: Optimism */} + +[v2-flow-network-optimism]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-optimism]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-optimism]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow-optimism/version/latest + +{/* Chain: Optimism Sepolia */} + +[v2-flow-network-optimism-sepolia]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-optimism-sepolia]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-optimism-sepolia]: + https://api.studio.thegraph.com/query/57079/sablier-v2-flow-optimism-sepolia/version/latest + +{/* Chain: Polygon */} + +[v2-flow-network-polygon]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-polygon]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-polygon]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow-polygon/version/latest + +{/* Chain: Scroll */} + +[v2-flow-network-scroll]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-scroll]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-scroll]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow-scroll/version/latest + +{/* Chain: Sepolia */} + +[v2-flow-network-sepolia]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-sepolia]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-sepolia]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow-sepolia/version/latest + +{/* Chain: zkSync */} + +[v2-flow-network-zksync]: https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/__INSERT_ID__ +[v2-flow-explorer-zksync]: https://thegraph.com/explorer/subgraphs/__INSERT_ID__ +[v2-flow-studio-zksync]: https://api.studio.thegraph.com/query/57079/sablier-v2-flow-zksync/version/latest + +{/* --------------------------------------------------------------------------------------------------------------------------------- */} + +[endpoint-flow]: https://indexer.bigdevenergy.link/__INSERT_ID__/v1/graphql + +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} + +[^1]: + Endpoints could include the following types: (1) The Graph's Decentralized Network (paid) or (2) Custom Nodes (e.g. + Lightlink). Because the "Decentralized Network" subgraph flavors (e.g. V1 Ethereum) operate on The Graph Network, + you will need to substitute the `YOUR_API_KEY` placeholder in the + [Query URL](https://thegraph.com/docs/en/deploying/subgraph-studio-faqs/#6-how-do-i-find-query-urls-for-subgraphs-if-im-not-the-developer-of-the-subgraph-i-want-to-use) + with your own API key. If you require assistance with managing your API keys and configuring indexer preferences, + [this article](https://thegraph.com/docs/en/studio/managing-api-keys/) serves as an excellent guide + +[^2]: The Graph's Studio endpoints are considered for testing purposes and may be rate-limited + +[^3]: + All-Networks means most of the networks supported by Sablier, e.g., Mainnet, Optimism, Polygon, Sepolia. The full + list can be found [here](https://github.com/sablier-labs/subgraphs/tree/main/packages/constants/src). To add a new + chain to our Envio indexer, create a new list of contracts (`/addresses`) and import that configuration into our + bundles (see `/bundles`). diff --git a/docs/api/subgraphs/merkle/_category_.json b/docs/api/flow/_category_.json similarity index 57% rename from docs/api/subgraphs/merkle/_category_.json rename to docs/api/flow/_category_.json index 00b0e30d..63b6c805 100644 --- a/docs/api/subgraphs/merkle/_category_.json +++ b/docs/api/flow/_category_.json @@ -1,5 +1,5 @@ { "collapsed": false, - "label": "Subgraph: Merkle", + "label": "Flow", "position": 3 } diff --git a/docs/api/indexers/01-endpoints.mdx b/docs/api/indexers/01-endpoints.mdx deleted file mode 100644 index b4ff703e..00000000 --- a/docs/api/indexers/01-endpoints.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -id: "endpoints" -sidebar_position: 1 -title: "Endpoints" ---- - -import LinkPreview from "@site/src/components/LinkPreview"; - -:::tip Chains: Individual vs. Aggregated - -While subgraphs are chain-tethered (one subgraph endpoint per chain), Envio indexes all chains within the same -deployment. The data from all of chains that Sablier is deployed on can be queried from the same place. - -::: - -## Protocol-Envio - -The `protocol-envio` indexer mainly tracks events emitted by the -[`@sablier/v2-core`](/reference/lockup/core/contract.SablierV2LockupLinear) contracts. It deals with core protocol -actions like creating, withdrawing, or transferring streams. - -### Endpoints - -| Chain | Endpoint (Hosted Network) | -| ---------------- | ----------------------------------------------------------------------- | -| All-Networks[^1] | [https://indexer.bigdevenergy.link/[...]/v1/graphql][endpoint-protocol] | - -The endpoint is meant to be plugged into a query client. Use -[Hasura's online explorer](https://cloud.hasura.io/public/graphiql?) to view the entities and query API. - -### Code - - - -## Merkle-Envio (Airstreams) - -This subgraph tracks events emitted by the -[`@sablier/v2-periphery`](/reference/lockup/periphery/contract.SablierV2BatchLockup) contracts, specifically the -[`Merkle Factory`](/reference/lockup/periphery/contract.SablierV2MerkleLockupFactory). It deals with airstream-specific -actions like the factory creating a campaign, admin clawbacks, or users claiming streams as defined in the attached -Merkle tree. - -[endpoint-protocol]: https://indexer.bigdevenergy.link/9e37ca4/v1/graphql - -### Endpoints - -| Chain | Endpoint on the Hosted Network | -| ------------ | --------------------------------------------------------------------- | -| All-Networks | [https://indexer.bigdevenergy.link/[...]/v1/graphql][endpoint-merkle] | - -The endpoint is meant to be plugged into a query client. Use -[Hasura's online explorer](https://cloud.hasura.io/public/graphiql?) to view the entities and query API. - -[endpoint-merkle]: https://indexer.bigdevenergy.link/508d217/v1/graphql - -### Code - - - -[^1]: - All-Networks = most of the networks supported by Sablier, e.g., Mainnet, Optimism, Polygon, Sepolia. The full list - can be found [here](https://github.com/sablier-labs/v2-subgraphs/tree/main/packages/constants/src). To add a new - chain to our Envio indexer, create a new list of contracts (`/addresses`) and import that configuration into our - bundles (see `/bundles`). diff --git a/docs/api/indexers/05-development.mdx b/docs/api/indexers/05-development.mdx deleted file mode 100644 index 19567e3f..00000000 --- a/docs/api/indexers/05-development.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -id: "development" -sidebar_position: 5 -title: "Development" ---- - -import LinkPreview from "@site/src/components/LinkPreview"; - -## Integrating - -To integrate the Sablier V2 indexers into your own product, start from the official `@sablier/v2-subgraphs` repository. -We recommend using: - -- [GraphQL Code Generator](https://the-guild.dev/graphql/codegen/docs/getting-started) to create types from your GraphQL - fragments and queries -- [TanStack Query](https://tanstack.com/query) to fetch results from the exposed endpoints. - -If you're integrated the Sablier V2 subgraphs, we recommend using request and response wrappers/middleware to format -results coming from Envio's indexer in the same shape as those from The Graph. Suggestions: - -1. Write queries in both systems (based on the [querying language specifics](differences#querying-language)) using the - same `operationName` and swap query strings between vendors based on it -2. Write response middleware that converts results into similar shapes (see these [important notes](differences)) - - - -## Contributing - -To contribute to the V2 indexers (Envio x Sablier) or deploy your own, head over to the GitHub -[`v2-subgraphs`](https://github.com/sablier-labs/v2-subgraphs) repository. Get started by reviewing the -`apps/protocol-envio` directory. - -To bootstrap an indexer project, run the following commands. They will install the requisite dependencies and generate -the code for a multi-chain deployment. - -```bash -cd ./packages/core -pnpm install -pnpm run setup - -# OR - -pnpm dev -``` - -You'll find a local Hasura process at `http://localhost:8080` which also includes a `GraphQL` endpoint to query locally. -To deploy without hosting yourself, have a look at the Envio -[Hosted Service](https://docs.envio.dev/docs/hosted-service) docs. - -:::info - -Prior to starting the `Envio` process (`pnpm dev`) please make sure your Docker app is running. For installation see the -official docs at https://docs.envio.dev/. - -::: diff --git a/docs/api/indexers/06-testing.mdx b/docs/api/indexers/06-testing.mdx deleted file mode 100644 index c7b53046..00000000 --- a/docs/api/indexers/06-testing.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: "testing" -sidebar_position: 6 -title: "Testing" ---- - -import LinkPreview from "@site/src/components/LinkPreview"; - -## Integrating - -To ensure Envio indexers deliver the same data as The Graph's subgraphs, we've written differential tests over our -`merkle` and `protocol` configurations. - -Check them out inside the `apps/[...]/test/` folders. - - - -## Running - -The differentials tests are powered by Jest. Inside `test/setup/constants.ts`, you will find the full configuration for -these tests. This is where you'll also be able to toggle between using the local endpoint (see -[development](/api/indexers/development) to bootstrap a project locally) and the hosted-service one, using the `REMOTE` -flag. - -```bash -pnpm run test -``` - -:::info - -As the set of streams or campaigns grows, the final tests (full coverage over the entire list of elements) may time out. -We suggest either splitting them in chunks or setting a manual limit to the number of iterations the loop can cover at -once. Alternatively, you could also try increasing the timeout of the tests. - -::: diff --git a/docs/api/indexers/merkle/01-entities.mdx b/docs/api/indexers/merkle/01-entities.mdx deleted file mode 100644 index 90cdb549..00000000 --- a/docs/api/indexers/merkle/01-entities.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -id: "entities" -sidebar_position: 1 -title: "Entities (+)" ---- - -:::info - -For an introduction into the base Sablier primitives and some architectural choices, make sure to check out the -[protocol subgraph](/api/subgraphs/protocol/entities) before reading about the merkle indexer. - -The same (or similar) entities are used throughout both The Graph and Envio setups, as well as protocol and merkle -deployments. - -::: - -## Entity Architecture - -Entities mirror those used inside the `merkle` subgraph. Read more in the -[dedicated section](/api/subgraphs/merkle/entities). - -These are also defined in the `schema.graphql` file of each indexer. diff --git a/docs/api/indexers/protocol/01-entities.mdx b/docs/api/indexers/protocol/01-entities.mdx deleted file mode 100644 index dc7cf417..00000000 --- a/docs/api/indexers/protocol/01-entities.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -id: "entities" -sidebar_position: 1 -title: "Entities" ---- - -:::info - -For an introduction into the base Sablier primitives and some architectural choices, make sure to check out the -[protocol subgraph](/api/subgraphs/protocol/entities) before reading about the protocol-envio indexer. - -The same (or similar) entities are used throughout both The Graph and Envio setups, as well as protocol and merkle -deployments. - -::: - -## Entity Architecture - -Entities mirror those used inside the `protocol` subgraph. Read more in the -[dedicated section](/api/subgraphs/protocol/entities). - -These are also defined in the `schema.graphql` file of each indexer. diff --git a/docs/api/indexers/protocol/02-structure.mdx b/docs/api/indexers/protocol/02-structure.mdx deleted file mode 100644 index d90055f6..00000000 --- a/docs/api/indexers/protocol/02-structure.mdx +++ /dev/null @@ -1,8 +0,0 @@ ---- -id: "structure" -sidebar_position: 2 -title: "Structure" ---- - -The relationships between entities mirror those used inside the `protocol` subgraph. Read more in the -[dedicated section](/api/subgraphs/protocol/structure). diff --git a/docs/api/indexers/protocol/_category_.json b/docs/api/indexers/protocol/_category_.json deleted file mode 100644 index 7c6d02d7..00000000 --- a/docs/api/indexers/protocol/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "collapsed": false, - "label": "Indexer: Protocol-Envio", - "position": 3 -} diff --git a/docs/api/lockup/01-overview.mdx b/docs/api/lockup/01-overview.mdx new file mode 100644 index 00000000..f7bab84d --- /dev/null +++ b/docs/api/lockup/01-overview.mdx @@ -0,0 +1,24 @@ +--- +id: "overview" +sidebar_position: 1 +title: "Overview" +--- + +import LinkPreview from "@site/src/components/LinkPreview"; + +# Lockup + +Sablier's [lockup](/concepts/lockup/overview) streams are used for the [vesting](/apps/features/vesting) and (part of) +the [drops](/apps/features/drops) components of the Sablier Interfaces. + +For the lockup-native functionality, these sides are powered by: + +- The `@sablier/subgraphs/apps/lockup` subgraph +- The `@sablier/subgraphs/apps/lockup-envio` indexer + + diff --git a/docs/api/lockup/02-endpoints.mdx b/docs/api/lockup/02-endpoints.mdx new file mode 100644 index 00000000..cc3e8863 --- /dev/null +++ b/docs/api/lockup/02-endpoints.mdx @@ -0,0 +1,212 @@ +--- +id: "endpoints" +sidebar_position: 2 +title: "Endpoints" +--- + +import LinkPreview from "@site/src/components/LinkPreview"; + +# Lockup + +## The Graph + +This subgraph tracks events emitted by the `@sablier/lockup-core` contracts. It deals with base protocol actions like +creating, withdrawing or transferring lockup streams. + +:::important + +Since The Graph has [sunset](https://thegraph.com/blog/sunsetting-hosted-service/) their Hosted Service we've +transitioned our subgraphs to either the Studio or The Decentralized Network (see +[supported networks](https://thegraph.com/docs/en/developing/supported-networks/) and our endpoints below). + +::: + +### Endpoints + +| Chain | Explorer | Studio[^2] | Decentralized Network[^1] | +| ---------------- | ----------------------------------------------------------- | ------------------------------------ | ------------------------------------------ | +| Ethereum | [sablier-v2][v2-explorer-ethereum] | [Studio][v2-studio-ethereum] | [De. Network][v2-network-ethereum] | +| Arbitrum | [sablier-v2-arbitrum][v2-explorer-arbitrum] | [Studio][v2-studio-arbitrum] | [De. Network][v2-network-arbitrum] | +| Arbitrum Sepolia | [sablier-v2-arbitrum-sepolia][v2-explorer-arbitrum-sepolia] | [Studio][v2-studio-arbitrum-sepolia] | [De. Network][v2-network-arbitrum-sepolia] | +| Avalanche | [sablier-v2-avalanche][v2-explorer-avalanche] | [Studio][v2-studio-avalanche] | [De. Network][v2-network-avalanche] | +| Base | [sablier-v2-base][v2-explorer-base] | [Studio][v2-studio-base] | [De. Network][v2-network-base] | +| Blast | [sablier-v2-blast][v2-explorer-blast] | [Studio][v2-studio-blast] | [De. Network][v2-network-blast] | +| BNB Chain | [sablier-v2-bsc][v2-explorer-bsc] | [Studio][v2-studio-bsc] | [De. Network][v2-network-bsc] | +| Gnosis | [sablier-v2-gnosis][v2-explorer-gnosis] | [Studio][v2-studio-gnosis] | [De. Network][v2-network-gnosis] | +| Lightlink | [sablier-v2-lightlink\*][v2-explorer-lightlink] | N/A | [Lightlink Node\*][v2-custom-lightlink] | +| Optimism | [sablier-v2-optimism][v2-explorer-optimism] | [Studio][v2-studio-optimism] | [De. Network][v2-network-optimism] | +| Optimism Sepolia | [sablier-v2-optimism-sepolia][v2-explorer-optimism-sepolia] | [Studio][v2-studio-optimism-sepolia] | [De. Network][v2-network-optimism-sepolia] | +| Polygon | [sablier-v2-polygon][v2-explorer-polygon] | [Studio][v2-studio-polygon] | [De. Network][v2-network-polygon] | +| Scroll | [sablier-v2-scroll][v2-explorer-scroll] | [Studio][v2-studio-scroll] | [De. Network][v2-network-scroll] | +| Sepolia | [sablier-v2-sepolia][v2-explorer-sepolia] | [Studio][v2-studio-sepolia] | [De. Network][v2-network-sepolia] | +| zkSync | [sablier-v2-zksync][v2-explorer-zksync] | [Studio][v2-studio-zksync] | [De. Network][v2-network-zksync] | + +### Code + + + +## Envio + +:::tip Chains: Individual vs. Aggregated + +While subgraphs are chain-tethered (one subgraph endpoint per chain), Envio indexes all chains within the same +deployment. The data from all of chains that Sablier is deployed on can be queried from the same place. + +::: + +The `lockup-envio` indexer tracks events emitted by the the `@sablier/lockup-core` contracts. It deals with core +protocol actions like creating, withdrawing, or transferring lockup streams. + +### Endpoints + +| Chain | Endpoint (Hosted Network) | +| ---------------- | --------------------------------------------------------------------- | +| All-Networks[^3] | [https://indexer.bigdevenergy.link/[...]/v1/graphql][endpoint-lockup] | + +The endpoint is meant to be plugged into a query client. Use +[Hasura's online explorer](https://cloud.hasura.io/public/graphiql?) to view the entities and query API. + +### Code + + + +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} + +{/* Chain: Arbitrum */} + +[v2-network-arbitrum]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/8BnGPBojHycDxVo83LP468pUo4xDyCQbtTpHGZXR6SiB +[v2-explorer-arbitrum]: https://thegraph.com/explorer/subgraphs/8BnGPBojHycDxVo83LP468pUo4xDyCQbtTpHGZXR6SiB +[v2-studio-arbitrum]: https://api.studio.thegraph.com/query/57079/sablier-v2-arbitrum/version/latest + +{/* Chain: Arbitrum Sepolia */} + +[v2-network-arbitrum-sepolia]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BZYXgTYGe51dy5rW6LhrLN7PWSiAgRQoqSBJEiPpRN9K +[v2-explorer-arbitrum-sepolia]: https://thegraph.com/explorer/subgraphs/BZYXgTYGe51dy5rW6LhrLN7PWSiAgRQoqSBJEiPpRN9K +[v2-studio-arbitrum-sepolia]: https://api.studio.thegraph.com/query/57079/sablier-v2-arbitrum-sepolia/version/latest + +{/* Chain: Avalanche */} + +[v2-network-avalanche]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/FdVwZuMV43yCb1nPmjnLQwmzS58wvKuLMPzcZ4UWgWAc +[v2-explorer-avalanche]: https://thegraph.com/explorer/subgraphs/FdVwZuMV43yCb1nPmjnLQwmzS58wvKuLMPzcZ4UWgWAc +[v2-studio-avalanche]: https://api.studio.thegraph.com/query/57079/sablier-v2-avalanche/version/latest + +{/* Chain: Base */} + +[v2-network-base]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/3pxjsW9rbDjmZpoQWzc5CAo4vzcyYE9YQyTghntmnb1K +[v2-explorer-base]: https://thegraph.com/explorer/subgraphs/3pxjsW9rbDjmZpoQWzc5CAo4vzcyYE9YQyTghntmnb1K +[v2-studio-base]: https://api.studio.thegraph.com/query/57079/sablier-v2-base/version/latest + +{/* Chain: Blast */} + +[v2-network-blast]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BXoC2ToMZXnTmCjWftQRPh9zMyM7ysijMN54Nxzb2CEY +[v2-explorer-blast]: https://thegraph.com/explorer/subgraphs/BXoC2ToMZXnTmCjWftQRPh9zMyM7ysijMN54Nxzb2CEY +[v2-studio-blast]: https://api.studio.thegraph.com/query/57079/sablier-v2-blast/version/latest + +{/* Chain: BSC */} + +[v2-network-bsc]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BVyi15zcH5eUg5PPKfRDDesezMezh6cAkn8LPvh7MVAF +[v2-explorer-bsc]: https://thegraph.com/explorer/subgraphs/BVyi15zcH5eUg5PPKfRDDesezMezh6cAkn8LPvh7MVAF +[v2-studio-bsc]: https://api.studio.thegraph.com/query/57079/sablier-v2-bsc/version/latest + +{/* Chain: Gnosis */} + +[v2-network-gnosis]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/EXhNLbhCbsewJPx4jx5tutNXpxwdgng2kmX1J7w1bFyu +[v2-explorer-gnosis]: https://thegraph.com/explorer/subgraphs/EXhNLbhCbsewJPx4jx5tutNXpxwdgng2kmX1J7w1bFyu +[v2-studio-gnosis]: https://api.studio.thegraph.com/query/57079/sablier-v2-gnosis/version/latest + +{/* Chain: Lightlink */} + +[v2-explorer-lightlink]: https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/sablier-v2-lightlink/graphql +[v2-custom-lightlink]: https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/sablier-v2-lightlink + +{/* Chain: Mainnet | Ethereum */} + +[v2-explorer-ethereum]: https://thegraph.com/explorer/subgraphs/EuZZnhFtdCGqN2Zt7EMGYDqQKNrVuhJL63KAfwvF35bL +[v2-studio-ethereum]: https://api.studio.thegraph.com/query/57079/sablier-v2/version/latest +[v2-network-ethereum]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/EuZZnhFtdCGqN2Zt7EMGYDqQKNrVuhJL63KAfwvF35bL + +{/* Chain: Optimism */} + +[v2-network-optimism]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/6e6Dvs1yDpsWDDREZRqxGi54SVdvTNzUdKpKJxniKVrp +[v2-explorer-optimism]: https://thegraph.com/explorer/subgraphs/6e6Dvs1yDpsWDDREZRqxGi54SVdvTNzUdKpKJxniKVrp +[v2-studio-optimism]: https://api.studio.thegraph.com/query/57079/sablier-v2-optimism/version/latest + +{/* Chain: Optimism Sepolia */} + +[v2-network-optimism-sepolia]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/2a2JpbmBfQs78UEvQYXgweHetcZUPm9zXCjP69o5mTed +[v2-explorer-optimism-sepolia]: https://thegraph.com/explorer/subgraphs/2a2JpbmBfQs78UEvQYXgweHetcZUPm9zXCjP69o5mTed +[v2-studio-optimism-sepolia]: https://api.studio.thegraph.com/query/57079/sablier-v2-optimism-sepolia/version/latest + +{/* Chain: Polygon */} + +[v2-network-polygon]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/CsDNYv9XPUMP8vufuwDVKQrVhsxhzzRHezjLFFKZZbrx +[v2-explorer-polygon]: https://thegraph.com/explorer/subgraphs/CsDNYv9XPUMP8vufuwDVKQrVhsxhzzRHezjLFFKZZbrx +[v2-studio-polygon]: https://api.studio.thegraph.com/query/57079/sablier-v2-polygon/version/latest + +{/* Chain: Scroll */} + +[v2-network-scroll]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/HVcngokCByfveLwguuafrBC34xB65Ne6tpGrXHmqDSrh +[v2-explorer-scroll]: https://thegraph.com/explorer/subgraphs/HVcngokCByfveLwguuafrBC34xB65Ne6tpGrXHmqDSrh +[v2-studio-scroll]: https://api.studio.thegraph.com/query/57079/sablier-v2-scroll/version/latest + +{/* Chain: Sepolia */} + +[v2-network-sepolia]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/3JR9ixhdUxX5oc2Yjr6jkG4XUqDd4guy8niL6AYzDKss +[v2-explorer-sepolia]: https://thegraph.com/explorer/subgraphs/3JR9ixhdUxX5oc2Yjr6jkG4XUqDd4guy8niL6AYzDKss +[v2-studio-sepolia]: https://api.studio.thegraph.com/query/57079/sablier-v2-sepolia/version/latest + +{/* Chain: zkSync */} + +[v2-network-zksync]: + https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/GY2fGozmfZiZ3xF2MfevohLR4YGnyxGxAyxzi9zmU5bY +[v2-explorer-zksync]: https://thegraph.com/explorer/subgraphs/GY2fGozmfZiZ3xF2MfevohLR4YGnyxGxAyxzi9zmU5bY +[v2-studio-zksync]: https://api.studio.thegraph.com/query/57079/sablier-v2-zksync/version/latest + +{/* --------------------------------------------------------------------------------------------------------------------------------- */} + +[endpoint-lockup]: https://indexer.bigdevenergy.link/9e37ca4/v1/graphql + +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} +{/* --------------------------------------------------------------------------------------------------------------------------------- */} + +[^1]: + Endpoints could include the following types: (1) The Graph's Decentralized Network (paid) or (2) Custom Nodes (e.g. + Lightlink). Because the "Decentralized Network" subgraph flavors (e.g. V1 Ethereum) operate on The Graph Network, + you will need to substitute the `YOUR_API_KEY` placeholder in the + [Query URL](https://thegraph.com/docs/en/deploying/subgraph-studio-faqs/#6-how-do-i-find-query-urls-for-subgraphs-if-im-not-the-developer-of-the-subgraph-i-want-to-use) + with your own API key. If you require assistance with managing your API keys and configuring indexer preferences, + [this article](https://thegraph.com/docs/en/studio/managing-api-keys/) serves as an excellent guide + +[^2]: The Graph's Studio endpoints are considered for testing purposes and may be rate-limited + +[^3]: + All-Networks means most of the networks supported by Sablier, e.g., Mainnet, Optimism, Polygon, Sepolia. The full + list can be found [here](https://github.com/sablier-labs/subgraphs/tree/main/packages/constants/src). To add a new + chain to our Envio indexer, create a new list of contracts (`/addresses`) and import that configuration into our + bundles (see `/bundles`). diff --git a/docs/api/indexers/_category_.json b/docs/api/lockup/_category_.json similarity index 57% rename from docs/api/indexers/_category_.json rename to docs/api/lockup/_category_.json index 433a19bf..5196dae4 100644 --- a/docs/api/indexers/_category_.json +++ b/docs/api/lockup/_category_.json @@ -1,5 +1,5 @@ { "collapsed": false, - "label": "Indexers - Envio", + "label": "Lockup", "position": 2 } diff --git a/docs/api/lockup/envio/01-similarities.mdx b/docs/api/lockup/envio/01-similarities.mdx new file mode 100644 index 00000000..fe30c820 --- /dev/null +++ b/docs/api/lockup/envio/01-similarities.mdx @@ -0,0 +1,18 @@ +--- +id: "similarities" +sidebar_position: 1 +title: "Similarities" +--- + +# Similarities + +Envio indexers are designed to mirror the functionality and structure of the The Graph subgraphs. + +For an introduction into the base Sablier primitives and some architectural choices, make sure to check out the +[lockup subgraph](/api/lockup/the-graph/entities) before reading about the `lockup-envio` indexer. + +The same (or similar) entities are used throughout both The Graph and Envio setups, as well as lockup and merkle +deployments. + +- [Entities](/api/lockup/the-graph/entities) +- [Structure](/api/lockup/the-graph/structure) diff --git a/docs/api/indexers/protocol/03-flow.mdx b/docs/api/lockup/envio/02-architecture.mdx similarity index 83% rename from docs/api/indexers/protocol/03-flow.mdx rename to docs/api/lockup/envio/02-architecture.mdx index 539e21b9..6c93e4af 100644 --- a/docs/api/indexers/protocol/03-flow.mdx +++ b/docs/api/lockup/envio/02-architecture.mdx @@ -1,13 +1,13 @@ --- -id: "flow" +id: "architecture" sidebar_position: 3 -title: "Data flow" +title: "Architecture" --- ## Preparations The data flow applied to this indexer is identical to the one used in the -[protocol subgraph](/api/subgraphs/protocol/flow). +[lockup subgraph](/api/lockup/the-graph/architecture). Similar to The Graph, we start by pre-configuring a set of contracts. While Envio's indexer doesn't have the same [requirement](https://discord.com/channels/438038660412342282/438070183794573313/1153155902933831811) of pre-configuring @@ -17,14 +17,16 @@ at start. We'll ensure contracts have been initialized (see the `watcher.ts` helper) by making a call against the initializer at the start of each method. It should only come into play within the create handlers. -```ts title="protocol-envio/src/constants/chains/sepolia.ts" +```ts title="packages/constants/.../sepolia.ts" export let chainId = 11155111; /** It uses the same structure as the configuration files of the subgraphs */ ... ``` After setting up each chain, we'll aggregate configuration to feed into the `config.yaml` all at once, as Envio uses a -multi-chain approach instead of establishing a separate endpoint for each indexed chain. +multi-chain approach instead of establishing a separate endpoint for each indexed chain. Check +[`packages/constants/.../bundles`](https://github.com/sablier-labs/v2-subgraphs/tree/main/packages/constants/src/bundles) +to see how this works. to ## Configurations @@ -46,11 +48,11 @@ booting up the Envio dependencies and local node. Check the official Envio docs Sablier is a fast moving protocol, with a new deployment every few months. Up to this point we can already see V2.0 and V2.1 supported by the client interface and integrators. -To offer a backwards compatible subgraph (between Sablier Core/ Sablier Periphery **v2.0** and **v2.1**) we'll aggregate +To offer a backwards compatible subgraph (between Sablier Core/ Sablier Periphery **v2.0** and **v2.x**) we'll aggregate the ABIs of the two versions. This will cause the configuration file to contain similar events between different versions of Lockup contract. -Different from how we handle this for [subgraphs](/api/subgraphs/protocol/flow), `Lockup Linear`, `Lockup Dynamic` and +Different from how we handle this for [subgraphs](/apps/lockup/the-graph), `Lockup Linear`, `Lockup Dynamic` and `Lockup Tranched` will be bundled under the same `Lockup` contract tracker `config.yaml`. Versions of the protocol will be tracked separately, which is why we have `Lockup_V20` (v2.0) and `Lockup_V21` (v2.1) in our configuration. Later on, inside the handler logic, we'll separate contracts by flavor. diff --git a/docs/api/indexers/protocol/04-queries.md b/docs/api/lockup/envio/03-queries.mdx similarity index 92% rename from docs/api/indexers/protocol/04-queries.md rename to docs/api/lockup/envio/03-queries.mdx index b536861f..3fa0b3ec 100644 --- a/docs/api/indexers/protocol/04-queries.md +++ b/docs/api/lockup/envio/03-queries.mdx @@ -4,8 +4,8 @@ sidebar_position: 4 title: "Queries" --- -Building on top of the [entity structure](/api/indexers/protocol/structure) defined earlier, here are some common -GraphQL queries for fetching data from the Sablier V2 subgraph. +Building on top of the [entity structure](/api/lockup/the-graph/structure) defined earlier, here are some common GraphQL +queries for fetching data from the Sablier subgraph. ### Recent streams @@ -51,8 +51,8 @@ query getStreams($first: Int!, $subgraphId: numeric!) { ### Streams by sender (with support for the old V2.0) -To support both [proxy senders](/api/subgraphs/protocol/structure) (case 3) and -[native senders](/api/subgraphs/protocol/structure) (case 2) we query for: +To support both [proxy senders](/api/lockup/the-graph/structure) (case 3) and +[native senders](/api/lockup/the-graph/structure) (case 2) we query for: - streams where the connected account is the native sender - streams where the connected account is the proxender - the owner of the proxy labeled as a sender diff --git a/docs/api/lockup/envio/_category_.json b/docs/api/lockup/envio/_category_.json new file mode 100644 index 00000000..84b76022 --- /dev/null +++ b/docs/api/lockup/envio/_category_.json @@ -0,0 +1,5 @@ +{ + "collapsed": true, + "label": "Envio", + "position": 4 +} diff --git a/docs/api/subgraphs/protocol/01-entities.mdx b/docs/api/lockup/the-graph/01-entities.mdx similarity index 86% rename from docs/api/subgraphs/protocol/01-entities.mdx rename to docs/api/lockup/the-graph/01-entities.mdx index c8978108..d23f11f3 100644 --- a/docs/api/subgraphs/protocol/01-entities.mdx +++ b/docs/api/lockup/the-graph/01-entities.mdx @@ -6,13 +6,13 @@ title: "Entities" ## Entity Architecture -GraphQL entities defined by the Sablier subgraphs are meant to mirror the functionality exposed by our v2-core +GraphQL entities defined by the Sablier subgraphs are meant to mirror the functionality exposed by our core lockup contracts. To achieve this, events are stored as historical entries (e.g. Action) while also being used to mutate attributes for live entities (e.g. Stream). Inside the **protocol** subgraph, the -[`schema.graphql`](https://github.com/sablier-labs/v2-subgraphs/blob/main/apps/protocol/schema.graphql) file is -responsible of defining the following Sablier entities: +[`schema.graphql`](https://github.com/sablier-labs/subgraphs/blob/main/apps/lockup/schema.graphql) file is responsible +of defining the following Sablier entities: ### Primary @@ -29,6 +29,6 @@ responsible of defining the following Sablier entities: | Entity | Description | | ------- | --------------------------------------------------------------------------------------------------------------- | -| Batch | An entity grouping a set of stream created all at once (action done through the `v2-periphery`) | +| Batch | An entity grouping a set of stream created all at once (action done through the `lockup-periphery`) | | Batcher | An entity resolving 1:1 to a stream sender, in charge of managing the count of "batches" of streams one creates | | Watcher | A singleton data store for subgraph-level unique indexes such as the stream or action index | diff --git a/docs/api/subgraphs/protocol/02-structure.mdx b/docs/api/lockup/the-graph/02-structure.mdx similarity index 89% rename from docs/api/subgraphs/protocol/02-structure.mdx rename to docs/api/lockup/the-graph/02-structure.mdx index 05a84502..ad72828e 100644 --- a/docs/api/subgraphs/protocol/02-structure.mdx +++ b/docs/api/lockup/the-graph/02-structure.mdx @@ -4,8 +4,8 @@ sidebar_position: 2 title: "Structure" --- -We'll break down the [schema](https://github.com/sablier-labs/v2-subgraphs/blob/main/apps/core/schema.graphql) into -primary and secondary entities. +We'll break down the [schema](https://github.com/sablier-labs/subgraphs/blob/main/apps/core/schema.graphql) into primary +and secondary entities. | Type | Entities | | --------- | ------------------------------------------------- | @@ -44,8 +44,8 @@ Based on the schema defined `ActionCategory`, the following actions will be trac To keep all actions under the same umbrella, some details will be stored under general purpose attributes like `amountA`, `amountB`, `addressA`, `addressB` which based on the type of action can be resolved to context-specific values. Am example can be found -[here](https://github.com/sablier-labs/v2-subgraphs/blob/main/apps/protocol/src/mappings/handle-stream.ts#L79-L82) for -the Cancel event. +[here](https://github.com/sablier-labs/subgraphs/blob/main/apps/lockup/src/mappings/handle-stream.ts#L79-L82) for the +Cancel event. --- @@ -89,9 +89,9 @@ the following abbreviations as aliases: ### Relevant parties -Within the larger Sablier V2 ecosystem, the number of relevant entities participating in a stream (and the dynamics -between them) has grown past the immutable `sender` and `recipient` (as in V1). Therefore, we identify the following -parties involved in a stream. +Within the larger Sablier ecosystem, the number of relevant entities participating in a stream (and the dynamics between +them) has grown past the immutable `sender` and `recipient` (as in V1). Therefore, we identify the following parties +involved in a stream. #### The recipient (gets paid\*) @@ -126,8 +126,8 @@ you don't need to worry about `proxenders` and `proxy` if you're not looking to ::: [In V2.0] While not mandatory for the core functionality, Sablier made use of [PRBProxy](https://github.com/paulrberg/prb-proxy) -in its [periphery](https://github.com/sablier-labs/v2-periphery. The official client interfaces provided support for functionality -exposed through both EOAs and this proxy integration, at the same time. +in its architecture during V2.0. The official client interfaces provided support for functionality exposed through both EOAs +and this proxy integration, at the same time. For streams created within this "extended" ecosystem, a few attributes and entities will change meaning as such: @@ -192,10 +192,10 @@ artificially creating segments from tranches. ## Batch and Batcher -The v2-periphery, while not explicitly tracked by the subgraph will offer some extra functionality to proxy-sourced +The lockup-periphery, while not explicitly tracked by the subgraph will offer some extra functionality to proxy-sourced streams. One of these functionalities will be **batch stream creation** (or **stream grouping**). Using methods like -[`batchCreateWithRange`](https://github.com/sablier-labs/v2-periphery/blob/main/src/SablierV2ProxyTarget.sol) or -`batchCreateWithDeltas` a sender will be able to create multiple streams at once - considered part of the same batch. +`createWithDurations` or `createWithTimestamps` a sender will be able to create multiple streams at once - considered +part of the same batch. To identify these relationships between stream items, the `Batch` entity will group items created in the same transaction, by finding events emitted with the same tx hash. The `Batcher` will then assign a user-specific unique diff --git a/docs/api/subgraphs/protocol/03-flow.mdx b/docs/api/lockup/the-graph/03-architecture.mdx similarity index 91% rename from docs/api/subgraphs/protocol/03-flow.mdx rename to docs/api/lockup/the-graph/03-architecture.mdx index 789d385e..64b71f49 100644 --- a/docs/api/subgraphs/protocol/03-flow.mdx +++ b/docs/api/lockup/the-graph/03-architecture.mdx @@ -1,7 +1,7 @@ --- -id: "flow" +id: "architecture" sidebar_position: 3 -title: "Data flow" +title: "Architecture" --- ## Preparations @@ -12,10 +12,9 @@ factory pattern so we couldn't rely on a best things for a "genesis" point was to rely on the first event triggered by the earliest registered onchain contract To reduce the number of dependencies required to kickstart a subgraph, we chose to rely on this approach instead of -implementing a separate registry contract. Therefore, when setting up a deployment, you'll need to follow a few -[rules](https://github.com/sablier-labs/v2-subgraphs/blob/main/apps/protocol/src/constants/chains/sepolia.ts). +implementing a separate registry contract. Therefore, when setting up a deployment, you'll need to follow a few rules. -```ts title="protocol/src/constants/chains/sepolia.ts" +```ts title="packages/constants/.../sepolia.ts" export let chainId = 11155111; export let chain = "sepolia"; export let startBlock = 4067889; @@ -70,7 +69,7 @@ Using this data, we'll call the `yarn deploy:` script. In turn it wi Sablier is a fast moving protocol, with a new deployment every few months. Up to this point we can already see V2.0 and V2.1 supported by the client interface and integrators. -To offer a backwards compatible subgraph (between Sablier Core/ Sablier Periphery **v2.0** and **v2.1**) we'll aggregate +To offer a backwards compatible subgraph (between Sablier Core/ Sablier Periphery **v2.0** and **v2.x**) we'll aggregate the ABIs of the two versions. This will cause the Lockup Linear and Dynamic ABIs to contain multiple events with the same name, but different signatures (due to event parameters). diff --git a/docs/api/subgraphs/protocol/04-queries.md b/docs/api/lockup/the-graph/04-queries.md similarity index 91% rename from docs/api/subgraphs/protocol/04-queries.md rename to docs/api/lockup/the-graph/04-queries.md index d301238a..e37fdd69 100644 --- a/docs/api/subgraphs/protocol/04-queries.md +++ b/docs/api/lockup/the-graph/04-queries.md @@ -4,8 +4,8 @@ sidebar_position: 4 title: "Queries" --- -Building on top of the [entity structure](/api/subgraphs/protocol/structure) defined earlier, here are some common -GraphQL queries for fetching data from the Sablier V2 subgraph. +Building on top of the [entity structure](/api/lockup/the-graph/structure) defined earlier, here are some common GraphQL +queries for fetching data from the Sablier subgraph. ### Recent streams @@ -46,8 +46,8 @@ query getStreams($first: Int!, $subgraphId: numeric!) { ### Streams by sender (with support for the old V2.0) -To support both [proxy senders](/api/subgraphs/protocol/structure) (case 3) and -[native senders](/api/subgraphs/protocol/structure) (case 2) we query for: +To support both [proxy senders](/api/lockup/the-graph/structure) (case 3) and +[native senders](/api/lockup/the-graph/structure) (case 2) we query for: - streams where the connected account is the native sender - streams where the connected account is the proxender - the owner of the proxy labeled as a sender diff --git a/docs/api/lockup/the-graph/_category_.json b/docs/api/lockup/the-graph/_category_.json new file mode 100644 index 00000000..d24628e9 --- /dev/null +++ b/docs/api/lockup/the-graph/_category_.json @@ -0,0 +1,5 @@ +{ + "collapsed": true, + "label": "The Graph", + "position": 3 +} diff --git a/docs/api/merkle-api/04-development.mdx b/docs/api/merkle-api/04-development.mdx deleted file mode 100644 index 33cfda78..00000000 --- a/docs/api/merkle-api/04-development.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -id: "development" -sidebar_position: 4 -title: "Development" ---- - -import LinkPreview from "@site/src/components/LinkPreview"; - -## Integrating - -To integrate the Sablier V2 Merkle API into your own product, start from the official `@sablier/v2-merkle-api` -repository. We recommend using: - - - -## Contributing - -To contribute to the V2 Merkle API or deploy your own, head over to the GitHub -[`v2-merkle-api`](https://github.com/sablier-labs/v2-merkle-api) repository. Get started by reviewing the `controllers` -directory. - -## Running an instance - -### Locally - -In order to make the API work properly, you will need to create a `.env` file by following the `.env.example` file: - -```text -PINATA_ACCESS_TOKEN= -PINATA_API_KEY= -PINATA_API_SERVER= -PINATA_SECRET_API_KEY= -IPFS_GATEWAY= -``` - -After a campaign is created via the API, we use Pinata to upload and pin the file to IPFS. In order to obtain the -`PINATA_API_KEY`, `PINATA_SECRET_API_KEY` and `PINATA_ACCESS_TOKEN`, follow these steps: - -1. Sign up or log in on https://app.pinata.cloud/ -1. Select the API Keys tab -1. Select New Key -1. The key should have the permissions `pinFileToIPFS` and `pinJSONToIPFS` -1. Set a name for the key -1. Click Create Key -1. From the popup, take the API Key and the API Secret and put them in the `.env` file. The `IPFS_GATEWAY` variable can - be any IPFS gateway but we recommend using a private one (Pinata offers this as well). For more details about the - interactions with IPFS, check - [`src/services/ipfs.rs`](https://github.com/sablier-labs/v2-merkle-api/blob/main/src/services/ipfs.rs). -1. Select the "Access Controls" tab -1. Click on the "Request Token" button -1. Copy the token and put in th `.env` file in the `PINATA_ACCESS_TOKEN` variable - -Simulate the cloud environment by finally running: - -```sh -$ cargo run --bin sablier_merkle_api -``` - -This command will run a standard web API and expose it on port 3000 on localhost. - -### Vercel - -We use Vercel for hosting, and this is why we have separate binaries for each endpoint. For local development, use this -command: - -```sh -$ vercel dev -``` - -This command will run a standard web API and expose it on port 3000 on localhost. - -If you wish to deploy your backend to vercel, check the official -[Github Actions](https://github.com/sablier-labs/v2-merkle-api/blob/main/.github/workflows/deploy-merkle-api.yml) -workflow for deploying. Rust is supported through Vercel's [`rust runtime`](https://github.com/vercel-community/rust). diff --git a/docs/api/merkle-api/_category_.json b/docs/api/merkle-api/_category_.json deleted file mode 100644 index 03420cc2..00000000 --- a/docs/api/merkle-api/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "collapsed": false, - "label": "Merkle API - Airstreams", - "position": 4 -} diff --git a/docs/api/subgraphs/01-endpoints.mdx b/docs/api/subgraphs/01-endpoints.mdx deleted file mode 100644 index 5e9efc66..00000000 --- a/docs/api/subgraphs/01-endpoints.mdx +++ /dev/null @@ -1,347 +0,0 @@ ---- -id: "endpoints" -sidebar_position: 1 -title: "Endpoints" ---- - -import LinkPreview from "@site/src/components/LinkPreview"; - -## Sablier V2 - Protocol - -This subgraph tracks events mainly emitted by the -[`@sablier/v2-core`](/reference/lockup/core/contract.SablierV2LockupLinear) contracts. It deals with core protocol -actions like creating, withdrawing or transferring streams. - -:::important - -Since The Graph is [sunsetting](https://thegraph.com/blog/sunsetting-hosted-service/) their Hosted Service we've -transitioned our subgraphs to either the Studio or The Decentralized Network (see -[supported networks](https://thegraph.com/docs/en/developing/supported-networks/) and our endpoints below). - -::: - -### Endpoints - -| Chain | Explorer | Studio[^2] | Decentralized Network[^1] | -| ---------------- | ----------------------------------------------------------- | ------------------------------------ | ------------------------------------------ | -| Ethereum | [sablier-v2][v2-explorer-ethereum] | [Studio][v2-studio-ethereum] | [De. Network][v2-network-ethereum] | -| Arbitrum | [sablier-v2-arbitrum][v2-explorer-arbitrum] | [Studio][v2-studio-arbitrum] | [De. Network][v2-network-arbitrum] | -| Arbitrum Sepolia | [sablier-v2-arbitrum-sepolia][v2-explorer-arbitrum-sepolia] | [Studio][v2-studio-arbitrum-sepolia] | [De. Network][v2-network-arbitrum-sepolia] | -| Avalanche | [sablier-v2-avalanche][v2-explorer-avalanche] | [Studio][v2-studio-avalanche] | [De. Network][v2-network-avalanche] | -| Base | [sablier-v2-base][v2-explorer-base] | [Studio][v2-studio-base] | [De. Network][v2-network-base] | -| Blast | [sablier-v2-blast][v2-explorer-blast] | [Studio][v2-studio-blast] | [De. Network][v2-network-blast] | -| BNB Chain | [sablier-v2-bsc][v2-explorer-bsc] | [Studio][v2-studio-bsc] | [De. Network][v2-network-bsc] | -| Gnosis | [sablier-v2-gnosis][v2-explorer-gnosis] | [Studio][v2-studio-gnosis] | [De. Network][v2-network-gnosis] | -| Lightlink | [sablier-v2-lightlink\*][v2-explorer-lightlink] | N/A | [Lightlink Node\*][v2-custom-lightlink] | -| Optimism | [sablier-v2-optimism][v2-explorer-optimism] | [Studio][v2-studio-optimism] | [De. Network][v2-network-optimism] | -| Optimism Sepolia | [sablier-v2-optimism-sepolia][v2-explorer-optimism-sepolia] | [Studio][v2-studio-optimism-sepolia] | [De. Network][v2-network-optimism-sepolia] | -| Polygon | [sablier-v2-polygon][v2-explorer-polygon] | [Studio][v2-studio-polygon] | [De. Network][v2-network-polygon] | -| Scroll | [sablier-v2-scroll][v2-explorer-scroll] | [Studio][v2-studio-scroll] | [De. Network][v2-network-scroll] | -| Sepolia | [sablier-v2-sepolia][v2-explorer-sepolia] | [Studio][v2-studio-sepolia] | [De. Network][v2-network-sepolia] | -| zkSync | [sablier-v2-zksync][v2-explorer-zksync] | [Studio][v2-studio-zksync] | [De. Network][v2-network-zksync] | - -{/* Chain: Arbitrum */} - -[v2-network-arbitrum]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/8BnGPBojHycDxVo83LP468pUo4xDyCQbtTpHGZXR6SiB -[v2-explorer-arbitrum]: https://thegraph.com/explorer/subgraphs/8BnGPBojHycDxVo83LP468pUo4xDyCQbtTpHGZXR6SiB -[v2-studio-arbitrum]: https://api.studio.thegraph.com/query/57079/sablier-v2-arbitrum/version/latest - -{/* Chain: Arbitrum Sepolia */} - -[v2-network-arbitrum-sepolia]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BZYXgTYGe51dy5rW6LhrLN7PWSiAgRQoqSBJEiPpRN9K -[v2-explorer-arbitrum-sepolia]: https://thegraph.com/explorer/subgraphs/BZYXgTYGe51dy5rW6LhrLN7PWSiAgRQoqSBJEiPpRN9K -[v2-studio-arbitrum-sepolia]: https://api.studio.thegraph.com/query/57079/sablier-v2-arbitrum-sepolia/version/latest - -{/* Chain: Avalanche */} - -[v2-network-avalanche]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/FdVwZuMV43yCb1nPmjnLQwmzS58wvKuLMPzcZ4UWgWAc -[v2-explorer-avalanche]: https://thegraph.com/explorer/subgraphs/FdVwZuMV43yCb1nPmjnLQwmzS58wvKuLMPzcZ4UWgWAc -[v2-studio-avalanche]: https://api.studio.thegraph.com/query/57079/sablier-v2-avalanche/version/latest - -{/* Chain: Base */} - -[v2-network-base]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/3pxjsW9rbDjmZpoQWzc5CAo4vzcyYE9YQyTghntmnb1K -[v2-explorer-base]: https://thegraph.com/explorer/subgraphs/3pxjsW9rbDjmZpoQWzc5CAo4vzcyYE9YQyTghntmnb1K -[v2-studio-base]: https://api.studio.thegraph.com/query/57079/sablier-v2-base/version/latest - -{/* Chain: Blast */} - -[v2-network-blast]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BXoC2ToMZXnTmCjWftQRPh9zMyM7ysijMN54Nxzb2CEY -[v2-explorer-blast]: https://thegraph.com/explorer/subgraphs/BXoC2ToMZXnTmCjWftQRPh9zMyM7ysijMN54Nxzb2CEY -[v2-studio-blast]: https://api.studio.thegraph.com/query/57079/sablier-v2-blast/version/latest - -{/* Chain: BSC */} - -[v2-network-bsc]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BVyi15zcH5eUg5PPKfRDDesezMezh6cAkn8LPvh7MVAF -[v2-explorer-bsc]: https://thegraph.com/explorer/subgraphs/BVyi15zcH5eUg5PPKfRDDesezMezh6cAkn8LPvh7MVAF -[v2-studio-bsc]: https://api.studio.thegraph.com/query/57079/sablier-v2-bsc/version/latest - -{/* Chain: Gnosis */} - -[v2-network-gnosis]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/EXhNLbhCbsewJPx4jx5tutNXpxwdgng2kmX1J7w1bFyu -[v2-explorer-gnosis]: https://thegraph.com/explorer/subgraphs/EXhNLbhCbsewJPx4jx5tutNXpxwdgng2kmX1J7w1bFyu -[v2-studio-gnosis]: https://api.studio.thegraph.com/query/57079/sablier-v2-gnosis/version/latest - -{/* Chain: Lightlink */} - -[v2-explorer-lightlink]: https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/sablier-v2-lightlink/graphql -[v2-custom-lightlink]: https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/sablier-v2-lightlink - -{/* Chain: Mainnet | Ethereum */} - -[v2-explorer-ethereum]: https://thegraph.com/explorer/subgraphs/EuZZnhFtdCGqN2Zt7EMGYDqQKNrVuhJL63KAfwvF35bL -[v2-studio-ethereum]: https://api.studio.thegraph.com/query/57079/sablier-v2/version/latest -[v2-network-ethereum]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/EuZZnhFtdCGqN2Zt7EMGYDqQKNrVuhJL63KAfwvF35bL - -{/* Chain: Optimism */} - -[v2-network-optimism]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/6e6Dvs1yDpsWDDREZRqxGi54SVdvTNzUdKpKJxniKVrp -[v2-explorer-optimism]: https://thegraph.com/explorer/subgraphs/6e6Dvs1yDpsWDDREZRqxGi54SVdvTNzUdKpKJxniKVrp -[v2-studio-optimism]: https://api.studio.thegraph.com/query/57079/sablier-v2-optimism/version/latest - -{/* Chain: Optimism Sepolia */} - -[v2-network-optimism-sepolia]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/2a2JpbmBfQs78UEvQYXgweHetcZUPm9zXCjP69o5mTed -[v2-explorer-optimism-sepolia]: https://thegraph.com/explorer/subgraphs/2a2JpbmBfQs78UEvQYXgweHetcZUPm9zXCjP69o5mTed -[v2-studio-optimism-sepolia]: https://api.studio.thegraph.com/query/57079/sablier-v2-optimism-sepolia/version/latest - -{/* Chain: Polygon */} - -[v2-network-polygon]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/CsDNYv9XPUMP8vufuwDVKQrVhsxhzzRHezjLFFKZZbrx -[v2-explorer-polygon]: https://thegraph.com/explorer/subgraphs/CsDNYv9XPUMP8vufuwDVKQrVhsxhzzRHezjLFFKZZbrx -[v2-studio-polygon]: https://api.studio.thegraph.com/query/57079/sablier-v2-polygon/version/latest - -{/* Chain: Scroll */} - -[v2-network-scroll]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/HVcngokCByfveLwguuafrBC34xB65Ne6tpGrXHmqDSrh -[v2-explorer-scroll]: https://thegraph.com/explorer/subgraphs/HVcngokCByfveLwguuafrBC34xB65Ne6tpGrXHmqDSrh -[v2-studio-scroll]: https://api.studio.thegraph.com/query/57079/sablier-v2-scroll/version/latest - -{/* Chain: Sepolia */} - -[v2-network-sepolia]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/3JR9ixhdUxX5oc2Yjr6jkG4XUqDd4guy8niL6AYzDKss -[v2-explorer-sepolia]: https://thegraph.com/explorer/subgraphs/3JR9ixhdUxX5oc2Yjr6jkG4XUqDd4guy8niL6AYzDKss -[v2-studio-sepolia]: https://api.studio.thegraph.com/query/57079/sablier-v2-sepolia/version/latest - -{/* Chain: zkSync */} - -[v2-network-zksync]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/GY2fGozmfZiZ3xF2MfevohLR4YGnyxGxAyxzi9zmU5bY -[v2-explorer-zksync]: https://thegraph.com/explorer/subgraphs/GY2fGozmfZiZ3xF2MfevohLR4YGnyxGxAyxzi9zmU5bY -[v2-studio-zksync]: https://api.studio.thegraph.com/query/57079/sablier-v2-zksync/version/latest - -### Code - - - -## Sablier V2 - Airstreams - -This subgraph tracks the events emitted by the -[`@sablier/v2-periphery`](/reference/lockup/periphery/contract.SablierV2BatchLockup) contracts, specifically -[`MerkleFactory`](/reference/lockup/periphery/contract.SablierV2MerkleLockupFactory). It deals with airstream-specific -actions like the factory creating a campaign, admin clawbacks, or users claiming stream NFTs as defined in the attached -Merkle tree. - -### Endpoints - -| Chain | Explorer | Studio[^2] | Decentralized Network[^1] | -| ---------------- | ----------------------------------------------------------------- | --------------------------------------- | --------------------------------------------- | -| Ethereum | [sablier-v2-ms][v2-explorer-ms-ethereum] | [Studio][v2-studio-ms-ethereum] | [De. Network][v2-network-ms-ethereum] | -| Arbitrum | [sablier-v2-ms-arbitrum][v2-explorer-ms-arbitrum] | [Studio][v2-studio-ms-arbitrum] | [De. Network][v2-network-ms-arbitrum] | -| Arbitrum Sepolia | [sablier-v2-ms-arbitrum-sepolia][v2-explorer-ms-arbitrum-sepolia] | [Studio][v2-studio-ms-arbitrum-sepolia] | [De. Network][v2-network-ms-arbitrum-sepolia] | -| Avalanche | [sablier-v2-ms-avalanche][v2-explorer-ms-avalanche] | [Studio][v2-studio-ms-avalanche] | [De. Network][v2-network-ms-avalanche] | -| Base | [sablier-v2-ms-base][v2-explorer-ms-base] | [Studio][v2-studio-ms-base] | [De. Network][v2-network-ms-base] | -| Blast | [sablier-v2-ms-blast][v2-explorer-ms-blast] | [Studio][v2-studio-ms-blast] | [De. Network][v2-network-ms-blast] | -| BNB Chain | [sablier-v2-ms-bsc][v2-explorer-ms-bsc] | [Studio][v2-studio-ms-bsc] | [De. Network][v2-network-ms-bsc] | -| Gnosis | [sablier-v2-ms-gnosis][v2-explorer-ms-gnosis] | [Studio][v2-studio-ms-gnosis] | [De. Network][v2-network-ms-gnosis] | -| Lightlink | [sablier-v2-ms-lightlink\*][v2-explorer-ms-lightlink] | N/A | [Lightlink Node\*][v2-custom-ms-lightlink] | -| Optimism | [sablier-v2-ms-optimism][v2-explorer-ms-optimism] | [Studio][v2-studio-ms-optimism] | [De. Network][v2-network-ms-optimism] | -| Optimism Sepolia | [sablier-v2-ms-optimism-sepolia][v2-explorer-ms-optimism-sepolia] | [Studio][v2-studio-ms-optimism-sepolia] | [De. Network][v2-network-ms-optimism-sepolia] | -| Polygon | [sablier-v2-ms-polygon][v2-explorer-ms-polygon] | [Studio][v2-studio-ms-polygon] | [De. Network][v2-network-ms-polygon] | -| Scroll | [sablier-v2-ms-scroll][v2-explorer-ms-scroll] | [Studio][v2-studio-ms-scroll] | [De. Network][v2-network-ms-scroll] | -| Sepolia | [sablier-v2-ms-sepolia][v2-explorer-ms-sepolia] | [Studio][v2-studio-ms-sepolia] | [De. Network][v2-network-ms-sepolia] | -| zkSync | [sablier-v2-ms-zksync][v2-explorer-ms-zksync] | [Studio][v2-studio-ms-zksync] | [De. Network][v2-network-ms-zksync] | - -{/* Chain: Arbitrum */} - -[v2-network-ms-arbitrum]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/CPCMKbUFEM8CzVbfic1y34qKbTrKADX9Du9QxsAMAwqU -[v2-explorer-ms-arbitrum]: https://thegraph.com/explorer/subgraphs/CPCMKbUFEM8CzVbfic1y34qKbTrKADX9Du9QxsAMAwqU -[v2-studio-ms-arbitrum]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-arbitrum/version/latest - -{/* Chain: Arbitrum Sepolia */} - -[v2-network-ms-arbitrum-sepolia]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BBJgy9RANbViGedeWTrVpH2bwm22E3niEzWcqHPMGtna -[v2-explorer-ms-arbitrum-sepolia]: https://thegraph.com/explorer/subgraphs/BBJgy9RANbViGedeWTrVpH2bwm22E3niEzWcqHPMGtna -[v2-studio-ms-arbitrum-sepolia]: - https://api.studio.thegraph.com/query/57079/sablier-v2-ms-arbitrum-sepolia/version/latest - -{/* Chain: Avalanche */} - -[v2-network-ms-avalanche]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/2beDuAvmwbyFzJ95HAwfqNjnYT6nEnzbEfSNhfWGMyhJ -[v2-explorer-ms-avalanche]: https://thegraph.com/explorer/subgraphs/2beDuAvmwbyFzJ95HAwfqNjnYT6nEnzbEfSNhfWGMyhJ -[v2-studio-ms-avalanche]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-avalanche/version/latest - -{/* Chain: Base */} - -[v2-network-ms-base]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/DrfN5cbvcCmpQUSc5RE9T1UxtcnMREi1Rd2PgLzDZCo3 -[v2-explorer-ms-base]: https://thegraph.com/explorer/subgraphs/DrfN5cbvcCmpQUSc5RE9T1UxtcnMREi1Rd2PgLzDZCo3 -[v2-studio-ms-base]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-base/version/latest - -{/* Chain: Blast */} - -[v2-network-ms-blast]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/HVqkPvCRAvbxjx6YVmkk6w6rHPrqqtiymcGiQiMKPw8f -[v2-explorer-ms-blast]: https://thegraph.com/explorer/subgraphs/HVqkPvCRAvbxjx6YVmkk6w6rHPrqqtiymcGiQiMKPw8f -[v2-studio-ms-blast]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-blast/version/latest - -{/* Chain: BSC */} - -[v2-network-ms-bsc]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/8uU9qAw9fSzdjqebymGRXWCjtZ5DQCmUA6QzRA14ARpz -[v2-explorer-ms-bsc]: https://thegraph.com/explorer/subgraphs/8uU9qAw9fSzdjqebymGRXWCjtZ5DQCmUA6QzRA14ARpz -[v2-studio-ms-bsc]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-bsc/version/latest - -{/* Chain: Gnosis */} - -[v2-network-ms-gnosis]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/FViBHgu2TtaZZXspDBzACjuPYKtqVDysmH35pk3W3zJJ -[v2-explorer-ms-gnosis]: https://thegraph.com/explorer/subgraphs/FViBHgu2TtaZZXspDBzACjuPYKtqVDysmH35pk3W3zJJ -[v2-studio-ms-gnosis]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-gnosis/version/latest - -{/* Chain: Lightlink */} - -[v2-explorer-ms-lightlink]: - https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/sablier-v2-ms-lightlink/graphql -[v2-custom-ms-lightlink]: https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/sablier-v2-ms-lightlink - -{/* Chain: Mainnet | Ethereum */} - -[v2-explorer-ms-ethereum]: https://thegraph.com/explorer/subgraphs/FigCYTmdPtXbf4tgNiy5ZrtnYefz92hsMcwM4f9N5ZeZ -[v2-studio-ms-ethereum]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms/version/latest -[v2-network-ms-ethereum]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/FigCYTmdPtXbf4tgNiy5ZrtnYefz92hsMcwM4f9N5ZeZ - -{/* Chain: Optimism */} - -[v2-network-ms-optimism]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/7iSmF69W4mQqtx6EfWXXn5s27Hrdh72etsPKVC9iE62U -[v2-explorer-ms-optimism]: https://thegraph.com/explorer/subgraphs/7iSmF69W4mQqtx6EfWXXn5s27Hrdh72etsPKVC9iE62U -[v2-studio-ms-optimism]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-optimism/version/latest - -{/* Chain: Optimism Sepolia */} - -[v2-network-ms-optimism-sepolia]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/CG5QddHKoABuN6KHZHYTHL7upg2iPTMYxi35Ey7jspkX -[v2-explorer-ms-optimism-sepolia]: https://thegraph.com/explorer/subgraphs/CG5QddHKoABuN6KHZHYTHL7upg2iPTMYxi35Ey7jspkX -[v2-studio-ms-optimism-sepolia]: - https://api.studio.thegraph.com/query/57079/sablier-v2-ms-optimism-sepolia/version/latest - -{/* Chain: Polygon */} - -[v2-network-ms-polygon]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/4r2pC3iyLbzytNa5phat3SWdMEyXG8fmnf1K89D7zP2G -[v2-explorer-ms-polygon]: https://thegraph.com/explorer/subgraphs/4r2pC3iyLbzytNa5phat3SWdMEyXG8fmnf1K89D7zP2G -[v2-studio-ms-polygon]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-polygon/version/latest - -{/* Chain: Scroll */} - -[v2-network-ms-scroll]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/F1QnrgBpsVKtiVzkLisEC2PDo6cjzLoAy5HhPdFRdjW -[v2-explorer-ms-scroll]: https://thegraph.com/explorer/subgraphs/F1QnrgBpsVKtiVzkLisEC2PDo6cjzLoAy5HhPdFRdjW -[v2-studio-ms-scroll]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-scroll/version/latest - -{/* Chain: Sepolia */} - -[v2-network-ms-sepolia]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/8UVeHt7rHA27XZhViugaW4nStiN332dHTDWVTNBLCqPc -[v2-explorer-ms-sepolia]: https://thegraph.com/explorer/subgraphs/8UVeHt7rHA27XZhViugaW4nStiN332dHTDWVTNBLCqPc -[v2-studio-ms-sepolia]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-sepolia/version/latest - -{/* Chain: zkSync */} - -[v2-network-ms-zksync]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BboiKY7JCdznoqurdXRizL9UYD1YdQKajaj4gvUrPPEA -[v2-explorer-ms-zksync]: https://thegraph.com/explorer/subgraphs/BboiKY7JCdznoqurdXRizL9UYD1YdQKajaj4gvUrPPEA -[v2-studio-ms-zksync]: https://api.studio.thegraph.com/query/57079/sablier-v2-ms-zksync/version/latest - -### Code - - - -## Sablier V1 - -### Endpoints - -| Chain | Id | Studio | Decentralized Network [^1] | -| --------------- | ----------------- | ----------------------------- | ----------------------------------- | -| Ethereum | sablier | [Studio][v1-studio-ethereum] | [De. Network][v1-network-ethereum] | -| Arbitrum | sablier-arbitrum | [Studio][v1-studio-arbitrum] | [De. Network][v1-network-arbitrum] | -| Optimism | sablier-optimism | [Studio][v1-studio-optimism] | [De. Network][v1-network-optimism] | -| Polygon | sablier-matic | [Studio][v1-studio-polygon] | [De. Network][v1-network-polygon] | -| Avalanche | sablier-avalanche | [Studio][v1-studio-avalanche] | [De. Network][v1-network-avalanche] | -| BNB Smart Chain | sablier-bsc | [Studio][v1-studio-bsc] | [De. Network][v1-network-bsc] | - -[v1-network-ethereum]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/DkSXWkgJD5qVqfsrfzkLC5WELVX3Dbj3ByWcYjDJieCh -[v1-network-arbitrum]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/94SP9QVcxmGV9e2fxuTxUGcZfcv4tjpPCGyyPVyMfLP -[v1-network-optimism]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/BEnQbvBdXnohC1DpM9rSb47C1FbowK39HfPNCEHjgrBt -[v1-network-bsc]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/3Gyy7of99oBRqHcCMGJXpHw2xxxZgXxVmFPFR1vL6YhT -[v1-network-avalanche]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/DK2gHCprwVaytwzwb5fUrkFS9xy7wh66NX6AFcDzMyF9 -[v1-network-polygon]: - https://gateway-arbitrum.network.thegraph.com/api/API_KEY/subgraphs/id/6UMNQfMeh3pV5Qmn2NDX2UKNeUk9kh4oZhzzzn5e8rSz -[v1-studio-arbitrum]: https://api.studio.thegraph.com/query/57079/sablier-arbitrum/version/latest -[v1-studio-avalanche]: https://api.studio.thegraph.com/query/57079/sablier-avalanche/version/latest -[v1-studio-bsc]: https://api.studio.thegraph.com/query/57079/sablier-bsc/version/latest -[v1-studio-ethereum]: https://api.studio.thegraph.com/proxy/30310/sablier/version/latest/ -[v1-studio-optimism]: https://api.studio.thegraph.com/query/57079/sablier-optimism/version/latest -[v1-studio-polygon]: https://api.studio.thegraph.com/query/57079/sablier-polygon/version/latest - -### Code - - - -[^1]: - Endpoints could include: The Graph's Decentralized Network (paid) or Custom Nodes (e.g. Lightlink). Because the - "Decentralized Network" subgraph flavors (e.g. V1 Ethereum) operate on The Graph Network, you will need to - substitute the `YOUR_API_KEY` placeholder in the - [Query URL](https://thegraph.com/docs/en/deploying/subgraph-studio-faqs/#6-how-do-i-find-query-urls-for-subgraphs-if-im-not-the-developer-of-the-subgraph-i-want-to-use) - with your own API key. If you require assistance with managing your API keys and configuring indexer preferences, - [this article](https://thegraph.com/docs/en/studio/managing-api-keys/) serves as an excellent guide - -[^2]: The Graph's Studio endpoints are considered for testing purposes and may be rate-limited diff --git a/docs/api/subgraphs/04-development.mdx b/docs/api/subgraphs/04-development.mdx deleted file mode 100644 index b645ef9e..00000000 --- a/docs/api/subgraphs/04-development.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -id: "development" -sidebar_position: 4 -title: "Development" ---- - -import LinkPreview from "@site/src/components/LinkPreview"; - -## Integrating - -To integrate the Sablier V2 subgraph or indexers into your own product, start from the official `@sablier/v2-subgraphs` -repository. We recommend using: - -- [GraphQL Code Generator](https://the-guild.dev/graphql/codegen/docs/getting-started) to create types from your GraphQL - fragments and queries -- [TanStack Query](https://tanstack.com/query) to fetch results from the exposed endpoints. - - - -## Contributing - -To contribute to the V2 subgraphs or deploy your own, head over to the GitHub -[`v2-subgraphs`](https://github.com/sablier-labs/v2-subgraphs) repository. Get started by reviewing the `apps/protocol` -directory. - -To bootstrap a subgraph project, run the following commands. They will install the requisite dependencies and generate -the code for a Sepolia deployment. - -```bash -cd ./packages/core -yarn install -yarn setup:sepolia -``` - -To deploy a new subgraph on Sepolia: - -1. Create a new item using The Graph's hosted network -2. Add its name/endpoint under the `deploy:sepolia` script in `package.json` -3. Add your own Sablier V2 contract addresses in `../constants/chains/sepolia.ts` -4. Make sure you're [authenticated][the-graph-auth] on your local machine -5. Run `yarn deploy:sepolia` - -You can read more about how the The Graph works in their [official docs][the-graph-docs]. - -To publish on the hosted service: - -1. [Authenticate](https://thegraph.com/docs/en/deploying/hosted-service/) with the hosted service credentials - - ``` - graph auth --product hosted-service - ``` - -2. Generate configuration - - Run `yarn deploy:` to generate imports, configurations and deploy in the same script. - -[the-graph-auth]: https://thegraph.com/docs/en/deploying/deploying-a-subgraph-to-hosted/#store-the-access-token -[the-graph-docs]: https://thegraph.com/docs/en/ diff --git a/docs/api/subgraphs/_category_.json b/docs/api/subgraphs/_category_.json deleted file mode 100644 index a729c60f..00000000 --- a/docs/api/subgraphs/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "collapsed": false, - "label": "Subgraphs - The Graph", - "position": 1 -} diff --git a/docs/api/subgraphs/protocol/_category_.json b/docs/api/subgraphs/protocol/_category_.json deleted file mode 100644 index 4156418e..00000000 --- a/docs/api/subgraphs/protocol/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "collapsed": false, - "label": "Subgraph: Protocol", - "position": 2 -} diff --git a/docs/apps/01-overview.mdx b/docs/apps/01-overview.mdx deleted file mode 100644 index 99500d03..00000000 --- a/docs/apps/01-overview.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: "overview" -sidebar_position: 1 -title: "Overview" ---- - -# The Sablier Interface - -The best way to interact with the Sablier Protocols is through the official client interface. Visit our landing page at -[sablier.com](https://sablier.com) for a presentation of what the protocol can do, or go directly to -[app.sablier.com](https://app.sablier.com) to create your first stream. - -| [Example stream](https://app.sablier.com/stream/LL2-11155111-3/) | [Create stream](https://app.sablier.com/gallery/) | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| Stream profile | Create stream | - -## Features - -To get a grasp of what's possible with the Sablier interface, we've put together a primer on the core features of the -protocol which you can find [here](/apps/features/vesting). - -## Guides - -We've created a couple of tutorials and guides to help you interact with the client applications. From creating a stream -to withdrawing or setting up a group of stream with a [Safe multisig](https://safe.global), we've got you covered. - -[Go to guides](/apps/guides/url-schemes) - -## Sablier V1 - -The first version of the Sablier protocol will keep running in perpetuity thanks to the Ethereum blockchain, but the -Sablier interface is not compatible with the V1 protocol. We will keep hosting the legacy apps so that you can manage -any streams previously created on V1. - -- Sender interface: [v1-pay.sablier.com](https://v1-pay.sablier.com) -- Recipient interface: [v1-app.sablier.com](https://v1-app.sablier.com) diff --git a/docs/apps/04-legacy-v1.mdx b/docs/apps/04-legacy-v1.mdx new file mode 100644 index 00000000..b688af97 --- /dev/null +++ b/docs/apps/04-legacy-v1.mdx @@ -0,0 +1,14 @@ +--- +id: "v1" +sidebar_position: 4 +title: "Legacy V1" +--- + +## Sablier Legacy V1 + +The first version of the Sablier protocol will keep running in perpetuity thanks to the Ethereum blockchain, but the +current Sablier Interfaces are not compatible with the V1 protocol. We will keep hosting the legacy apps so that you can +manage any streams previously created on V1. + +- Sender interface: [v1-pay.sablier.com](https://v1-pay.sablier.com) +- Recipient interface: [v1-app.sablier.com](https://v1-app.sablier.com) diff --git a/docs/apps/features/01-overview.mdx b/docs/apps/features/01-overview.mdx new file mode 100644 index 00000000..dc7d4795 --- /dev/null +++ b/docs/apps/features/01-overview.mdx @@ -0,0 +1,53 @@ +--- +id: "overview" +sidebar_position: 1 +title: "Overview" +--- + +# The Sablier Interface + +The app has been redesigned from the ground up around Lockup, Flow, Airstreams and the Sablier Protocols as a whole. +Start exploring at [app.sablier.com](https://app.sablier.com) or dive into some of the main features below. + +## Use-case centric + +![Banner Menu](/banner/docs-banner-app-menu.png) + +As you may have noticed the protocol support two types of streams: + +- Lockup streams - fixed duration, amount required upfront, strict distribution curve +- Flow streams - no end time, amount can be topped-up, rate-per-second can be adjusted + +Therefore, we have mapped Sablier's two underlying protocols to dedicated use-cases our customers may choose them for. +Our approach is to consider: + +| Feature | Underlying System | Reason | +| -------- | -------------------------- | ----------------------------------------------------------------------- | +| Vesting | Sablier Lockup | Well defined rules and strict schedules | +| Payments | Sablier Flow | Adapts with time, less collateral-intensive for senders | +| Drops | Sablier Lockup, Airstreams | Instant or vested over time, with pre-configured recipients and amounts | + +However, we invite everyone to use these features without any constraints and adapt them to their own unique use-case. + +## Vesting + +Read about the business use-case on the [dedicated webpage](https://sablier.com/vesting) or dive deeper into the +vesting-related features documented in [this section](/apps/features/vesting). + +## Payments / Payroll + +Read about the business use-case on the [dedicated webpage](https://sablier.com/payroll) or dive deeper into the +vesting-related features documented in [this section](/apps/features/vesting). + +## Drops / Airstreams + +Regardless of the type (Instant 🔜 or Airstreams) read more about the business use-case on the +[dedicated webpage](https://sablier.com/drops) or dive deeper into the vesting-related features documented in +[this section](/apps/features/drops). + +## Others + +Given how flexible Sablier is in adapting to any processes involving token distribution, we've also documented the +business case for: + +- Leveraging the protocol to enable [Grants](https://sablier.com/grants) diff --git a/docs/apps/features/01-vesting.mdx b/docs/apps/features/01-vesting.mdx deleted file mode 100644 index 3aa3102c..00000000 --- a/docs/apps/features/01-vesting.mdx +++ /dev/null @@ -1,128 +0,0 @@ ---- -id: "vesting" -sidebar_position: 1 -title: "Vesting" ---- - -# Vesting - -import NFTSVG from "@site/static/img/nft.svg"; - -The Sablier Interface has been redesigned from the ground up to support all the new features of the protocol, and then -some. Start exploring at [app.sablier.com](https://app.sablier.com). - -## Flexible vesting - -Almost any vesting schedule can be expressed as a stream. Sablier supports multiple options out of the box, including: - -- Linear -- Cliff-Linear -- Unlock in Steps -- Unlock Monthly -- Timelock -- Unlock-Linear -- Unlock-Dynamic -- Exponential -- Cliff-Exponential - -But programmatically, you can create any schedule you want. See the [Stream Shapes](/concepts/lockup/stream-shapes) for -more details on how we design these shapes. - -| | -| -------------------------------------- | -| ![Gallery](/screenshots/gallery-2.png) | - -## NFT Representation - -Each stream in wrapped in an ERC-721 non-fungible token (NFT), making the stream recipient the owner of the NFT. - -Thus streams can be transferred, traded, and used as collateral in NFT lending protocols. - -| | -| ----------------------------------- | -| | - -## Dashboard for your streams - -Enter the Dashboard and discover a detailed overview of your incoming and outgoing streams. - -Take advantage of the Search functionality to explore the chain and gain more insight into how others are using Lockup -for vesting. - -| | | -| -------------------------------------- | -------------------------------------------- | -| ![All](/screenshots/dashboard-all.png) | ![Search](/screenshots/dashboard-search.png) | - -## Multi-chain experience - -Streaming, everywhere. We support 8+ EVM chains and testnets where you can stream or get paid using Sablier. - -| | -| ----------------------------------------- | -| ![ChainList](/screenshots/chain-list.png) | - -## Group streams - -Save time by creating up to 60 streams in bulk for your employees, investors, or community members. Use the forms or -upload a CSV! - -| | -| --------------------------------------- | -| ![Group](/screenshots/create-group.png) | - -## Support for any ERC-20 token - -Stream your favorite token! Thanks to our integration of Token Lists, any ERC-20 token can be streamed on Sablier -Lockup. - -| | | -| ---------------------------------------------- | ------------------------------------------------------- | -| ![Token List](/screenshots/tokenlist-home.png) | ![Token List Search](/screenshots/tokenlist-search.png) | - -## Simulations - -Eager to see what your chosen distribution will look like? Use our simulation tool right from the create-stream forms -(or later on, from the stream profile). - -![Simulate](/screenshots/simulation.png) - -## Detailed panels - -Explore each available stream in detail. Simulate future payouts, understand historical events, or simply enjoy cool -representations of a monetized passage of time (NFTs 🔥). - -|
    |
    | -| :---------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------- | -| ![Details](/screenshots/details.png) | ![App](/screenshots/stream-profile.png) ![Simulate](/screenshots/simulation.png) ![Preview](/screenshots/preview.png) | - -## Be in control of your future - -Manage your streams 24/7 as you see fit. The app will guide you through every supported process and help you keep an eye -on your payouts. Remember, you can always be both a sender and a recipient. - -| | | -| -------------------------------------------- | ---------------------------------------- | -| ![Withdraw](/screenshots/cover-withdraw.png) | ![Cancel](/screenshots/cover-cancel.png) | - -## Interact with the Lockup contracts - -We've mapped the most important utilities from the Lockup contracts into in-app features. Interact with streams that -reference you as a key participant (e.g. sender, recipient) directly from the interfaces. - -| Feature | Sender | Recipient | -| ---------------------- | :----: | :-------: | -| Create Streams | ✅ | ❌ | -| Renounce Cancelability | ✅ | ❌ | -| Cancel | ✅ | ❌ | -| Cancel Multiple | ✅ | ❌ | -| Transfer | ❌ | ✅ | -| Withdraw | ✅ | ✅ | - -## Stream from your Safe multisig - -Lockup is fully integrated with [Safe](https://safe.global). Start streaming from the safety and comfort of your -multisig wallet. - -## Do it with style! - -Yes, the app works on mobile. And yes, we support dark mode by default (light mode coming soon). diff --git a/docs/apps/features/02-payments.mdx b/docs/apps/features/02-payments.mdx deleted file mode 100644 index 940a80ec..00000000 --- a/docs/apps/features/02-payments.mdx +++ /dev/null @@ -1,7 +0,0 @@ ---- -id: "payments" -sidebar_position: 2 -title: "Payments" ---- - -Coming soon diff --git a/docs/apps/features/02-vesting.mdx b/docs/apps/features/02-vesting.mdx new file mode 100644 index 00000000..449278e4 --- /dev/null +++ b/docs/apps/features/02-vesting.mdx @@ -0,0 +1,150 @@ +--- +id: "vesting" +sidebar_position: 2 +title: "Vesting" +--- + +# Vesting + +import NFTSVG from "@site/static/img/nft.svg"; + +The Sablier Interface will showcase [Lockup](/concepts/lockup/overview) streams under the Vesting tab. These are token +streams with a fixed duration, predefined amount and strict distribution curve. + +![Banner Vesting](/banner/docs-banner-vesting.png) + +In Q4 2024 the app has undergone a use-case centric redesign. For past users, all streams created before this update +will show up in the Vesting page. + +| [Vesting streams](https://app.sablier.com/vesting/gallery) | +| --------------------------------------------------------------------------------------- | +| Vesting stream profile | + +## Features + +### Flexible curves + +Almost any vesting schedule can be expressed as a stream. Sablier supports multiple options out of the box, including: + +- Linear +- Cliff-Linear +- Unlock in Steps +- Unlock Monthly +- Backweighted +- Timelock +- Unlock-Linear +- Unlock-Dynamic +- Exponential +- Cliff-Exponential + +But programmatically, you can create any schedule you want. See the [Stream Shapes](/concepts/lockup/stream-shapes) for +more details on how we design these shapes. + +### Explore the dashboard + +Enter the Dashboard and discover a detailed overview of your incoming and outgoing streams. + +Take advantage of the Search functionality to explore the chain and gain more insight into how others are using Lockup +for vesting. + +| | +| ------------------------------------------ | +| ![All](/screenshots/vesting-dashboard.png) | + +### Preview any stream + +Gain insight into any stream. Track progress using our very own stream circle. Share the unique URL with recipients or +anyone really to increase transparency of your day to day token distribution. + +| | +| ---------------------------------------- | +| ![All](/screenshots/vesting-profile.png) | + +### NFT representation + +Each stream in wrapped in an ERC-721 non-fungible token (NFT), making the stream recipient the owner of the NFT. + +Thus streams can be transferred, traded, and used as collateral in NFT lending protocols. + +| | +| ----------------------------------- | +| | + +### Multi-chain experience + +Streaming, everywhere. We support 11+ EVM chains and testnets where you can stream or get paid using Sablier. + +| | +| --------------------------------------------- | +| ![ChainList](/screenshots/general-chains.png) | + +### Create in batches + +Save time by creating up to 60 streams in bulk for your employees, investors, or community members. Use the forms for a +clean and straightforward UX. + +| | +| ----------------------------------------- | +| ![Group](/screenshots/vesting-create.png) | + +### Create from CSVs + +Save even more time by using our CSV upload, dedicated to power-users. Under the hood, it works the same as the visual +forms. + +| | +| --------------------------------------------- | +| ![Group](/screenshots/vesting-create-csv.png) | + +### Simulations + +Eager to see what your chosen distribution will look like? Use our simulation tool right from the create-stream forms +(or later on, from the stream profile). + +![Simulate](/screenshots/simulation.png) + +### Detailed panels + +Explore each available stream in detail. Simulate future payouts, understand historical events, or simply enjoy cool +representations of a monetized passage of time (NFTs 🔥). + +### Granular management + +Manage your streams 24/7 as you see fit. The app will guide you through every supported process and help you keep an eye +on your payouts. Remember, you can always be both a sender and a recipient. + +| | | +| -------------------------------------------- | ---------------------------------------- | +| ![Withdraw](/screenshots/cover-withdraw.png) | ![Cancel](/screenshots/cover-cancel.png) | + +### Any ERC-20 token + +Stream your favorite token! Thanks to our integration of Token Lists, any ERC-20 token can be streamed on Sablier +Lockup. + +| | | +| ---------------------------------------------- | ------------------------------------------------------- | +| ![Token List](/screenshots/tokenlist-home.png) | ![Token List Search](/screenshots/tokenlist-search.png) | + +### Permissions + +We've mapped the most important utilities from the Lockup contracts into in-app features. Interact with streams that +reference you as a key participant (e.g. sender, recipient) directly from the interfaces. + +| Feature | Sender | Recipient | Public | +| ---------------------- | :----: | :-------: | :----: | +| Create Streams | ✅ | - | - | +| Renounce Cancelability | ✅ | ❌ | - | +| Cancel | ✅ | ❌ | - | +| Cancel Multiple | ✅ | ❌ | - | +| Transfer | ❌ | ✅ | - | +| Withdraw | ✅ | ✅ | ✅ | + +### Safe multisig support + +Vesting is fully integrated with [Safe](https://safe.global). Start streaming from the safety and comfort of your +multisig wallet. + +### Mobile-ready layout + +Stream in style! Yes, the app works on mobile. And yes, we support dark mode by default (light mode coming soon). diff --git a/docs/apps/features/03-airstreams.mdx b/docs/apps/features/03-airstreams.mdx deleted file mode 100644 index a3bff6ff..00000000 --- a/docs/apps/features/03-airstreams.mdx +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: "airstreams" -sidebar_position: 3 -title: "Airstreams" ---- - -# Airstreams - -The Sablier Interface can handle more than native streams. We developed a solution for distributing token streams to -millions of users called **Airstreams**. Start exploring at [app.sablier.com](https://app.sablier.com/airstreams/). - -## Easy 3-step process - -Create a campaign by following these three simple steps: - -1. Configure the initial details (e.g., token, cancelability) -2. Upload the CSV containing a list of recipients -3. Deploy and fund the Airstream campaign contract - -| | | -| -------------------------------------------- | ------------------------------------------------------- | -| ![Step 1](/screenshots/airstream-create.png) | ![Step 2](/screenshots/airstream-create-recipients.png) | - -:::warning Timezone Caveat - -All the dates and times in the CSV are considered to be in the same timezone as the locales of the airstream creator's -device. - -::: - -:::info - -With the official app, you can distribute up to 50k+ streams per campaign. If you'd like to support more, you can do so -by using a self-hosted [Merkle service](/api/merkle-api/intro). Feel free to get in touch for more details or premium -support. - -::: - -## Dashboard for Airstreams - -Enter the Dashboard and discover a detailed overview of the Airstreams you may be eligible for. - -Take advantage of the Search functionality to explore the chain and gain more insight into how others are using Sablier. - -| | -| -------------------------------------------- | -| ![All](/screenshots/airstream-dashboard.png) | - -## Support for any ERC-20 token - -Stream your favorite token! Thanks to our integration of Token Lists, any ERC-20 token can be streamed on Sablier. - -| | | -| ---------------------------------------------- | ------------------------------------------------------- | -| ![Token List](/screenshots/tokenlist-home.png) | ![Token List Search](/screenshots/tokenlist-search.png) | - -## Oversight - -Have a clear view of how your campaign is performing. Check eligibility or manage your own campaign from a dedicated -interface. - -| | -| ------------------------------------------ | -| ![All](/screenshots/airstream-profile.png) | - -:::info - -To integrate this functionality into your own products/apps, have a look at the [API guides](/api/overview), especially -the [v2-merkle-api](/api/merkle-api/intro) and the merkle subgraphs. - -::: - -## Advanced Settings - -For campaign admins, the interface enables advanced settings like in-app visibility, in-app geographical restrictions, -and campaign-specific items like an eligibility criteria link. diff --git a/docs/apps/features/03-payments.mdx b/docs/apps/features/03-payments.mdx new file mode 100644 index 00000000..f1007b56 --- /dev/null +++ b/docs/apps/features/03-payments.mdx @@ -0,0 +1,88 @@ +--- +id: "payments" +sidebar_position: 3 +title: "Payments" +--- + +The Sablier Interface will showcase [Flow](/concepts/flow/overview) streams under the Payments tab. These are token +streams with a no end-date, an ever increasing amount (can be topped up) and a flexible rate per second. + +![Banner Vesting](/banner/docs-banner-payments.png) + +## Features + +### Flexible terms + +Increase the rate/second, fund the stream with more assets and keep it alive indefinitely! With Flow streams in the +Payments tab you have the freedom to adapt your distribution schedule based on external KPIs, pivots or executive +decisions. + +### Explore the dashboard + +Enter the Dashboard and discover a detailed overview of your incoming and outgoing flow streams. + +Take advantage of the Search functionality to explore the chain and gain more insight into how others are using Flow for +continuous payments, grants, salaries and more. + +| | +| ------------------------------------------------- | +| ![All](/screenshots/payments-dashboard-split.png) | + +### Preview any stream + +Gain insight into any stream. Track progress using our very own stream circle. Share the unique URL with recipients or +anyone really to increase transparency of your day to day token distribution. + +| | +| ----------------------------------------- | +| ![All](/screenshots/payments-profile.png) | + +### NFT representation + +Each stream in wrapped in an ERC-721 non-fungible token (NFT), making the stream recipient the owner of the NFT. + +Thus streams can be transferred, traded, and used as collateral in NFT lending protocols. + +### Multi-chain experience + +Streaming, everywhere. We enable payments on 11+ EVM chains and testnets where you can stream or get paid using Sablier. + +| | +| --------------------------------------------- | +| ![ChainList](/screenshots/general-chains.png) | + +### Create in batches + +Save time by creating up to 60 streams in bulk for your employees, investors, or community members. Use the forms for a +clean and straightforward UX. + +### Create from CSVs + +Save even more time by using our CSV upload, dedicated to power-users. Under the hood, it works the same as the visual +forms. + +### Safe multisig support + +Payments are fully integrated with [Safe](https://safe.global). Start streaming from the safety and comfort of your +multisig wallet. + +### Mobile-ready layout + +Stream in style! Yes, the app works on mobile. And yes, we support dark mode by default (light mode coming soon). + +### Permissions + +We've mapped the most important utilities from the Flow contracts into in-app features. Interact with streams that +reference you as a key participant (e.g. sender, recipient) directly from the interfaces. + +| Feature | Sender | Recipient | Public | +| ---------------- | :----: | :-------: | :----: | +| Create Streams | ✅ | ❌ | - | +| Deposit / Top-up | ✅ | - | ✅ | +| Adjust rate | ✅ | ❌ | - | +| Refund | ✅ | ❌ | - | +| Void | ✅ | ✅ | - | +| Pause | ✅ | ❌ | - | +| Restart | ✅ | ❌ | - | +| Transfer | ❌ | ✅ | - | +| Withdraw | ✅ | ✅ | ✅ | diff --git a/docs/apps/features/04-drops.mdx b/docs/apps/features/04-drops.mdx new file mode 100644 index 00000000..bef6922a --- /dev/null +++ b/docs/apps/features/04-drops.mdx @@ -0,0 +1,116 @@ +--- +id: "drops" +sidebar_position: 4 +title: "Drops" +--- + +# Drops + +The Sablier Interface can handle more than native streams. We developed a solution for distributing token streams to +millions of users called **Drops**. Start exploring at [app.sablier.com](https://app.sablier.com/drops/) or read more +about it on [sablier.com/drops](https://sablier.com/drops). + +:::note + +Drops allow for millions of recipients to receive an allocation. To see how they differ from +[group streams](/apps/features/vesting#create-in-batches) (~60 streams at once) read our [FAQ](/support/faq). + +::: + +## Airstreams + +![Banner Airstreams](/banner/docs-banner-drops-airstreams.png) + +**Airdrops should be vested!** + +Here at Sablier we believe in long-term distributions that align incentives. That's why we engineered Airstreams, a +solution which allows you to airdrop streams to a very large number of recipients. + +Pick a vesting curve (e.g. linear or stepper), define the rules (e.g. duration, clawback window) and allow recipients to +claim their allocations as streams. + +## Instant Drops (Coming Soon 🔜) + +![Banner Instant Drops](/banner/docs-banner-drops-instant.png) + +For communities that are still looking to distribute value quickly and efficiently, Sablier offers a one-time instant +airdrop solution. This facilitates and easy onboarding of millions of users into the campaign creator's ecosystem, while +exposing everyone to the amazing features our products can offer. + +## Features + +### Create from CSVs + +Pre-generate the list of recipients and drop the file right into our app. We sanitize, validate and triple-check the +data to ensure everything is formatted correctly. + +:::caution Timezone Caveat + +All the dates and times in the CSV are considered to be in the same timezone as the locales of the airstream creator's +device. Visit out [Guide for CSV Support](/apps/guides/csv-support) to read about timezones, date or amount formats and +more. + +::: + +### Easy 3-step process + +Create a campaign by following these three simple steps: + +1. Configure the initial details (e.g., token, cancelability) +2. Upload the CSV containing a list of recipients +3. Deploy and fund the Airstream campaign contract (can be funded later) + +| | +| ------------------------------------------------------- | +| ![Step 1](/screenshots/drops-form-1.png) | +| ![Step 2](/screenshots/airstream-create-recipients.png) | + +### Public source + +You can distribute a large number of streams per campaign through our app. If you'd like to support Drops in your own UI +or have additional requirements, you can do so by using a self-hosted [Merkle service](/api/merkle-api/overview). Feel +free to get in touch for more details or premium support. + +### Explore the dashboard + +Enter the Dashboard and discover a detailed overview of the Drops you may be eligible for. + +Take advantage of the Search functionality to explore the chain and gain more insight into how others are using Sablier. + +| | +| ------------------------------------- | +| ![All](/screenshots/drops-search.png) | + +### Support for any ERC-20 token + +Drop your own token! Thanks to our integration of Token Lists, any ERC-20 token can be airdropped on Sablier. Add your +new token to the community sourced list for instant access, or test first using the token-address and onchain data. + +| | +| --------------------------------------------- | +| ![ChainList](/screenshots/general-chains.png) | + +### Oversight + +Have a clear view of how your campaign is performing. Check eligibility or manage your own campaign from a dedicated +interface. + +| | +| ------------------------------------------ | +| ![All](/screenshots/airstream-profile.png) | + +:::info + +To integrate this functionality into your own products/apps, have a look at the [API guides](/api/overview), especially +the [v2-merkle-api](/api/merkle-api/overview) and the merkle subgraphs. + +::: + +### Advanced Settings + +For campaign admins, the interface enables advanced settings like in-app visibility, in-app geographical restrictions, +and campaign-specific items like an eligibility criteria link. + +| | +| --------------------------------------- | +| ![All](/screenshots/drops-settings.png) | diff --git a/docs/apps/features/04-general.mdx b/docs/apps/features/05-generic.mdx similarity index 79% rename from docs/apps/features/04-general.mdx rename to docs/apps/features/05-generic.mdx index f1ec0883..28501a14 100644 --- a/docs/apps/features/04-general.mdx +++ b/docs/apps/features/05-generic.mdx @@ -1,15 +1,15 @@ --- -id: "general" -sidebar_position: 4 -title: "General" +id: "generic" +sidebar_position: 5 +title: "Generic" --- -# General +# Generic features -The Sablier Interface includes a ton of cool features, from small design aspects to popular integrations (e.g. with -Farcaster [Frames](https://docs.farcaster.xyz/learn/what-is-farcaster/frames)). Here are a couple of our favorite ones: +The Sablier Interface includes a ton of smaller (but cool) features, from small design aspects to popular integrations +(e.g. Farcaster [Frames](https://docs.farcaster.xyz/learn/what-is-farcaster/frames)). -## Auto-Generated Preview Images +### Auto-Generated Preview Images For the stars of our show, we generated special preview images based on the qualities of each entity. Share these on social media for an extra bit of glamour. Here's an [example](https://x.com/Sablier/status/1798010170133692730) on X. @@ -19,7 +19,7 @@ the "Share custom image feature" button (Stream Profile → More Options → Sha ![Preview](/screenshots/preview.png) -## Farcaster Frames +### Farcaster Frames ![Preview](/img/frame/farcaster.jpg) diff --git a/docs/apps/guides/03-csv-support.mdx b/docs/apps/guides/01-csv-support.mdx similarity index 98% rename from docs/apps/guides/03-csv-support.mdx rename to docs/apps/guides/01-csv-support.mdx index 97adb784..5f57dc01 100644 --- a/docs/apps/guides/03-csv-support.mdx +++ b/docs/apps/guides/01-csv-support.mdx @@ -1,6 +1,6 @@ --- id: "csv-support" -sidebar_position: 3 +sidebar_position: 1 title: "CSV Support" --- @@ -35,8 +35,8 @@ in rows with addresses, amounts and other details. Finally, create batches/group In order to access this feature you will need to: -1. Access the create streams [gallery](https://app.sablier.com/gallery/group/) - make sure you're on the group tab (top - right) +1. Access the create streams [gallery](https://app.sablier.com/vesting/gallery/) - make sure you're on the group tab + (top right) 2. Click on the the desired stream shape card 3. At the top (top-right) of the page you will find a button guiding you towards the CSV feature diff --git a/docs/apps/guides/02-url-schemes.mdx b/docs/apps/guides/02-url-schemes.mdx index d639996e..3e105b63 100644 --- a/docs/apps/guides/02-url-schemes.mdx +++ b/docs/apps/guides/02-url-schemes.mdx @@ -50,7 +50,7 @@ contract `alias`, the `chainId`, and the `streamId`, and then you add them to th As you can see, the main format is `contractA-chainId-streamId`. This is supported both at the app and the subgraph level. For situations when an alias cannot be used, we fallback to the following format: `contractAddress-chainId-streamId`. Read more about identifiers and aliases in our -[subgraph documentation](/api/subgraphs/protocol/structure#identifying). +[subgraph documentation](/api/lockup/the-graph/structure#identifying). --- @@ -116,7 +116,7 @@ contract `alias`, the `chainId`, and the `streamId`, and then you add them to th | [app.sablier.com/stream/0xe72[...]bbabc-11155111](https://app.sablier.com/airstream/0xe72175dd12ac7efca6b7d12dfc913a5f661bbabc-11155111/) | Airstream on Sepolia | As you can see, the main format is `contractA-chainId`. This is supported both at the app and the subgraph level. Read -more about identifiers and aliases in our [subgraph documentation](/api/subgraphs/merkle/entities#identifying). +more about identifiers and aliases in our [subgraph documentation](/api/drops/the-graph/entities#identifying). ## Search Airstreams diff --git a/docs/apps/guides/03-how-to.mdx b/docs/apps/guides/03-how-to.mdx new file mode 100644 index 00000000..a3b5bd5e --- /dev/null +++ b/docs/apps/guides/03-how-to.mdx @@ -0,0 +1,7 @@ +--- +id: "how-to" +sidebar_position: 2 +title: "How-to Videos" +--- + +For an extensive set of video explanations please check out the [Support](/support/how-to) section. diff --git a/docs/apps/guides/_category_.json b/docs/apps/guides/_category_.json index eb546556..5a94839e 100644 --- a/docs/apps/guides/_category_.json +++ b/docs/apps/guides/_category_.json @@ -1,5 +1,5 @@ { "collapsed": false, - "label": "Guides", - "position": 4 + "label": "User Guides", + "position": 2 } diff --git a/docs/guides/lockup/03-gas-benchmarks.md b/docs/guides/lockup/03-gas-benchmarks.md index 0818e5f8..b18101d1 100644 --- a/docs/guides/lockup/03-gas-benchmarks.md +++ b/docs/guides/lockup/03-gas-benchmarks.md @@ -27,7 +27,7 @@ view the code that generates these benchmarks. | `renounce` | 19,381 | | `createWithDurations` (Broker fee set) (cliff not set) | 129,276 | | `createWithDurations` (Broker fee not set) (cliff not set) | 113,680 | -| `createWithDurations` (Broker fee set) (cliff set) | 138,071 | +| `createWithDurations` (Broker fee set) (cliff set) | 138,71 | | `createWithDurations` (Broker fee not set) (cliff set) | 133,273 | | `createWithTimestamps` (Broker fee set) (cliff not set) | 115,334 | | `createWithTimestamps` (Broker fee not set) (cliff not set) | 110,530 | @@ -36,7 +36,7 @@ view the code that generates these benchmarks. | `withdraw` (After End Time) (by Recipient) | 29,701 | | `withdraw` (Before End Time) (by Recipient) | 19,104 | | `withdraw` (After End Time) (by Anyone) | 24,799 | -| `withdraw` (Before End Time) (by Anyone) | 19,002 | +| `withdraw` (Before End Time) (by Anyone) | 19,2 | ### Lockup Dynamic @@ -44,16 +44,16 @@ view the code that generates these benchmarks. | ---------------------------------------------------------- | --------- | | `burn` | 15,716 | | `cancel` | 74,341 | -| `renounce` | 39,007 | +| `renounce` | 39,7 | | `createWithDurations` (2 segments) (Broker fee set) | 200,602 | -| `createWithDurations` (2 segments) (Broker fee not set) | 185,037 | +| `createWithDurations` (2 segments) (Broker fee not set) | 185,37 | | `createWithTimestamps` (2 segments) (Broker fee set) | 184,780 | -| `createWithTimestamps` (2 segments) (Broker fee not set) | 180,015 | +| `createWithTimestamps` (2 segments) (Broker fee not set) | 180,15 | | `withdraw` (2 segments) (After End Time) (by Recipient) | 19,108 | | `withdraw` (2 segments) (Before End Time) (by Recipient) | 27,554 | | `withdraw` (2 segments) (After End Time) (by Anyone) | 14,239 | | `withdraw` (2 segments) (Before End Time) (by Anyone) | 27,485 | -| `createWithDurations` (10 segments) (Broker fee set) | 395,084 | +| `createWithDurations` (10 segments) (Broker fee set) | 395,84 | | `createWithDurations` (10 segments) (Broker fee not set) | 390,326 | | `createWithTimestamps` (10 segments) (Broker fee set) | 385,125 | | `createWithTimestamps` (10 segments) (Broker fee not set) | 380,375 | @@ -116,7 +116,7 @@ to view the code that generates these benchmarks. | Function | Lockup Type | Segments/Tranches | Batch Size | Gas Usage | | ------------------------ | --------------- | ----------------- | ---------- | ---------- | -| `createWithDurationsLL` | Lockup Linear | N/A | 5 | 771,013 | +| `createWithDurationsLL` | Lockup Linear | N/A | 5 | 771,13 | | `createWithTimestampsLL` | Lockup Linear | N/A | 5 | 732,772 | | `createWithDurationsLD` | Lockup Dynamic | 24 | 5 | 3,951,599 | | `createWithTimestampsLD` | Lockup Dynamic | 24 | 5 | 3,815,274 | @@ -129,7 +129,7 @@ to view the code that generates these benchmarks. | `createWithDurationsLT` | Lockup Tranched | 24 | 10 | 7,632,114 | | `createWithTimestampsLT` | Lockup Tranched | 24 | 10 | 7,444,115 | | `createWithDurationsLL` | Lockup Linear | N/A | 20 | 2,783,510 | -| `createWithTimestampsLL` | Lockup Linear | N/A | 20 | 2,779,081 | +| `createWithTimestampsLL` | Lockup Linear | N/A | 20 | 2,779,81 | | `createWithDurationsLD` | Lockup Dynamic | 24 | 20 | 15,617,207 | | `createWithTimestampsLD` | Lockup Dynamic | 24 | 20 | 15,131,248 | | `createWithDurationsLT` | Lockup Tranched | 24 | 20 | 15,211,892 | @@ -145,4 +145,4 @@ to view the code that generates these benchmarks. | `createWithDurationsLD` | Lockup Dynamic | 12 | 50 | 22,990,726 | | `createWithTimestampsLD` | Lockup Dynamic | 12 | 50 | 22,355,943 | | `createWithDurationsLT` | Lockup Tranched | 12 | 50 | 22,413,554 | -| `createWithTimestampsLT` | Lockup Tranched | 12 | 50 | 22,006,169 | +| `createWithTimestampsLT` | Lockup Tranched | 12 | 50 | 22,6,169 | diff --git a/docs/guides/lockup/04-deployments.md b/docs/guides/lockup/04-deployments.md index a72ff40b..0b8e4976 100644 --- a/docs/guides/lockup/04-deployments.md +++ b/docs/guides/lockup/04-deployments.md @@ -22,7 +22,7 @@ A few noteworthy details about the deployments: Any updates or additional features will call for a new deployment of the protocol, due to its immutable nature. Came here looking for the previous Lockup deployments? Click below to see other versions as well as the in-app aliases -assigned under our [naming convention](/api/subgraphs/protocol/structure#identifying). +assigned under our [naming convention](/api/lockup/the-graph/structure#identifying). | Version | UI Aliases | | ------------------------------------ | ---------------------------------------------------------------- | diff --git a/docs/guides/lockup/guides/04-create-airstream.mdx b/docs/guides/lockup/guides/04-create-airstream.mdx index 860ecfc6..40d9a936 100644 --- a/docs/guides/lockup/guides/04-create-airstream.mdx +++ b/docs/guides/lockup/guides/04-create-airstream.mdx @@ -142,7 +142,8 @@ Airstreams use a Merkle tree data structure to store the airdrop data onchain. A create the contract and store the Merkle root onchain. Airdrop recipients can then call the contract on their own to claim their airdrop. -If you want to create the Merkle root programatically, you can follow [our guide on Merkle API](/api/merkle-api/intro). +If you want to create the Merkle root programatically, you can follow +[our guide on Merkle API](/api/merkle-api/overview). ```solidity baseParams.merkleRoot = 0x4e07408562bedb8b60ce05c1decfe3ad16b722309875f562c03d02d7aaacb123; diff --git a/docs/guides/lockup/guides/07-etherscan.md b/docs/guides/lockup/guides/07-etherscan.md index a233b560..91bdb250 100644 --- a/docs/guides/lockup/guides/07-etherscan.md +++ b/docs/guides/lockup/guides/07-etherscan.md @@ -297,8 +297,8 @@ page on Etherscan (in this example, we're using Sepolia): `https://sepolia.ether :::info -To get the address of an asset in the [Sablier Interface](/apps/overview), you can click on its name in the token list -dialog or find an existing stream with that token and click on the icon inside the stream circle. +To get the address of an asset in the [Sablier Interface](/apps/features/overview), you can click on its name in the +token list dialog or find an existing stream with that token and click on the icon inside the stream circle. ![Etherscan 09](/img/etherscan-tutorial/09.png) ![Etherscan 10](/img/etherscan-tutorial/10.png) diff --git a/docs/support/01-faq.mdx b/docs/support/01-faq.mdx index 4005e665..60c36f7b 100644 --- a/docs/support/01-faq.mdx +++ b/docs/support/01-faq.mdx @@ -81,3 +81,25 @@ transfers all the remaining funds (if any) to the recipient. On Lockup, once a stream is created, it is set in stone on the Ethereum blockchain. Whereas on Flow, a stream rate per second can be modified anytime by the creator. + +### How are Drops (Airstreams) different than a group of normal streams? + +Creating streams through our forms (manual or CSV) will physically start those streams onchain, on the spot. This means +you click to create a transaction, pay for the gas, and start all the streams for your recipients. + +Due to how block memory works (specifically the gas limit) you can only fit a limited number of streams (usually 60) in +a single block before running out of space. This is great for small distributions like paying your contractors or a set +of investors. + +Meanwhile, Drops (Instant or Airstreams) leverage a "lazy creation" of streams. You deploy a contract that stores a list +of recipients and the streams they are entitles to claim. Every recipient will manually click to claim their allocation +and create their stream **only in that moment**. This allows for millions of recipients to be defined at once, with them +triggering the stream creation one after the other (as opposed to all at once). + +| Feature | Groups | Drops | +| ------------------------------ | -------------------------- | ---------------------------- | +| Number of streams | ~60 (depends on gas limit) | Millions | +| Gas to create streams | Sender paying | Recipient paying | +| Gas to deploy "Drops" contract | N/A | Sender paying | +| Streams show up onchain | On the spot (all at once) | Lazily (one after the other) | +| Good for | Investors, Employees | Airdrops | diff --git a/docs/support/03-user-guides.mdx b/docs/support/03-user-guides.mdx new file mode 100644 index 00000000..0ceeadae --- /dev/null +++ b/docs/support/03-user-guides.mdx @@ -0,0 +1,31 @@ +--- +id: "technical-guides" +sidebar_position: 3 +title: "Technical Guides" +--- + +## User Guides (App) + +For a set of hands-on guides on app-specific features (for users and integrators) please check the following guides. + +**Examples:** + +- [CSV Support](/apps/guides/csv-support) (for streams and drops) +- [URL Schemes](/apps/guides/url-schemes) + +## Developer Guides (Contracts) + +**Examples:** + +- [Interactions with Etherscan](/guides/lockup/guides/etherscan) +- [Lockup Stream Management](/guides/lockup/guides/stream-management/withdraw) +- And more... + +## Developer Guides (Subgraphs) + +See the dedicated APIs [page](/api/overview). + +**Examples:** + +- [Popular subgraph queries](/api/lockup/the-graph/queries) +- [Merkle tree management](/api/drops/merkle-api/examples) for drops diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 6d4f8050..39d6ff5d 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -62,24 +62,69 @@ const config: Config = { to: "/api/overview", }, { - from: "/api/subgraphs/overview", + from: "/api", to: "/api/overview", }, { - from: "/api", + from: "/api/subgraphs/endpoints", + to: "/api/lockup/endpoints", + }, + { + from: "/api/subgraphs/overview", to: "/api/overview", }, + { + from: "/api/subgraphs/protocol", + to: "/api/lockup/the-graph/entities", + }, + { + from: "/api/drops/the-graph", + to: "/api/drops/the-graph/entities", + }, + { + from: "/api/subgraphs/merkle", + to: "/api/drops/the-graph/entities", + }, + { + from: "/api/merkle-api", + to: "/api/drops/merkle-api/overview", + }, + { + from: "/api/indexers/protocol", + to: "/api/lockup/envio/similarities", + }, + { + from: "/api/lockup/the-graph", + to: "/api/lockup/the-graph/entities", + }, + { + from: "/apps", + to: "/apps/features/overview", + }, { from: "/apps/features", to: "/apps/features/vesting", }, { - from: "/apps/url-schemes", - to: "/apps/guides/url-schemes", + from: "/apps/features/streams", + to: "/apps/features/vesting", + }, + + { + from: "/apps/features/general", + to: "/apps/features/overview", + }, + { + from: "/apps/overview", + to: "/apps/features/overview", + }, + { + from: "/apps/features/airstreams", + to: "/apps/features/drops", }, { - from: "/apps/guides/how-to", - to: "/support/how-to", + from: "/apps/url-schemes", + to: "/apps/guides/url-schemes", }, { from: "/apps/csv-support", @@ -126,10 +171,6 @@ const config: Config = { from: "/contracts/v1/deployments", to: "/guides/lockup/versions/v1", }, - { - from: "/apps/features/streams", - to: "/apps/features/vesting", - }, ], createRedirects(existingPath) { if (existingPath.includes("/community")) { @@ -280,18 +321,19 @@ const config: Config = { to: "/reference/overview", activeBasePath: "/reference", }, - { - label: "Apps", - position: "left", - to: "/apps/overview", - activeBasePath: "/apps", - }, { label: "APIs", position: "left", to: "/api/overview", activeBasePath: "/api", }, + { + label: "Apps", + position: "left", + to: "/apps/features/overview", + activeBasePath: "/apps", + }, + { label: "Support", position: "left", diff --git a/formatter.js b/formatter.js index d329b254..707e57dd 100644 --- a/formatter.js +++ b/formatter.js @@ -1,12 +1,12 @@ -import fs from 'fs/promises'; +import fs from "fs/promises"; -async function formatGasBenchmark() { - const filePath = 'docs/contracts/v2/05-gas-benchmarks.md'; - const markdownContent = await fs.readFile(filePath, 'utf8'); +async function formatGasBenchmark(filePath) { + const markdownContent = await fs.readFile(filePath, "utf8"); const formattedContent = markdownContent.replace(/\b\d+\b/g, (match) => { - return parseInt(match).toLocaleString('en-US'); + return parseInt(match).toLocaleString("en-US"); }); await fs.writeFile(filePath, formattedContent); } -formatGasBenchmark(); +formatGasBenchmark("docs/guides/lockup/03-gas-benchmarks.md"); +// formatGasBenchmark('docs/guides/flow/03-gas-benchmarks.md'); // TODO enable once flow benchmarks are added diff --git a/package.json b/package.json index 39871902..3f84b885 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@docusaurus/theme-mermaid": "^3.2.1", "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", - "@heroicons/react": "^2.1.3", + "@heroicons/react": "^2.1.5", "@mdx-js/react": "~3.0.1", "clsx": "^2.1.1", "docusaurus-theme-github-codeblock": "^2.0.2", diff --git a/src/components/organisms/Header.tsx b/src/components/organisms/Header.tsx index 4313a6b6..c0fb9b1f 100644 --- a/src/components/organisms/Header.tsx +++ b/src/components/organisms/Header.tsx @@ -1,5 +1,6 @@ import React from "react"; import styled from "@emotion/styled"; +import CodeBracketIcon from "@heroicons/react/24/outline/CodeBracketIcon"; import ComputerDesktopIcon from "@heroicons/react/24/outline/ComputerDesktopIcon"; import CubeIcon from "@heroicons/react/24/outline/CubeIcon"; import DocumentTextIcon from "@heroicons/react/24/outline/DocumentTextIcon"; @@ -115,7 +116,7 @@ export default function Header() { @@ -124,7 +125,7 @@ export default function Header() { description={"Official interfaces and brand guidelines"} Icon={ComputerDesktopIcon} title={"Apps"} - to={"/apps/overview"} + to={"/apps/features/overview"} /> - {" "} +
    GitHub @@ -107,12 +108,12 @@ function Socials() {
    - - - {" "} - + + + +
    - Medium + Blog

    Follow the announcements on our blog.

    diff --git a/src/constants/links.ts b/src/constants/links.ts index 23e4254f..c03838d6 100644 --- a/src/constants/links.ts +++ b/src/constants/links.ts @@ -1,5 +1,6 @@ export const links = { app: "https://app.sablier.com", + blog: "https://blog.sablier.com", discord: "https://discord.sablier.com", example: "https://app.sablier.com/stream/LL2-11155111-3/", forms: { @@ -7,5 +8,4 @@ export const links = { chains: "https://forms.gle/9EaRarDie98Fw1mw6", }, github: "https://github.com/sablier-labs", - medium: "https://blog.sablier.com", }; diff --git a/src/css/custom.css b/src/css/custom.css index 2c8dd00e..7354c11f 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -151,3 +151,7 @@ html[data-theme="dark"] .alert--info { margin-bottom: 6px; margin-top: 8px; } + +p > img { + border-radius: 4px; +} diff --git a/src/icons/MediumIcon.tsx b/src/icons/MediumIcon.tsx deleted file mode 100644 index 9a9a2bed..00000000 --- a/src/icons/MediumIcon.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from "react"; - -interface MediumIconProps { - size: number; -} - -export default function MediumIcon(_props: MediumIconProps): JSX.Element { - return ( - - - - - - - - - - ); -} diff --git a/static/banner/docs-banner-apis.png b/static/banner/docs-banner-apis.png new file mode 100644 index 00000000..47561cb0 Binary files /dev/null and b/static/banner/docs-banner-apis.png differ diff --git a/static/banner/docs-banner-app-menu.png b/static/banner/docs-banner-app-menu.png new file mode 100644 index 00000000..28203ef2 Binary files /dev/null and b/static/banner/docs-banner-app-menu.png differ diff --git a/static/banner/docs-banner-drops-airstreams.png b/static/banner/docs-banner-drops-airstreams.png new file mode 100644 index 00000000..7ca83ff6 Binary files /dev/null and b/static/banner/docs-banner-drops-airstreams.png differ diff --git a/static/banner/docs-banner-drops-instant.png b/static/banner/docs-banner-drops-instant.png new file mode 100644 index 00000000..9fd3c5f5 Binary files /dev/null and b/static/banner/docs-banner-drops-instant.png differ diff --git a/static/banner/docs-banner-payments.png b/static/banner/docs-banner-payments.png new file mode 100644 index 00000000..ac709a5e Binary files /dev/null and b/static/banner/docs-banner-payments.png differ diff --git a/static/banner/docs-banner-vesting.png b/static/banner/docs-banner-vesting.png new file mode 100644 index 00000000..8dda053c Binary files /dev/null and b/static/banner/docs-banner-vesting.png differ diff --git a/static/screenshots/chain-list.png b/static/screenshots/chain-list.png deleted file mode 100644 index eca370bf..00000000 Binary files a/static/screenshots/chain-list.png and /dev/null differ diff --git a/static/screenshots/dashboard-all.png b/static/screenshots/dashboard-all.png deleted file mode 100644 index 88ee6306..00000000 Binary files a/static/screenshots/dashboard-all.png and /dev/null differ diff --git a/static/screenshots/dashboard-search.png b/static/screenshots/dashboard-search.png deleted file mode 100644 index 1493ca2c..00000000 Binary files a/static/screenshots/dashboard-search.png and /dev/null differ diff --git a/static/screenshots/drops-form-1.png b/static/screenshots/drops-form-1.png new file mode 100644 index 00000000..06464a87 Binary files /dev/null and b/static/screenshots/drops-form-1.png differ diff --git a/static/screenshots/drops-search.png b/static/screenshots/drops-search.png new file mode 100644 index 00000000..0eed6bce Binary files /dev/null and b/static/screenshots/drops-search.png differ diff --git a/static/screenshots/drops-settings.png b/static/screenshots/drops-settings.png new file mode 100644 index 00000000..24eaea22 Binary files /dev/null and b/static/screenshots/drops-settings.png differ diff --git a/static/screenshots/gallery-2.png b/static/screenshots/gallery-2.png deleted file mode 100644 index f025e5cc..00000000 Binary files a/static/screenshots/gallery-2.png and /dev/null differ diff --git a/static/screenshots/gallery.png b/static/screenshots/gallery.png deleted file mode 100644 index 7a4d172a..00000000 Binary files a/static/screenshots/gallery.png and /dev/null differ diff --git a/static/screenshots/general-chains.png b/static/screenshots/general-chains.png new file mode 100644 index 00000000..19436409 Binary files /dev/null and b/static/screenshots/general-chains.png differ diff --git a/static/screenshots/payments-dashboard-split.png b/static/screenshots/payments-dashboard-split.png new file mode 100644 index 00000000..e479d16b Binary files /dev/null and b/static/screenshots/payments-dashboard-split.png differ diff --git a/static/screenshots/payments-profile.png b/static/screenshots/payments-profile.png new file mode 100644 index 00000000..13c954a2 Binary files /dev/null and b/static/screenshots/payments-profile.png differ diff --git a/static/screenshots/vesting-create-csv-uploaded.png b/static/screenshots/vesting-create-csv-uploaded.png new file mode 100644 index 00000000..acc2ce92 Binary files /dev/null and b/static/screenshots/vesting-create-csv-uploaded.png differ diff --git a/static/screenshots/vesting-create-csv.png b/static/screenshots/vesting-create-csv.png new file mode 100644 index 00000000..3ec318fc Binary files /dev/null and b/static/screenshots/vesting-create-csv.png differ diff --git a/static/screenshots/vesting-create.png b/static/screenshots/vesting-create.png new file mode 100644 index 00000000..86891767 Binary files /dev/null and b/static/screenshots/vesting-create.png differ diff --git a/static/screenshots/vesting-dashboard.png b/static/screenshots/vesting-dashboard.png new file mode 100644 index 00000000..51ac55de Binary files /dev/null and b/static/screenshots/vesting-dashboard.png differ diff --git a/static/screenshots/vesting-gallery.png b/static/screenshots/vesting-gallery.png new file mode 100644 index 00000000..4843c682 Binary files /dev/null and b/static/screenshots/vesting-gallery.png differ diff --git a/static/screenshots/vesting-profile.png b/static/screenshots/vesting-profile.png new file mode 100644 index 00000000..9564725f Binary files /dev/null and b/static/screenshots/vesting-profile.png differ