-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
first pass at updating RFQ relayer documentation #3000
Conversation
WalkthroughThe recent documentation updates provide clarity and detail across the RFQ API, Synapse RFQ Contract, and Relayer functionalities. Changes include specifying the signature format for the RFQ API, adding support for additional blockchain networks, detailing the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Deploying sanguine-fe with
|
Latest commit: |
60e7cbf
|
Status: | ✅ Deploy successful! |
Preview URL: | https://416042ec.sanguine-fe.pages.dev |
Branch Preview URL: | https://docs-rfq-update.sanguine-fe.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (3)
docs/bridge/docs/rfq/Contracts.md (1)
51-51
: Use a Heading Instead of Emphasis.The text "ChainGas" should be formatted as a heading to improve readability and adhere to Markdown best practices.
- **ChainGas** + ### ChainGasTools
Markdownlint
51-51: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
docs/bridge/docs/rfq/Relayer/Relayer.md (2)
96-96
: Avoid Using Bare URLs.The URL for the Omnirpc instance should be formatted as a hyperlink to enhance readability and adhere to Markdown best practices.
- omnirpc_url: 'http://omnirpc' # url of the omnirpc instance, please reference [this](../../Services/Omnirpc) for proper configuration + omnirpc_url: '[Omnirpc URL](http://omnirpc)' # url of the omnirpc instance, please reference [this](../../Services/Omnirpc) for proper configurationTools
Markdownlint
96-96: null
Bare URL used(MD034, no-bare-urls)
182-182
: Avoid Using Bare URLs.The URL for the base Omnirpc should be formatted as a hyperlink to enhance readability and adhere to Markdown best practices.
- base_omnirpc_url: "http://omnirpc" # Make sure this is configured properly + base_omnirpc_url: "[Omnirpc URL](http://omnirpc)" # Make sure this is configured properlyTools
Markdownlint
182-182: null
Bare URL used(MD034, no-bare-urls)
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (3)
- docs/bridge/docs/rfq/API/API.md (1 hunks)
- docs/bridge/docs/rfq/Contracts.md (3 hunks)
- docs/bridge/docs/rfq/Relayer/Relayer.md (4 hunks)
Additional context used
Markdownlint
docs/bridge/docs/rfq/Contracts.md
51-51: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
docs/bridge/docs/rfq/Relayer/Relayer.md
96-96: null
Bare URL used(MD034, no-bare-urls)
182-182: null
Bare URL used(MD034, no-bare-urls)
LanguageTool
docs/bridge/docs/rfq/Relayer/Relayer.md
[style] ~7-~7: Consider a shorter alternative to avoid wordiness.
Context: ...- :::note Relayers must be whitelisted in order to fill bridgeRequests. ::: At a high le...(IN_ORDER_TO_PREMIUM)
[grammar] ~32-~32: Probably a preposition is missing after ‘continue’.
Context: ...is below themaintenance_balance_pct
, continue 2. Calculate the amount to rebalance by taking the d...(ATD_VERBS_TO_COLLOCATION)
[style] ~34-~34: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ebalance to themax_rebalance_amount
. If the amount to rebalance is less than th...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[uncategorized] ~37-~37: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...lementation for certain native bridges (e.g Scroll) is also supported. It works sli...(E_G)
Additional comments not posted (5)
docs/bridge/docs/rfq/API/API.md (1)
34-35
: Clarification on Signature V Values.The added note effectively clarifies the requirement for V values in signatures to be 0 or 1, which is crucial for users to correctly interact with the RFQ API. This enhances the documentation's clarity.
docs/bridge/docs/rfq/Contracts.md (2)
11-15
: Expansion of Supported Networks.The addition of new entries for "Scroll," "Linea," "BNB Chain," and "Blast" networks provides users with more comprehensive information on supported platforms. This is a valuable update for users integrating with these networks.
41-47
: Introduction of Dispute Period and Guards.The new section on dispute periods and guards enhances the documentation by outlining mechanisms that ensure the integrity of bridge transactions. This addition is crucial for understanding the security framework of the RFQ system.
docs/bridge/docs/rfq/Relayer/Relayer.md (2)
7-8
: Note on Whitelisting Relayers.The added note emphasizes the critical requirement for relayers to be whitelisted, which is essential for operational compliance. This clarification is important for users to understand the prerequisites for relayer functionality.
Tools
LanguageTool
[style] ~7-~7: Consider a shorter alternative to avoid wordiness.
Context: ...- :::note Relayers must be whitelisted in order to fill bridgeRequests. ::: At a high le...(IN_ORDER_TO_PREMIUM)
30-30
: Clarification on Rebalancing Loop.The expanded explanation of the rebalancing loop and support for native bridges like Scroll provides valuable insights into the relayer's operational scope. This addition improves the documentation's comprehensiveness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request updates the RFQ (Request for Quote) system documentation in the Synapse project, enhancing clarity and providing more detailed guidance for developers and users.
- Added note about relayer whitelisting requirement in
/docs/bridge/docs/rfq/Relayer/Relayer.md
- Introduced "Dispute Period and Guards" section in
/docs/bridge/docs/rfq/Contracts.md
to explain security measures - Expanded supported blockchain networks list in
/docs/bridge/docs/rfq/Contracts.md
- Clarified API signature requirements in
/docs/bridge/docs/rfq/API/API.md
, specifying V values should be 0/1 instead of 27/28 - Enhanced rebalancing logic explanation, including CCTP and native bridge (e.g., Scroll) implementations in
/docs/bridge/docs/rfq/Relayer/Relayer.md
3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (4)
docs/bridge/docs/rfq/Relayer/Relayer.md (4)
5-9
: Consider reducing wordiness in the note.The note could be made more concise. Consider revising to: "Relayers must be whitelisted to fill bridge requests."
- Relayers must be whitelisted in order to fill bridgeRequests. + Relayers must be whitelisted to fill bridge requests.Tools
LanguageTool
[style] ~7-~7: Consider a shorter alternative to avoid wordiness.
Context: ...- :::note Relayers must be whitelisted in order to fill bridgeRequests. ::: At a high le...(IN_ORDER_TO_PREMIUM)
30-38
: Improve readability and grammar in the rebalancing section.Consider the following revisions for clarity and grammatical accuracy:
- Add a preposition after "continue" in step 1.
- Vary sentence beginnings in step 3.
- Correct the abbreviation "e.g." to "e.g.,".
- Add a comma after "differently".
- Add "the" before "mainnet" for clarity.
- If the balance is below the `maintenance_balance_pct`, continue + If the balance is below the `maintenance_balance_pct`, then continue - If the amount to rebalance is greater than the `max_rebalance_amount`, set the amount to rebalance to the `max_rebalance_amount`. If the amount to rebalance is less than the `min_rebalance_amount`, do not rebalance. + If the amount to rebalance exceeds the `max_rebalance_amount`, adjust it to the `max_rebalance_amount`. Conversely, if it is below the `min_rebalance_amount`, skip rebalancing. - The implementation for certain native bridges (e.g Scroll) is also supported. It works slightly differently as flows are only supported between Scroll and Mainnet. + The implementation for certain native bridges (e.g., Scroll) is also supported. It works slightly differently, as flows are only supported between Scroll and the Mainnet.Tools
LanguageTool
[grammar] ~32-~32: Probably a preposition is missing after ‘continue’.
Context: ...is below themaintenance_balance_pct
, continue 2. Calculate the amount to rebalance by taking the d...(ATD_VERBS_TO_COLLOCATION)
[style] ~34-~34: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ebalance to themax_rebalance_amount
. If the amount to rebalance is less than th...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[uncategorized] ~37-~37: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...lementation for certain native bridges (e.g Scroll) is also supported. It works sli...(E_G)
[uncategorized] ~37-~37: Possible missing comma found.
Context: ...l) is also supported. It works slightly differently as flows are only supported between Scr...(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~37-~37: You might be missing the article “the” here.
Context: ...nd if imbalanced, initiates a bridge to mainnet, allowing the CCTP relayer to rebalance...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
96-96
: Format the bare URL properly.Use markdown syntax to format the URL:
[Omnirpc section](../../Services/Omnirpc)
.- omnirpc_url: 'http://omnirpc' # url of the omnirpc instance, please reference the Omnirpc section under Services for proper configuration + omnirpc_url: 'http://omnirpc' # url of the omnirpc instance, please reference the [Omnirpc section](../../Services/Omnirpc) under Services for proper configurationTools
Markdownlint
96-96: null
Bare URL used(MD034, no-bare-urls)
182-182
: Format the bare URL properly.Use markdown syntax to format the URL:
[Omnirpc](http://omnirpc)
.- base_omnirpc_url: "http://omnirpc" # Make sure this is configured properly + base_omnirpc_url: "[Omnirpc](http://omnirpc)" # Make sure this is configured properlyTools
Markdownlint
182-182: null
Bare URL used(MD034, no-bare-urls)
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- docs/bridge/docs/rfq/Relayer/Relayer.md (4 hunks)
Additional context used
LanguageTool
docs/bridge/docs/rfq/Relayer/Relayer.md
[style] ~7-~7: Consider a shorter alternative to avoid wordiness.
Context: ...- :::note Relayers must be whitelisted in order to fill bridgeRequests. ::: At a high le...(IN_ORDER_TO_PREMIUM)
[grammar] ~32-~32: Probably a preposition is missing after ‘continue’.
Context: ...is below themaintenance_balance_pct
, continue 2. Calculate the amount to rebalance by taking the d...(ATD_VERBS_TO_COLLOCATION)
[style] ~34-~34: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ebalance to themax_rebalance_amount
. If the amount to rebalance is less than th...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[uncategorized] ~37-~37: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...lementation for certain native bridges (e.g Scroll) is also supported. It works sli...(E_G)
[uncategorized] ~37-~37: Possible missing comma found.
Context: ...l) is also supported. It works slightly differently as flows are only supported between Scr...(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~37-~37: You might be missing the article “the” here.
Context: ...nd if imbalanced, initiates a bridge to mainnet, allowing the CCTP relayer to rebalance...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
Markdownlint
docs/bridge/docs/rfq/Relayer/Relayer.md
96-96: null
Bare URL used(MD034, no-bare-urls)
182-182: null
Bare URL used(MD034, no-bare-urls)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- docs/bridge/docs/rfq/Contracts.md (3 hunks)
- docs/bridge/docs/rfq/Relayer/Relayer.md (4 hunks)
Additional context used
Markdownlint
docs/bridge/docs/rfq/Contracts.md
13-13: Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe
Table pipe style(MD055, table-pipe-style)
13-13: Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
13-13: Expected: 2; Actual: 1; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
56-56: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
docs/bridge/docs/rfq/Relayer/Relayer.md
114-114: null
Bare URL used(MD034, no-bare-urls)
200-200: null
Bare URL used(MD034, no-bare-urls)
LanguageTool
docs/bridge/docs/rfq/Relayer/Relayer.md
[style] ~7-~7: Consider a shorter alternative to avoid wordiness.
Context: ...- :::note Relayers must be whitelisted in order to fill bridgeRequests. ::: At a high le...(IN_ORDER_TO_PREMIUM)
[grammar] ~32-~32: Probably a preposition is missing after ‘continue’.
Context: ...is below themaintenance_balance_pct
, continue 2. Calculate the amount to rebalance by taking the d...(ATD_VERBS_TO_COLLOCATION)
[style] ~34-~34: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ebalance to themax_rebalance_amount
. If the amount to rebalance is less than th...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[uncategorized] ~37-~37: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...lementation for certain native bridges (e.g Scroll) is also supported. It works sli...(E_G)
[uncategorized] ~37-~37: Possible missing comma found.
Context: ...l) is also supported. It works slightly differently as flows are only supported between Scr...(AI_HYDRA_LEO_MISSING_COMMA)
Additional comments not posted (8)
docs/bridge/docs/rfq/Contracts.md (4)
30-30
: Clarification onprove
function usage is clear.The requirement for the
prove
function to be called from the solver's address is well-explained and adds necessary detail.
44-44
: On-Chain Statuses are well-defined.The statuses provide a clear understanding of the transaction lifecycle in the RFQ contract.
46-52
: Dispute mechanisms are clearly explained.The section provides a thorough understanding of the dispute period and the role of guards in ensuring transaction integrity.
56-58
: Explanation ofsendChainGas
is clear.The section clarifies the purpose and current implementation status of the
sendChainGas
field, aiding user understanding.Tools
Markdownlint
56-56: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
docs/bridge/docs/rfq/Relayer/Relayer.md (4)
5-9
: Whitelisting requirement is clearly stated.The note effectively communicates the need for relayers to be whitelisted, providing essential information for users.
Tools
LanguageTool
[style] ~7-~7: Consider a shorter alternative to avoid wordiness.
Context: ...- :::note Relayers must be whitelisted in order to fill bridgeRequests. ::: At a high le...(IN_ORDER_TO_PREMIUM)
Line range hint
11-21
: Quoting process is well-described.The section provides a clear and detailed explanation of the quoting process and its components.
Tools
LanguageTool
[style] ~7-~7: Consider a shorter alternative to avoid wordiness.
Context: ...- :::note Relayers must be whitelisted in order to fill bridgeRequests. ::: At a high le...(IN_ORDER_TO_PREMIUM)
Line range hint
39-49
: Relaying process is well-documented.The section provides a clear and detailed explanation of the relaying process and its states.
Tools
LanguageTool
[grammar] ~32-~32: Probably a preposition is missing after ‘continue’.
Context: ...is below themaintenance_balance_pct
, continue 2. Calculate the amount to rebalance by taking the d...(ATD_VERBS_TO_COLLOCATION)
[style] ~34-~34: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ebalance to themax_rebalance_amount
. If the amount to rebalance is less than th...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[uncategorized] ~37-~37: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...lementation for certain native bridges (e.g Scroll) is also supported. It works sli...(E_G)
[uncategorized] ~37-~37: Possible missing comma found.
Context: ...l) is also supported. It works slightly differently as flows are only supported between Scr...(AI_HYDRA_LEO_MISSING_COMMA)
Line range hint
202-204
: Observability features are well-documented.The section provides a clear and detailed explanation of the observability features of the RFQ relayer.
Tools
Markdownlint
200-200: null
Bare URL used(MD034, no-bare-urls)
Gitleaks
199-199: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
docs/bridge/docs/rfq/Contracts.md
Outdated
<<<<<<< HEAD | ||
| BNB Chain| [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://bscscan.com/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) | | ||
| Blast | [0x34F52752975222d5994C206cE08C1d5B329f24dD](https://blastscan.io/address/0x34F52752975222d5994C206cE08C1d5B329f24dD) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix table formatting issues.
The table is missing leading and trailing pipes, and the row for "BNB Chain" has too few cells.
Apply this diff to fix the table formatting:
| Chain | Address |
| -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Arbitrum | [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://arbiscan.io/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) |
| Base | [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://basescan.org/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) |
| Ethereum | [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://etherscan.io/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) |
| Optimism | [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://optimistic.etherscan.io/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) |
| Scroll | [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://scrollscan.com/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) |
| Linea | [0x34F52752975222d5994C206cE08C1d5B329f24dD](https://lineascan.build/address/0x34F52752975222d5994C206cE08C1d5B329f24dD) |
+| BNB Chain| [0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E](https://bscscan.com/address/0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E) |
+| Blast | [0x34F52752975222d5994C206cE08C1d5B329f24dD](https://blastscan.io/address/0x34F52752975222d5994C206cE08C1d5B329f24dD) |
Committable suggestion was skipped due to low confidence.
Tools
Markdownlint
13-13: Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe
Table pipe style(MD055, table-pipe-style)
13-13: Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe
Table pipe style(MD055, table-pipe-style)
13-13: Expected: 2; Actual: 1; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
@@ -104,7 +111,7 @@ The relayer is configured with a yaml file. The following is an example configur | |||
|
|||
screener_api_url: 'http://screener-url' # can be left blank | |||
rfq_url: 'http://rfq-api' # url of the rfq api backend. | |||
omnirpc_url: 'http://omnirpc' # url of the omnirpc instance | |||
omnirpc_url: 'http://omnirpc' # url of the omnirpc instance, please reference the Omnirpc section under Services for proper configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix bare URL issue in configuration section.
There are bare URLs in the configuration section that should be formatted as links.
Apply this diff to fix the bare URL issue:
- omnirpc_url: 'http://omnirpc' # url of the omnirpc instance, please reference the Omnirpc section under Services for proper configuration
+ omnirpc_url: '[http://omnirpc](http://omnirpc)' # url of the omnirpc instance, please reference the Omnirpc section under Services for proper configuration
- base_omnirpc_url: "http://omnirpc" # Make sure this is configured properly
+ base_omnirpc_url: "[http://omnirpc](http://omnirpc)" # Make sure this is configured properly
The section provides a detailed explanation of the configuration parameters for the relayer.
Also applies to: 200-200
Tools
Markdownlint
114-114: null
Bare URL used(MD034, no-bare-urls)
The rebalancing loop is more complex and is responsible for ensuring that the relayer has enough liquidity on each chain. The CCTP rebalancer is supported and works like this: | ||
|
||
1. At `rebalance_interval`, check the `maintenance_balance_pct` of each token on each chain and compare it to the current balance. If the balance is below the `maintenance_balance_pct`, continue | ||
2. Calculate the amount to rebalance by taking the difference between the maintenance balance and the current balance and multiplying it by the `initial_balance_pct`. | ||
3. If the amount to rebalance is greater than the `max_rebalance_amount`, set the amount to rebalance to the `max_rebalance_amount`. If the amount to rebalance is less than the `min_rebalance_amount`, do not rebalance. | ||
4. Repeat after `rebalance_interval` | ||
|
||
The implementation for certain native bridges (e.g Scroll) is also supported. It works slightly differently as flows are only supported between Scroll and Mainnet. At a high level, the rebalancer checks inventory on Scroll versus other chains, and if imbalanced, initiates a bridge to mainnet, allowing the CCTP relayer to rebalance funds where needed. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix grammar issue in rebalancing section.
There is a missing preposition in the sentence "If the balance is below the maintenance_balance_pct
, continue".
Apply this diff to fix the grammar issue:
1. At `rebalance_interval`, check the `maintenance_balance_pct` of each token on each chain and compare it to the current balance. If the balance is below the `maintenance_balance_pct`, continue
+ with the rebalancing process.
The section provides a detailed explanation of the rebalancing process, including support for native bridges.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
The rebalancing loop is more complex and is responsible for ensuring that the relayer has enough liquidity on each chain. The CCTP rebalancer is supported and works like this: | |
1. At `rebalance_interval`, check the `maintenance_balance_pct` of each token on each chain and compare it to the current balance. If the balance is below the `maintenance_balance_pct`, continue | |
2. Calculate the amount to rebalance by taking the difference between the maintenance balance and the current balance and multiplying it by the `initial_balance_pct`. | |
3. If the amount to rebalance is greater than the `max_rebalance_amount`, set the amount to rebalance to the `max_rebalance_amount`. If the amount to rebalance is less than the `min_rebalance_amount`, do not rebalance. | |
4. Repeat after `rebalance_interval` | |
The implementation for certain native bridges (e.g Scroll) is also supported. It works slightly differently as flows are only supported between Scroll and Mainnet. At a high level, the rebalancer checks inventory on Scroll versus other chains, and if imbalanced, initiates a bridge to mainnet, allowing the CCTP relayer to rebalance funds where needed. | |
The rebalancing loop is more complex and is responsible for ensuring that the relayer has enough liquidity on each chain. The CCTP rebalancer is supported and works like this: | |
1. At `rebalance_interval`, check the `maintenance_balance_pct` of each token on each chain and compare it to the current balance. If the balance is below the `maintenance_balance_pct`, continue with the rebalancing process. | |
2. Calculate the amount to rebalance by taking the difference between the maintenance balance and the current balance and multiplying it by the `initial_balance_pct`. | |
3. If the amount to rebalance is greater than the `max_rebalance_amount`, set the amount to rebalance to the `max_rebalance_amount`. If the amount to rebalance is less than the `min_rebalance_amount`, do not rebalance. | |
4. Repeat after `rebalance_interval` | |
The implementation for certain native bridges (e.g Scroll) is also supported. It works slightly differently as flows are only supported between Scroll and Mainnet. At a high level, the rebalancer checks inventory on Scroll versus other chains, and if imbalanced, initiates a bridge to mainnet, allowing the CCTP relayer to rebalance funds where needed. |
Tools
LanguageTool
[grammar] ~32-~32: Probably a preposition is missing after ‘continue’.
Context: ...is below themaintenance_balance_pct
, continue 2. Calculate the amount to rebalance by taking the d...(ATD_VERBS_TO_COLLOCATION)
[style] ~34-~34: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ebalance to themax_rebalance_amount
. If the amount to rebalance is less than th...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[uncategorized] ~37-~37: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...lementation for certain native bridges (e.g Scroll) is also supported. It works sli...(E_G)
[uncategorized] ~37-~37: Possible missing comma found.
Context: ...l) is also supported. It works slightly differently as flows are only supported between Scr...(AI_HYDRA_LEO_MISSING_COMMA)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3000 +/- ##
====================================================
+ Coverage 23.30197% 90.55118% +67.24921%
====================================================
Files 193 54 -139
Lines 11690 1016 -10674
Branches 82 82
====================================================
- Hits 2724 920 -1804
+ Misses 8715 93 -8622
+ Partials 251 3 -248
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (3)
docs/bridge/docs/rfq/Contracts.md (3)
23-23
: Clarify theprove
function description.The description of the
prove
function now specifies that it must be called from the solver's address. Ensure this requirement is clearly communicated in any related documentation or user guides.
37-37
: Ensure consistency in status descriptions.The status descriptions should be consistent in tone and detail. Consider adding more detail to the "Null" status to match the others.
39-45
: Enhance clarity in the "Dispute Period and Guards" section.The section provides a good overview but could benefit from more specific examples or scenarios where disputes might arise. This would help users better understand the importance and functionality of the guards.
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- docs/bridge/docs/rfq/Contracts.md (3 hunks)
Additional context used
Markdownlint
docs/bridge/docs/rfq/Contracts.md
49-49: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
Additional comments not posted (1)
docs/bridge/docs/rfq/Contracts.md (1)
13-13
: Fix table formatting issues.The table is missing leading and trailing pipes, and the row for "BNB Chain" has too few cells.
|
||
### Other Functionalities | ||
|
||
**ChainGas** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a heading instead of emphasis for "ChainGas".
The static analysis tool suggests using a heading instead of emphasis for "ChainGas" to maintain consistency with other sections.
Apply this diff to fix the heading:
-**ChainGas**
+### ChainGas
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
**ChainGas** | |
### ChainGas |
Tools
Markdownlint
49-49: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
Took a first pass and updated feedback that weve gotten from developers and teams. Two items are currently missing
Summary by CodeRabbit
prove
function in the Synapse RFQ contract documentation.eca0c94: docs preview link
5f1bcdb: docs preview link