Skip to main content
The Rubic bridge integration lets clients quote and execute cross-chain swaps through a Demos node. The node forwards a BridgeTradePayload to the underlying RubicBridge flow and returns the result over standard RPC.

Surface

The node exposes the bridge over rpcCall({ method: "bridge", params: [...] }). The node-side manageBridges handler (src/libs/network/manageBridge.ts) dispatches two RPC methods:
RPC methodSDK methodPurpose
get_tradeRubicBridge.getTrade(demos, chain, payload)Quote a cross-chain trade
execute_tradeRubicBridge.executeTrade(demos, chain, payload)Submit the trade for real
chain is a string from SupportedChains (e.g. "POLYGON", "ETH"). See the SDK reference for end-to-end usage.

Payload

export interface BridgeTradePayload {
    fromToken: "NATIVE" | "USDC" | "USDT"
    toToken:   "NATIVE" | "USDC" | "USDT"
    amount: number | string
    fromChainId: number
    toChainId: number
}
amount and the chain IDs refer to the foreign chain pair (e.g. USDT on Polygon → USDT on Ethereum). "NATIVE" is the foreign chain’s native token (ETH on EVM, MATIC on Polygon, etc.) — not Demos DEM. No OS conversion is applied. P4 widens amount to number | string so callers can pass BigInt-safe wire values for large foreign-chain amounts; the underlying semantics are unchanged.

Native bridge

Demos also ships a native (non-Rubic) bridge for stablecoin transfers across a curated EVM + Solana set. It is exposed via NativeBridgeMethods on @kynesyslabs/demosdk/bridge. Documenting that surface end-to-end is out of scope for this page — see the SDK barrel export for the available methods (validateChain, the supported-chain constants, USDC contract addresses per chain, etc.).