This page covers Smart Relay — Skip Go API’s universal cross-chain data & token delivery service
This document introduces Skip Go API’s Smart Relay functionality — the fastest & most reliable way to get your users where they’re going over any bridge supported by Skip Go. Smart Relay is an alternative to public bridge relayers. It’s designed to enable users to access more swap and transfer routes in fewer transactions with greater speed and reliability.
We strongly advise all integrators who want to offer top-notch user experiences to activate Smart Relay.
If you do not use Smart Relay, your performance will suffer:
You turn it on simply by setting smart_relay=true
in /msgs_direct
or /route
.
This document covers:
What is relaying?
In general, relaying refers to the act of executing a cross-chain message/action by constructing the cross-chain proofs and submitting the burn/mint/wrap/ack proof transactions to the destination & source chains that are required to deliver the message.
All bridges and general message passing protocols (IBC, Axelar, Wormhole, CCTP, etc…) have some notion of relaying but sometimes it goes by different names.
Smart Relay is a intent-aware, user-centric, universal relayer with better performance guarantees than public relayers for all bridges and routes we support. We offer it at a small cost to the end-user and no cost to the developer/integrator. In short, Smart Relay helps users get to more destinations, in fewer transactions, and at faster speeds than via public relayers — no matter how many bridges or chains stand between them and their destination.
Smart Relay is huge improvement over existing relaying systems, made possible by intelligent integration with Skip Go’s routing capabilities.:
The cost of Smart Relay is determined dynamically based on the factors covered below. The gas prices and bridge fees involved in a route are the principal determinants of that cost.
Today, Smart Relay supports:
We are currently building out support for:
For the bridges that Smart Relay does not support today, Skip Go uses public or enshrined relayers — at whatever cost they’re typically made available to users. (These are free for IBC and have some fee associated with them for others). All costs users will incur will always be made transparent in the relevant endpoint responses.
/route
or /msgs_direct
, pass smart_relay=true
/msgs
, ensure that you are passing the smart_relay_fee_quote
object provided in the cctp_transfer
operation from the /route
response into your /msgs
request.
/route
response operations before passing them back into msgs
, simply ensure you’re decoding this new field properly and passing it back through!/track
or /submit
as normal
/submit
to submit Smart Relay transactions on chain to avoid issues incurred by submitting a transaction on chain but not sending it to the /track
endpoint.That’s it! Smart Relay will take care of executing your cross-chain actions across all bridges it currently supports.
In the response to /route
, /msgs_direct
and /msgs
, the cost of Smart Relay will appear in the estimated_fees
array with fee_type
set to SMART_RELAY
. See Getting Fee Info for more info about estimated_fees
For multi-tx routes, the user may pay up to 1 Smart Relay fee per transaction.
The fee for each transaction pays for all Smart Relay operations in that particular transaction. This prevents Smart Relay from accepting payment prematurely to perform operations for the latter transactions, since the latter transactions may not get signed or executed.
You can use the tx_index
attribute on the estimated_fees
entries to identify which Smart Relay fee corresponds to which transaction in the route. (e.g. tx_index=0
indicates this is the fee for the first transaction in the route)
Smart Relay incurs a user cost because Smart Relay involves actually submitting transactions to various chains and incurring transaction fees as a result.
Skip Go dynamically calculates the Smart Relay fee to be paid based on the underlying costs in real-time.
Although you should use the information in the estimated_fees
array for display purposes, cctp_transfer
includes a smart_relay_fee_quote
, providing necessary information for proper use of the dynamic relaying fee system. Specifically, the smart_relay_fee_quote
object contains information about the smart relay fee to be paid and when the quote expires (after which the quoted amount may no longer be valid and the transaction may not be succesfully relayed).
If you’re using the /msgs
endpoint, ensure that you are passing the smart_relay_fee_quote
object provided in the cctp_transfer
operation from the /route
response into your /msgs
request. This is necessary to ensure the transaction generated by the API matches the fee quoted in the /route
request. If the quote is not passed back into the /msgs
request, a new quote will be generated in the /msgs
call that may be different than what was quoted previously in the /route
request. Version 0.8.0
and above of the @skip-go/client
library supports this automatically. If you’re integrating the API directly and decoding the /route
response operations before passing them back into /msgs
, simply ensure you’re decoding this new field properly and passing it back through! See the SmartRelayFeeQuote
below: