diff --git a/docs/api/drops/02-endpoints.mdx b/docs/api/drops/02-endpoints.mdx index 509f173c..415987bd 100644 --- a/docs/api/drops/02-endpoints.mdx +++ b/docs/api/drops/02-endpoints.mdx @@ -69,9 +69,9 @@ deployment. The data from all of chains that Sablier is deployed on can be queri ### Endpoints -| Chain | Endpoint on the Hosted Network | -| ---------------- | --------------------------------------------------------------------- | -| All-Networks[^3] | [https://indexer.bigdevenergy.link/[...]/v1/graphql][endpoint-merkle] | +| Chain | Endpoint on the Hosted Network | +| ---------------- | ------------------------------------------------------------------ | +| All-Networks[^3] | [https://indexer.hyperindex.xyz/[...]/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. @@ -218,7 +218,7 @@ recipient's claims. {/* --------------------------------------------------------------------------------------------------------------------------------- */} -[endpoint-merkle]: https://indexer.bigdevenergy.link/508d217/v1/graphql +[endpoint-merkle]: https://indexer.hyperindex.xyz/508d217/v1/graphql {/* --------------------------------------------------------------------------------------------------------------------------------- */} {/* --------------------------------------------------------------------------------------------------------------------------------- */} diff --git a/docs/api/flow/02-endpoints.mdx b/docs/api/flow/02-endpoints.mdx index bbf671c7..57179d83 100644 --- a/docs/api/flow/02-endpoints.mdx +++ b/docs/api/flow/02-endpoints.mdx @@ -6,7 +6,7 @@ title: "Endpoints" import LinkPreview from "@site/src/components/LinkPreview"; -# Lockup +# Flow ## The Graph @@ -64,9 +64,9 @@ like creating, depositing, or voiding flow streams. ### Endpoints -| Chain | Endpoint (Hosted Network) | -| ---------------- | ------------------------------------------------------------------- | -| All-Networks[^3] | [https://indexer.bigdevenergy.link/[...]/v1/graphql][endpoint-flow] | +| Chain | Endpoint (Hosted Network) | +| ---------------- | ---------------------------------------------------------------- | +| All-Networks[^3] | [https://indexer.hyperindex.xyz/[...]/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. @@ -178,7 +178,7 @@ The endpoint is meant to be plugged into a query client. Use {/* --------------------------------------------------------------------------------------------------------------------------------- */} -[endpoint-flow]: https://indexer.bigdevenergy.link/__INSERT_ID__/v1/graphql +[endpoint-flow]: https://indexer.hyperindex.xyz/__INSERT_ID__/v1/graphql {/* --------------------------------------------------------------------------------------------------------------------------------- */} {/* --------------------------------------------------------------------------------------------------------------------------------- */} diff --git a/docs/api/flow/envio/01-similarities.mdx b/docs/api/flow/envio/01-similarities.mdx new file mode 100644 index 00000000..9966abc7 --- /dev/null +++ b/docs/api/flow/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 +[flow subgraph](/api/flow/the-graph/entities) before reading about the `flow-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/flow/the-graph/entities) +- [Structure](/api/flow/the-graph/structure) diff --git a/docs/api/flow/envio/02-architecture.mdx b/docs/api/flow/envio/02-architecture.mdx new file mode 100644 index 00000000..4d894f88 --- /dev/null +++ b/docs/api/flow/envio/02-architecture.mdx @@ -0,0 +1,8 @@ +--- +id: "architecture" +sidebar_position: 3 +title: "Architecture" +--- + +The flow-envio architecture respects the same principles with lockup-envio. You can find more information +[here](/api/lockup/envio/architecture) diff --git a/docs/api/flow/envio/03-queries.mdx b/docs/api/flow/envio/03-queries.mdx new file mode 100644 index 00000000..71bf4432 --- /dev/null +++ b/docs/api/flow/envio/03-queries.mdx @@ -0,0 +1,158 @@ +--- +id: "queries" +sidebar_position: 4 +title: "Queries" +--- + +Building on top of the [entity structure](/api/flow/the-graph/structure) defined earlier, here are some common GraphQL +queries for fetching data from the Sablier subgraph. + +### Recent streams + +```graphql title="The 10 most recent streams" +query getStreams { + Stream(limit: 10, distinct_on: [subgraphId], order_by: { subgraphId: desc }) { + id + alias + category + asset { + id + symbol + } + } +} +``` + +### Paginated streams + +To query streams in sets/pages (and avoid edge cases where using timestamps may skip simultaneous batched streams), we +can use the unique `subgraphId`. + +This query includes pagination. + +```graphql title="The next streams indexed before the last seen subgraphId" +query getStreams($first: Int!, $subgraphId: numeric!) { + Stream( + limit: $first + distinct_on: [subgraphId] + order_by: { subgraphId: desc } + where: { subgraphId: { _lt: $subgraphId } } + ) { + id + alias + category + asset { + id + symbol + } + } +} +``` + +### Streams by sender + +This query includes pagination. + +:::warning + +Some queries, especially those using `OR` will potentially yield duplicate results. To make sure we only retrieve unique +streams/entities with a query, we make use of the `distinct_on` filter (and apply it on keys included in `order_by`). + +::: + +```graphql title="The next streams created by an address" +Stream( + limit: $first + offset: $skip + distinct_on: [subgraphId] + order_by: { subgraphId: desc } + where: { + _and: [{ sender: {_eq: $sender} }, { subgraphId: {_lt: $subgraphId} }] + } +) { + id + alias + category +} +``` + +### Streams by sender or recipient + +To show all streams that have an address marked as a sender (all cases) or a recipient, extend the example above to +account for the recipient aspect. + +This query includes pagination. + +```graphql title="The next streams related to an address, as a sender or recipient" +Stream( + limit: $first + offset: $skip + distinct_on: [subgraphId] + order_by: { subgraphId: desc } + where: { + or: [ + { _and: [{ sender: {_eq: $sender} }, { subgraphId: {_lt: $subgraphId} }] } + { _and: [{ recipient: {_eq: $recipient} }, { subgraphId: {_lt: $subgraphId} }] } + ] + } +) { + id + alias + category + } +``` + +### Streams by filters + +The official V2 Interfaces will provide a search interface where one may query for a list of streams using the following +filters (the conditions will be combined) + +- the sender address +- the recipient address +- a list of stream identifiers + +This query includes pagination. + +```graphql title="The 'where' clause for a complex paginated search filter" +where: { + _or: [ + { + _and: [ + { chainId: { _eq: $chainId } } + { sender: { _eq: $sender } } + { subgraphId: { _lt: $subgraphId } } + ] + } + { + _and: [ + { chainId: { _eq: $chainId } } + { recipient: { _eq: $recipient } } + { subgraphId: { _lt: $subgraphId } } + ] + } + ] + } +``` + +### Actions by stream + +:::tip + +To avoid writing the same entity definitions over and over again, check out Fragments. + +::: + +```graphql title="Most recent 100 stream actions such as withdrawals or transfers" +Action( + limit: 100 + distinct_on: [subgraphId] + order_by: { subgraphId: desc } + where: { stream_id: {_eq: $streamId} } +) { + id + category + stream { + ...StreamFragment + } +} +``` diff --git a/docs/api/flow/envio/_category_.json b/docs/api/flow/envio/_category_.json new file mode 100644 index 00000000..84b76022 --- /dev/null +++ b/docs/api/flow/envio/_category_.json @@ -0,0 +1,5 @@ +{ + "collapsed": true, + "label": "Envio", + "position": 4 +} diff --git a/docs/api/flow/the-graph/01-entities.mdx b/docs/api/flow/the-graph/01-entities.mdx new file mode 100644 index 00000000..f5289b5e --- /dev/null +++ b/docs/api/flow/the-graph/01-entities.mdx @@ -0,0 +1,32 @@ +--- +id: "entities" +sidebar_position: 1 +title: "Entities" +--- + +## Entity Architecture + +GraphQL entities defined by the Sablier subgraphs are meant to mirror the functionality exposed by our core flow +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 **flow** subgraph, the +[`schema.graphql`](https://github.com/sablier-labs/subgraphs/blob/main/apps/flow/schema.graphql) file is responsible of +defining the following Sablier entities: + +### Primary + +| Entity | Description | +| -------- | ------------------------------------------------------------------------------------------- | +| Contract | Instances of `SablierFlow` | +| Action | Emitted events transformed into historical entries (e.g. Create, Withdraw, Adjust, Deposit) | +| Stream | Primary entity tracking the up to date state of a stream | +| Asset | The ERC20 asset that is being streamed | + +### Secondary + +| Entity | Description | +| ------- | ------------------------------------------------------------------------------------------------------------------------- | +| Batch | An entity grouping a set of stream created all at once (action done through the batch interface of SablierFlow contracts) | +| 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/flow/the-graph/02-structure.mdx b/docs/api/flow/the-graph/02-structure.mdx new file mode 100644 index 00000000..46f253f3 --- /dev/null +++ b/docs/api/flow/the-graph/02-structure.mdx @@ -0,0 +1,138 @@ +--- +id: "structure" +sidebar_position: 2 +title: "Structure" +--- + +We'll break down the [schema](https://github.com/sablier-labs/subgraphs/blob/main/apps/flow/schema.graphql) into primary +and secondary entities. + +| Type | Entities | +| --------- | ------------------------------- | +| Primary | Contract, Action, Stream, Asset | +| Secondary | Batch, Batcher, Watcher | + +## Contract + +The subgraph is designed to track multiple deployments. Therefore, at any given time the indexer may listen for updates +on many instances of `SablierFlow` contracts . + +A unique `alias` will be attributed to every contract, such that contracts (and later streams) will be identifiable +through both a long form and a short form identifier. See the [Stream](#stream) for details. + +--- + +## Action + +Events emitted by the Sablier Flow contracts will: + +1. Be used to mutate the data stored in the individual `Stream` entities +2. Be stored as historical logs (list of `Action`) to show the evolution of a related stream + +Based on the schema defined `ActionCategory`, the following actions will be tracked by the subgraph: + +| Action | Contract Events | +| -------------- | ---------------------- | +| Approval | Approval | +| ApprovalForAll | ApprovalForAll | +| Adjust | AdjustFlowStream | +| Create | CreateFlowStream | +| Deposit | DepositFlowStream | +| Pause | PauseFlowStream | +| Refund | RefundFromFlowStream | +| Restart | RestartFlowStream | +| Transfer | Transfer | +| Void | VoidFlowStream | +| Withdraw | WithdrawFromFlowStream | + +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/subgraphs/blob/52f00f31a89c91dcf24480a5d7d8b25c84467f15/apps/flow/src/mappings/handle-stream.ts#L53-L56) +for the Adjust event. + +--- + +## Stream + +### Identifying + +Inside the contracts, streams will be assigned a unique `tokenId` (or `streamId`). While this makes it easy to identify +items at the contract level, we need to consider the following for both subgraphs and client interfaces: + +- items should be uniquely recognizable across multiple contract instances +- items should be uniquely identifiable across multiple chains +- items should be identifiable with short, easy to digest names + +To address these observations, the subgraph uses two related identifiers for a Stream. + +| Type | Description | Example | +| -------------- | --------------------------------------------------------------------------------------------------- | ------------------------------ | +| `Stream.id` | A self-explanatory structure built using the following structure: `contractAddress-chainId-tokenId` | `0xAB..12-137-21` | +| `Stream.alias` | A short version of the `id` where the contract is aliased: `contractAlias-chainId-tokenId` | `FL-137-21` | + +Both examples from the table above translate to: **_a stream on Polygon (chain id `137`), within the Flow contract at +address `0xAB..12`, with the tokenId `21`_**. + +:::note + +The aliases defined in the subgraph will be used by client apps to resolve data about a stream. Make sure to keep them +in sync, avoid conflicts and regard them as immutable (once decided, never change them). + +::: + +### Aliases + +To provide a simple visual structure, while also accounting for future stream curves (backwards compatibility) we use +the following abbreviations as aliases: + +- FLOW V1.0 contracts become `FL`, e.g. `FL-137-1` + +### Relevant parties + +#### The recipient (gets paid\*) + +As funds are being streamed, they will slowly become eligible to withdraw and spend unlocked assets. The `recipient` is +defined at the start of the stream but can change as a result of a transfer. + +On transfer, the old recipient moves the NFT (the stream itself) to another address, which becomes the new recipient. +Rights to withdraw and claim future streamed funds are naturally transferred to this new address. + +#### The sender (will pay\*) + +They are an immutable party, defined at the start of the stream. Based on the configuration chosen for the stream, they +will be entitled to later pause the stream, void it (stop and erased any accrued debt), withdraw on behalf of the +recipient or refund any of the unstreamed assets. + +## Asset + +Tokens (ERC20) streamed through the protocol will be defined through an `Asset` entity. + +:::info + +As a development caveat, some ERC20 contracts are designed to store details (e.g. name, symbol) as `bytes32` and not +`string`. Prior to deploying a subgraph, make sure you take into account these details as part of any Asset entity +implementation. For examples, see the asset "helper" files inside this subgraph's repository code. + +::: + +--- + +## Batch and Batcher + +The SablierFlow contracts through the implementation of the IBatch interface allow executing multiple actions in the +same transaction. One of these functionalities will be **batch stream creation** (or **stream grouping**). Using the +`batch` that receives the encoded data of multiple `create` function calls, a sender will be able to create multiple +streams at once - considered part of the same batch. This is similar with the +[lockup create multiple functions](/api/lockup/the-graph/structure#batch-and-batcher) + +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 +index to every group. + +--- + +## Watcher + +The Watcher (one for the entire subgraph) will provide specific utilities to the entire system, like global stream +identifiers (a numeric id unique to a stream across all contract instances) and global action identifiers. diff --git a/docs/api/flow/the-graph/03-architecture.mdx b/docs/api/flow/the-graph/03-architecture.mdx new file mode 100644 index 00000000..74e824dc --- /dev/null +++ b/docs/api/flow/the-graph/03-architecture.mdx @@ -0,0 +1,58 @@ +--- +id: "architecture" +sidebar_position: 3 +title: "Architecture" +--- + +## Preparations + +In order to start indexing all whitelisted Flow contracts we need a genesis event. With Sablier Flow, there is no +factory pattern so we couldn't rely on a +[data source](https://thegraph.com/docs/en/developing/creating-a-subgraph/#data-source-templates) contract. The next +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. You should extend the file described +[here](/api/lockup/the-graph/architecture#preparations) with the following + +```ts title="packages/constants/.../sepolia.ts" +... +export let startBlock_flow = 6618000; + +/** Rule: keep addresses lowercased */ + +/** + * Keep aliases unique and always in sync with the frontend + * @example export let linear = [[address1, alias1, version1], [address2, alias2, version2]] + */ + +... + +export let flow: string[][] = [ + ["0x83dd52fca44e069020b58155b761a590f12b59d3", "FL", "V10"], +]; + +// highlight-start +/** + * The initializer contract is used to trigger the indexing of all other contracts. + * It should be a linear contract, the oldest/first one deployed on this chain. + * ↪ 🚨 On any new chain, please create a Flow stream to kick-off the indexing flow + */ + +export let initializer_flow = flow[0][0]; +//highlight-end +``` + +## Configurations + +Using this data, we'll call the `yarn deploy:` script. In turn it will: + +0. **[Chain]** Lock onto a specified chain +1. **[Setup]** Clean artifacts and older files +2. **[Template]** Convert TS files into JS for mustache to use in the next step +3. **[Template]** Use mustache to create a specific `subgraph.yaml` (from `subgraph.template.yaml`) using the selected + chain's details +4. **[Template]** Duplicate the selected chain's configuration file as the "current" `env.ts` (for possible imports + directly in Assembly Script) +5. **[Codegen]** Run codegen using the files prepared above, as well as the handlers implementation +6. **[Deploy]** Deploy the code to the endpoint selected based on the specified chain diff --git a/docs/api/flow/the-graph/04-queries.md b/docs/api/flow/the-graph/04-queries.md new file mode 100644 index 00000000..3e1ebbde --- /dev/null +++ b/docs/api/flow/the-graph/04-queries.md @@ -0,0 +1,144 @@ +--- +id: "queries" +sidebar_position: 4 +title: "Queries" +--- + +Building on top of the [entity structure](/api/flow/the-graph/structure) defined earlier, here are some common GraphQL +queries for fetching data from the Sablier subgraph. + +### Recent streams + +```graphql title="The 10 most recent streams" +query getStreams { + streams(first: 10, orderBy: subgraphId, orderDirection: desc) { + id + alias + category + asset { + id + symbol + } + } +} +``` + +### Paginated streams + +To query streams in sets/pages (and avoid edge cases where using timestamps may skip simultaneous batched streams), we +can use the unique `subgraphId`. + +This query includes pagination. + +```graphql title="The next streams indexed before the last seen subgraphId" +query getStreams($first: Int!, $subgraphId: numeric!) { + streams(first: $first, orderBy: subgraphId, orderDirection: desc, where: { subgraphId_lt: $subgraphId }) { + id + alias + category + asset { + id + symbol + } + } +} +``` + +### Streams by sender + +```graphql title="The next streams created by an address" +streams( + first: $first + skip: $skip + orderBy: $subgraphId + orderDirection: desc + where: { + and: [{ sender: $sender }, { subgraphId_lt: $subgraphId }] + } +) { + id + alias + category +} +``` + +### Streams by sender or recipient + +To show all streams that have an address marked as a sender or a recipient, extend the example above to account for the +recipient aspect. + +This query includes pagination. + +```graphql title="The next streams related to an address, as a sender or recipient" +streams( + first: $first + skip: $skip + orderBy: $subgraphId + orderDirection: desc + where: { + or: [ + { and: [{ sender: $sender }, { subgraphId_lt: $subgraphId }] } + { and: [{ recipient: $recipient }, { subgraphId_lt: $subgraphId }] } + ] + } +) { + id + alias + category + } +``` + +### Streams by filters + +The official V2 Interfaces will provide a search interface where one may query for a list of streams using the following +filters (the conditions will be combined) + +- the sender address +- the recipient address +- a list of stream identifiers + +This query includes pagination. + +```graphql title="The 'where' clause for a complex paginated search filter" +where: { + or: [ + { + and: [ + { sender: $sender } + { id_in: $streamIds } + { subgraphId_lt: $subgraphId } + ] + } + { + and: [ + { recipient: $recipient } + { id_in: $streamIds } + { subgraphId_lt: $subgraphId } + ] + } + ] +} +``` + +### Actions by stream + +:::tip + +To avoid writing the same entity definitions over and over again, check out Fragments. + +::: + +```graphql title="Most recent 100 stream actions such as withdrawals or transfers" +actions( + first: 100 + orderBy: subgraphId # Action's subgraph id + orderDirection: desc + where: { stream: $streamId } +) { + id + category + stream { + ...StreamFragment + } +} +``` diff --git a/docs/api/flow/the-graph/_category_.json b/docs/api/flow/the-graph/_category_.json new file mode 100644 index 00000000..d24628e9 --- /dev/null +++ b/docs/api/flow/the-graph/_category_.json @@ -0,0 +1,5 @@ +{ + "collapsed": true, + "label": "The Graph", + "position": 3 +} diff --git a/docs/api/lockup/02-endpoints.mdx b/docs/api/lockup/02-endpoints.mdx index ca8f668d..4cb8b7ea 100644 --- a/docs/api/lockup/02-endpoints.mdx +++ b/docs/api/lockup/02-endpoints.mdx @@ -64,9 +64,9 @@ 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] | +| Chain | Endpoint (Hosted Network) | +| ---------------- | ------------------------------------------------------------------ | +| All-Networks[^3] | [https://indexer.hyperindex.xyz/[...]/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. @@ -189,7 +189,7 @@ The endpoint is meant to be plugged into a query client. Use {/* --------------------------------------------------------------------------------------------------------------------------------- */} -[endpoint-lockup]: https://indexer.bigdevenergy.link/9e37ca4/v1/graphql +[endpoint-lockup]: https://indexer.hyperindex.xyz/9e37ca4/v1/graphql {/* --------------------------------------------------------------------------------------------------------------------------------- */} {/* --------------------------------------------------------------------------------------------------------------------------------- */} diff --git a/docs/api/lockup/envio/03-queries.mdx b/docs/api/lockup/envio/03-queries.mdx index 3fa0b3ec..f1dfb379 100644 --- a/docs/api/lockup/envio/03-queries.mdx +++ b/docs/api/lockup/envio/03-queries.mdx @@ -11,7 +11,7 @@ queries for fetching data from the Sablier subgraph. ```graphql title="The 10 most recent streams" query getStreams { - stream(limit: 10, order_by: { subgraphId: desc }) { + Stream(limit: 10, distinct_on: [subgraphId], order_by: { subgraphId: desc }) { id alias category @@ -32,7 +32,7 @@ This query includes pagination. ```graphql title="The next streams indexed before the last seen subgraphId" query getStreams($first: Int!, $subgraphId: numeric!) { - streams( + Stream( limit: $first distinct_on: [subgraphId] order_by: { subgraphId: desc } @@ -164,7 +164,7 @@ Action( limit: 100 distinct_on: [subgraphId] order_by: { subgraphId: desc } - where: { stream: {_eq: $streamId} } + where: { stream_id: {_eq: $streamId} } ) { id category diff --git a/docs/api/lockup/the-graph/01-entities.mdx b/docs/api/lockup/the-graph/01-entities.mdx index d23f11f3..d713e225 100644 --- a/docs/api/lockup/the-graph/01-entities.mdx +++ b/docs/api/lockup/the-graph/01-entities.mdx @@ -10,7 +10,7 @@ GraphQL entities defined by the Sablier subgraphs are meant to mirror the functi 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 +Inside the **lockup** subgraph, the [`schema.graphql`](https://github.com/sablier-labs/subgraphs/blob/main/apps/lockup/schema.graphql) file is responsible of defining the following Sablier entities: diff --git a/docs/api/lockup/the-graph/02-structure.mdx b/docs/api/lockup/the-graph/02-structure.mdx index 288cc584..50c61f4a 100644 --- a/docs/api/lockup/the-graph/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/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/lockup/schema.graphql) into +primary and secondary entities. | Type | Entities | | --------- | ------------------------------------------------- | diff --git a/docs/api/lockup/the-graph/04-queries.md b/docs/api/lockup/the-graph/04-queries.md index e37fdd69..38aec8e0 100644 --- a/docs/api/lockup/the-graph/04-queries.md +++ b/docs/api/lockup/the-graph/04-queries.md @@ -54,22 +54,6 @@ To support both [proxy senders](/api/lockup/the-graph/structure) (case 3) and This query includes pagination. -```graphql title="The next streams indexed before the last seen subgraphId" -query getStreams($first: Int!, $skip: Int!, $subgraphId: BigInt!) { - streams( - first: $first - skip: $skip - orderBy: $subgraphId - orderDirection: desc - where: { subgraphId_lt: $subgraphId } - ) { - id - alias - category - } -} -``` - ```graphql title="The next streams created by an address (natively or through a proxy)" streams( first: $first diff --git a/docs/apps/features/01-overview.mdx b/docs/apps/features/01-overview.mdx index 18439e68..4e1360b9 100644 --- a/docs/apps/features/01-overview.mdx +++ b/docs/apps/features/01-overview.mdx @@ -37,7 +37,7 @@ 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). +vesting-related features documented in [this section](/apps/features/payments). ## Drops / Airstreams diff --git a/docs/apps/features/02-vesting.mdx b/docs/apps/features/02-vesting.mdx index 4e1b2a15..1bb0fece 100644 --- a/docs/apps/features/02-vesting.mdx +++ b/docs/apps/features/02-vesting.mdx @@ -74,8 +74,8 @@ Thus streams can be transferred, traded, and used as collateral in NFT lending p Streaming, everywhere. We support 11+ EVM chains and testnets where you can stream or get paid using Sablier. -| | -| --------------------------------------------- | +| | +| ---------------------------------------------- | | ![ChainList](/screenshots/general-chains.webp) | ### Create in batches diff --git a/docs/apps/features/03-payments.mdx b/docs/apps/features/03-payments.mdx index 0ee77952..941da6bf 100644 --- a/docs/apps/features/03-payments.mdx +++ b/docs/apps/features/03-payments.mdx @@ -24,8 +24,8 @@ Enter the Dashboard and discover a detailed overview of your incoming and outgoi 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.webp) | ### Preview any stream @@ -33,8 +33,8 @@ continuous payments, grants, salaries and more. 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.webp) | ### NFT representation @@ -47,8 +47,8 @@ Thus streams can be transferred, traded, and used as collateral in NFT lending p Streaming, everywhere. We enable payments on 11+ EVM chains and testnets where you can stream or get paid using Sablier. -| | -| --------------------------------------------- | +| | +| ---------------------------------------------- | | ![ChainList](/screenshots/general-chains.webp) | ### Create in batches diff --git a/docs/apps/features/04-drops.mdx b/docs/apps/features/04-drops.mdx index 1b866091..4ca06a28 100644 --- a/docs/apps/features/04-drops.mdx +++ b/docs/apps/features/04-drops.mdx @@ -62,7 +62,7 @@ Create a campaign by following these three simple steps: | | | -------------------------------------------------------- | -| ![Step 1](/screenshots/drops-form-1.webp) | +| ![Step 1](/screenshots/drops-form-1.webp) | | ![Step 2](/screenshots/airstream-create-recipients.webp) | ### Public source @@ -77,8 +77,8 @@ Enter the Dashboard and discover a detailed overview of the Drops you may be eli Take advantage of the Search functionality to explore the chain and gain more insight into how others are using Sablier. -| | -| ------------------------------------- | +| | +| -------------------------------------- | | ![All](/screenshots/drops-search.webp) | ### Support for any ERC-20 token @@ -86,8 +86,8 @@ Take advantage of the Search functionality to explore the chain and gain more in 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.webp) | ### Oversight @@ -111,6 +111,6 @@ the [v2-merkle-api](/api/drops/merkle-api/overview) and the merkle subgraphs. 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.webp) | diff --git a/docs/guides/flow/04-gas-benchmarks.md b/docs/guides/flow/04-gas-benchmarks.md index 235f7800..ebbc4057 100644 --- a/docs/guides/flow/04-gas-benchmarks.md +++ b/docs/guides/flow/04-gas-benchmarks.md @@ -19,15 +19,15 @@ The following gas benchmarks are generated using a 6-decimal token. | Function | Gas Usage | | ----------------------------- | --------- | -| `adjustRatePerSecond` | 44171 | -| `create` | 113681 | -| `deposit` | 32975 | -| `depositViaBroker` | 22732 | -| `pause` | 7522 | -| `refund` | 11939 | -| `restart` | 7036 | -| `void (solvent stream)` | 10060 | -| `void (insolvent stream)` | 37460 | -| `withdraw (insolvent stream)` | 57688 | -| `withdraw (solvent stream)` | 38156 | -| `withdrawMax` | 51988 | +| `adjustRatePerSecond` | 44,171 | +| `create` | 113,681 | +| `deposit` | 32,975 | +| `depositViaBroker` | 22,732 | +| `pause` | 7,522 | +| `refund` | 11,939 | +| `restart` | 7,036 | +| `void (solvent stream)` | 10,060 | +| `void (insolvent stream)` | 37,460 | +| `withdraw (insolvent stream)` | 57,688 | +| `withdraw (solvent stream)` | 38,156 | +| `withdrawMax` | 51,988 | diff --git a/formatter.js b/formatter.js index 350b508e..77165e42 100644 --- a/formatter.js +++ b/formatter.js @@ -8,5 +8,5 @@ async function formatGasBenchmark(filePath) { await fs.writeFile(filePath, formattedContent); } -formatGasBenchmark("docs/guides/lockup/03-gas-benchmarks.md"); -// formatGasBenchmark('docs/guides/flow/03-gas-benchmarks.md'); // TODO enable once flow benchmarks are added +formatGasBenchmark("docs/guides/lockup/04-gas-benchmarks.md"); +formatGasBenchmark("docs/guides/flow/04-gas-benchmarks.md"); 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