Skip to main content

Intent Solver Architecture

Hero Image

To better facilitate cross chain trading, Blackwing uses an intent-solver architecture for order fulfillment. Intent-solver architectures abstracts away the execution details from the desired result a user wants - enabling better UX and greater flexibility in implementation.

For example, say a user wants to take a 5x leveraged long position on SOL with 100 USDC as collateral and a max price of 90 USDC. Ultimately, the user doesn't care how this intent is fulfilled, they just want to open that position. Dealing with the minutiae of bridging assets to the correct chain, finding the best venue with the best price, and thinking about how MEV might impact the trade is too much cognitive load.

Furthermore, a protocol attempting to provide this trading experience is often limited on changing implementation details.

With Blackwing's intent-solver architecture, the user can simply submit their intent to the Blackwing network and the network will find the best way to fulfill the intent.

warning

Exact API details described below are subject to change before mainnet launch.

Intents

Intents are representations of what action a user wants to take. On Blackwing, an intent corresponds to position modifications and is represented on chain using Abstract Transaction Objects (ATOs). A signed ATO is submitted to the Blackwing chain when a user wants to execute a trade.

The schema for an ATO is roughly as follows:

type ATO = {
message: PositionoOpen | PositionReduce | PositionLiquidation | ...,
signature: []byte,
}

type PositionoOpen = {
type: "position_open",
mode: "limitless_pool" | "classic",
block: uint,
instrument_asset: Asset,
quote_asset: Asset,
collateral_amount: uint,
collateral_asset: Asset,
leverage: uint,
limit_price: uint,
fee_amount: uint,
fee_asset: Asset,
side: "buy" | "sell",
...
}

type PositionReduce = {
type: "position_reduce",
mode: "limitless_pool" | "classic",
block: uint,
instrument_asset: Asset,
quote_asset: Asset,
collateral_amount: uint,
collateral_asset: Asset,
leverage: uint,
limit_price: uint,
fee_amount: uint,
fee_asset: Asset,
side: "buy" | "sell",
...
}

type Asset = {
chain_id: string,
address: address,
}

Solvers

Solvers can subscribe to a feed of ATOs along with necessary information to execute the ATO (user target chain addresses, target chain contract addresses, etc). The bidding period for each ATO lasts 3 blocks on the Blackwing chain - after the bidding period ends, the solver which submitted the bid with the best price will be selected to execute the trade.

To submit a bid, a solver must provide max(1% of trade collateral, 5 USDC) in Blackwing tokens as a guarantee - their Vow. The Vow is returned upon successful delivery of the intent. If the solver fails to deliver the intent, the Vow is burned.

After a bid is won, the solver submits proof of execution to the Blackwing chain within 25 blocks of winning the bid. This is done by submitting a transaction hash from the target chain. Blackwing validator nodes run light clients for each supported chain and can verify that the transaction hash is a valid proof.

Once delivery has been verified, the collateral and output of the trade is returned to the solver, along with any fees accrued.

To better understand how solver's work, it's helpful to look at the inputs/outputs of trades from the perspective of a trader and a solver:

ModeSideOpen/ReduceInputsOutputs
Limitless PoolLongOpenCollateralDomain
Limitless PoolLongReduceDomainCollateral + PnL
Limitless PoolShortOpenCollateralDomain
Limitless PoolShortReduceDomainCollateral + PnL
ClassicLongOpenCollateral + MarginPosition
ClassicLongReducePositionCollateral + Margin + PnL
ClassicShortOpenCollateral + MarginPosition
ClassicShortReducePositionCollateral + Margin + PnL

For Limitless Pool Mode, existing Blackwing deployed pools are used as sources of margin liquidity. So when opening a position, solvers just need to provide collateral on the destination chain which is returned on the Blackwing chain when delivery is verified.

When reducing a position, the solver must provide the Domain that was created when the position was opened. This is done via a specific contract call on the destination chain which takes in as input the original ATO for the intent and verifies the signature. Once the Domain has been closed, the collateral and pnl is locked. The solver, along with their proof of delivery, must provide the collateral and pnl to be returned to the user on the Blackwing chain receiving fees and their Vow. The collateral and pnl on the destination chain is unlocked when verification of the delivery is submitted to the destination chain via the Blackwing DVN.

Classic Mode trades work similarly to Limitless Pool trades but are also required to provide the margin needed to facilitate the trade (solvers compensated with additional fees).

Whirlwind - Blackwing's Solver

In the long term, we envision a network of solvers that participate in Blackwing markets, resulting in better price competition and faster executions.

To start, Blackwing has implemented Whirlwind - the first solver for this network. Whirlwind incorporates a just-in-time liquidity model underpinned by Circle CCTP, Axelar, and LayerZero to manage deployed liquidity across all supported chains.