Theory

The Borsa Protocol Registry connects protocols to users across the DeFi ecosystem through a decentralized solver network. By joining, your protocol becomes part of an intent-based system, where solvers handle the complexity of multi-chain, multi-step transactions. This guide explains how Borsa structures these interactions, making it easy for users to reach their goals.

Core Concepts

Weighted Directed Graph

In the Borsa network, interactions are modeled as a weighted directed graph, a structure used to map connections and optimize paths. Here’s how it works:

  • Node: In graph theory, a node is a distinct point representing an entity or state. On the blockchain, nodes represent states or balances, such as a wallet balance, staking position, or an asset in a DeFi protocol. For example, ETH on AAVE and DAI on AAVE are separate nodes because they represent different states.

  • Edge: An edge connects two nodes, enabling movement or flow between them. In Borsa, edges represent a set of transactions required to transition assets between states. For example, the set of transactions required to navigate from ETH on AAVE to ETH on user's wallet, in this case the withdrawal transaction.

  • Weight: In a graph, the weight of an edge represents the cost or effort required to move between nodes. On the blockchain, this translates to factors like gas & fees, transaction time, or other costs associated with asset movement. Solvers use these weights to calculate the most efficient paths, balancing cost and speed to fulfill user intents.

  • Intent: An intent defines the user’s goal as a start state and an end state within the graph. The user specifies what they want to achieve, and solvers determine and execute the steps required to fulfill it. For example, a user starts with DAI on Polygon (start state) and wants staked ETH on Ethereum (end state). The solver handles all necessary actions, such as swapping DAI for ETH, bridging ETH to Ethereum, and staking it.

  • Path: A path is a sequence of nodes and edges that creates a route through the graph. On the blockchain, paths fulfill user intents by moving assets from a start state to an end state while optimizing for cost and efficiency. For example, ETH on AAVE (as a start state) through withdrawal swap and supply to DAI on AAVE (as an end state).

Integrating with the Graph

In a graph, a node becomes accessible when an edge connects it to the network. This edge creates a pathway, allowing movement to and from the node. Even a single connection integrates the node into the graph, making it reachable from any other point.

For example, suppose your protocol provides a yield farming service for USDC. You define a node representing the balance of USDC deposited in your protocol. Next, you add an edge that specifies how users can transition assets to this node. With this connection, solvers can route user intents through your protocol, enabling users from any starting token, chain, or protocol to access your yield farming service.

Last updated