From 825dce375316ae65dda3d24d26b1fc22bc2578b6 Mon Sep 17 00:00:00 2001 From: Alexander Ghahremany Date: Tue, 8 Oct 2024 12:08:54 +0000 Subject: [PATCH] GITBOOK-354: change request with no subject merged in GitBook --- docs/SUMMARY.md | 4 ++-- .../debridge-hooks.md | 16 ++++++++-------- .../README.md | 0 .../creating-hook-data-for-solana.md | 0 .../hook-data/anatomy-of-a-hook-for-solana.md | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) rename docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/{integrating-dln-hooks => integrating-debridge-hooks}/README.md (100%) rename docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/{integrating-dln-hooks => integrating-debridge-hooks}/creating-hook-data-for-solana.md (100%) diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index fa6a7175..fc6985f4 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -56,8 +56,8 @@ * [Interacting with the API](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/README.md) * [Authentication](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/authentication.md) * [Requesting Order Creation Transaction](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/requesting-order-creation-transaction.md) - * [Integrating DLN hooks](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-dln-hooks/README.md) - * [Creating Hook data for Solana](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-dln-hooks/creating-hook-data-for-solana.md) + * [Integrating deBridge hooks](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-debridge-hooks/README.md) + * [Creating Hook data for Solana](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-debridge-hooks/creating-hook-data-for-solana.md) * [Submitting an Order Creation Transaction](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/submitting-an-order-creation-transaction.md) * [Tracking a Status of the Order](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/tracking-a-status-of-the-order.md) * [Cancelling the Order](dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/cancelling-the-order.md) diff --git a/docs/dln-the-debridge-liquidity-network-protocol/debridge-hooks.md b/docs/dln-the-debridge-liquidity-network-protocol/debridge-hooks.md index e3d0c94e..7def4348 100644 --- a/docs/dln-the-debridge-liquidity-network-protocol/debridge-hooks.md +++ b/docs/dln-the-debridge-liquidity-network-protocol/debridge-hooks.md @@ -1,8 +1,8 @@ --- description: >- - DLN Hooks is a core feature of the DLN protocol that allows users, protocols, - and market makers to attach arbitrary on-chain actions to the orders that - would get executed upon their fulfillment. + deBridge Hooks is a core feature of the DLN protocol that allows users, + protocols, and market makers to attach arbitrary on-chain actions to the + orders that would get executed upon their fulfillment. --- # deBridge Hooks @@ -57,11 +57,11 @@ Non-atomic hooks are allowed to be executed later in a separate transaction afte ### Who pays for hook execution? -Submitting a transaction to execute a hook implies paying a transaction fee. The DLN Hooks engine provides two distinct ways to incentivize solvers and other trustless third parties to submit transactions to execute hooks. +Submitting a transaction to execute a hook implies paying a transaction fee. The deBridge Hooks engine provides two distinct ways to incentivize solvers and other trustless third parties to submit transactions to execute hooks. The most straightforward way to cover hook execution is to lay the cost in the spread of an order: say, there is an order to sell 105 USDC on Solana and buy 100 USDC on Ethereum with a hook that deposits the bought amount to the LP: in this case, the difference between sell amount and buy amount (5 USDC) must cover all the fees and costs, including the cost of this hook execution. This is the preferred approach for **atomic hooks** that target **EVM-based chains**, because in this case the hook is the part of the execution flow of a transaction that fills the order. -Additionally, a hook metadata may explicitly define a reward that the DLN Hooks engine contract should cut off an order outcome (before the outcome is transferred to a hook) in favor of a solver who pays for a transaction: for example, there could be an order to sell 106 USDC on Ethereum, buy 101 USDC on Solana with a hook that deposits exactly 100 USDC to the LP and leaves 1 USDC as a reward. This approach works for non-atomic hooks, and the smart contract guarantees that a solver would get exactly the specified amount of the outcome. +Additionally, a hook metadata may explicitly define a reward that the deBridge Hooks engine contract should cut off an order outcome (before the outcome is transferred to a hook) in favor of a solver who pays for a transaction: for example, there could be an order to sell 106 USDC on Ethereum, buy 101 USDC on Solana with a hook that deposits exactly 100 USDC to the LP and leaves 1 USDC as a reward. This approach works for non-atomic hooks, and the smart contract guarantees that a solver would get exactly the specified amount of the outcome. The DLN API simplifies a hook's cost estimation by automatically simulating transaction upon order creation. @@ -69,7 +69,7 @@ The DLN API simplifies a hook's cost estimation by automatically simulating tran A common source of frustration is a blockchain where a hook is expected to run: hooks are built for destination chains. For example, an order that sells SOL on Solana and buys ETH on Ethereum would get placed on Solana with the hook data encoded specifically for EVM, and vice versa. -Atomic **success-required hooks** that get reverted would prevent their orders from getting fulfilled, causing users' funds to stuck, which would require users to initiate [a cancellation procedure](interacting-with-the-api/cancelling-the-order.md). This increases friction and worsens the overall user experience, so it is advised to carefully test hooks and estimate potential fulfillments prior placing orders with such hooks. The API [takes the burden](interacting-with-the-api/integrating-dln-hooks/) of proper hook data validation, encoding, and hook simulation, ensuring that an order could get filled on the destination chain. +Atomic **success-required hooks** that get reverted would prevent their orders from getting fulfilled, causing users' funds to stuck, which would require users to initiate [a cancellation procedure](interacting-with-the-api/cancelling-the-order.md). This increases friction and worsens the overall user experience, so it is advised to carefully test hooks and estimate potential fulfillments prior placing orders with such hooks. The API [takes the burden](interacting-with-the-api/integrating-debridge-hooks/) of proper hook data validation, encoding, and hook simulation, ensuring that an order could get filled on the destination chain. ### Examples @@ -78,9 +78,9 @@ Atomic **success-required hooks** that get reverted would prevent their orders f ### Availability -DLN Hooks are available on all supported blockchains. Hooks can be encoded programmatically while interacting directly with smart contracts, or passed to the DLN API via a simple high level interface. +deBridge Hooks are available on all supported blockchains. Hooks can be encoded programmatically while interacting directly with smart contracts, or passed to the DLN API via a simple high level interface. Further reading: -* Easy usage with the DLN API: [integrating-dln-hooks](interacting-with-the-api/integrating-dln-hooks/ "mention") +* Easy usage with the DLN API: [integrating-debridge-hooks](interacting-with-the-api/integrating-debridge-hooks/ "mention") * Technical specification: [hook-data](protocol-specs/hook-data/ "mention") diff --git a/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-dln-hooks/README.md b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-debridge-hooks/README.md similarity index 100% rename from docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-dln-hooks/README.md rename to docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-debridge-hooks/README.md diff --git a/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-dln-hooks/creating-hook-data-for-solana.md b/docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-debridge-hooks/creating-hook-data-for-solana.md similarity index 100% rename from docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-dln-hooks/creating-hook-data-for-solana.md rename to docs/dln-the-debridge-liquidity-network-protocol/interacting-with-the-api/integrating-debridge-hooks/creating-hook-data-for-solana.md diff --git a/docs/dln-the-debridge-liquidity-network-protocol/protocol-specs/hook-data/anatomy-of-a-hook-for-solana.md b/docs/dln-the-debridge-liquidity-network-protocol/protocol-specs/hook-data/anatomy-of-a-hook-for-solana.md index c2b42a2e..3950114e 100644 --- a/docs/dln-the-debridge-liquidity-network-protocol/protocol-specs/hook-data/anatomy-of-a-hook-for-solana.md +++ b/docs/dln-the-debridge-liquidity-network-protocol/protocol-specs/hook-data/anatomy-of-a-hook-for-solana.md @@ -2,4 +2,4 @@ The hook raw data intended for Solana is represented as a versioned transaction with one or more instructions. Thus, only **non-atomic** **success-required hooks** are supported. -To craft a proper versioned transaction, use the guide: [creating-hook-data-for-solana.md](../../interacting-with-the-api/integrating-dln-hooks/creating-hook-data-for-solana.md "mention") +To craft a proper versioned transaction, use the guide: [creating-hook-data-for-solana.md](../../interacting-with-the-api/integrating-debridge-hooks/creating-hook-data-for-solana.md "mention")