Quote a deposit's route

GET/uda/quote

A browser reads it with the environment's publishable key alone (the gateway, preview).

Quote moving amount of one chain's asset to another chain's asset, as a deposit address would settle it: what arrives, the fees the route takes, who carries it and how long it takes. It is indicative: nothing is reserved, and it holds until expires_at at most.

Like the network catalogue, it states no scope: a route belongs to the chains rather than to an environment. A chain is named by its numeric identifier or its EIP-155 chain id, and an asset by its contract, the zero address naming the chain's own coin.

  • What it refuses.

    A missing parameter answers 422 parameter_missing and a malformed one 422 parameter_invalid, each naming it. A chain or asset the catalogue does not carry, an address not valid on its chain, an amount that is not positive or does not cover the network's reserve, and an asset whose routing is off answer 422 parameter_invalid naming the parameter. When no provider can quote the route right now, it answers 503 quote_unavailable.

Query parameters

  • from_network_idintegerrequired

    The source chain, by its numeric identifier or EIP-155 chain id.

  • from_assetstringrequired

    The source asset's contract; the zero address for the chain's own coin.

  • to_network_idintegerrequired

    The destination chain, by its numeric identifier or EIP-155 chain id.

  • to_assetstringrequired

    The destination asset's contract; the zero address for the chain's own coin.

  • amountstringrequired

    The source amount, in the source asset's base units. An amount of more than 78 digits is more than any asset can hold and answers 422 parameter_invalid naming amount.

  • from_addressstringoptional

    The address the money would leave; some routes quote only with it.

  • to_addressstringoptional

    The address the money would reach; from_address when absent.

Responses

The quote.

  • One end of a quoted route.

    • network_idinteger <int32>required

      The chain, by its numeric identifier, as the request named it.

    • asset_addressstringrequired

      The asset's contract, as the request named it.

    • An amount of one asset, exact. amount is the integer count of the asset's smallest unit, as a string because an 18-decimal base-unit count does not fit a JSON number; amount_decimal is the same amount for people, amount / 10^decimals, also a string.

      Show full description

      They always agree exactly: compare them in decimal arithmetic, never through a float. amount is at most a uint256, the widest on-chain amount. A request that sends a TokenAmount whose members disagree, or whose amount a uint256 cannot hold, answers 422 parameter_invalid naming it.

  • One end of a quoted route.

    • network_idinteger <int32>required

      The chain, by its numeric identifier, as the request named it.

    • asset_addressstringrequired

      The asset's contract, as the request named it.

    • An amount of one asset, exact. amount is the integer count of the asset's smallest unit, as a string because an 18-decimal base-unit count does not fit a JSON number; amount_decimal is the same amount for people, amount / 10^decimals, also a string.

      Show full description

      They always agree exactly: compare them in decimal arithmetic, never through a float. amount is at most a uint256, the widest on-chain amount. A request that sends a TokenAmount whose members disagree, or whose amount a uint256 cannot hold, answers 422 parameter_invalid naming it.

  • Each fee the route takes, in the source asset.

    • kindstringrequired

      third_party (the bridge or swap provider), platform or network_reserve.

    • An amount of one asset, exact. amount is the integer count of the asset's smallest unit, as a string because an 18-decimal base-unit count does not fit a JSON number; amount_decimal is the same amount for people, amount / 10^decimals, also a string.

      Show full description

      They always agree exactly: compare them in decimal arithmetic, never through a float. amount is at most a uint256, the widest on-chain amount. A request that sends a TokenAmount whose members disagree, or whose amount a uint256 cannot hold, answers 422 parameter_invalid naming it.

    • recipientstring | nullrequired

      The address the fee is paid to, or null where the route names none.

  • An amount of one asset, exact. amount is the integer count of the asset's smallest unit, as a string because an 18-decimal base-unit count does not fit a JSON number; amount_decimal is the same amount for people, amount / 10^decimals, also a string.

    Show full description

    They always agree exactly: compare them in decimal arithmetic, never through a float. amount is at most a uint256, the widest on-chain amount. A request that sends a TokenAmount whose members disagree, or whose amount a uint256 cannot hold, answers 422 parameter_invalid naming it.

    • amountstringrequired

      The amount in the asset's base units: digits only, no sign, no exponent and no leading zero ("0" for zero). At most a uint256, the widest on-chain amount.

    • amount_decimalstringrequired

      The exact human amount, amount / 10^decimals: no sign, no exponent, no leading zero before the point other than a lone 0, and no trailing zero after it ("12.5", "0.000001", "3").

    • decimalsinteger <int32>required

      The asset's decimals on its network, which amount_decimal is scaled by.

    • assetstringrequired

      The symbol of the asset the amount is in (USDC), so a fee or a total never mixes units.

  • providerstringrequired

    Who would carry the route.

  • scenariostringrequired

    The kind of route, as the routing engine names it.

  • estimated_time_secondsinteger <int32>required

    How long the route is expected to take, in seconds; 0 where the provider states none.

  • expires_atstring <date-time>required

    When the quote stops holding.

Errors

The error.code values this operation can return. Each one links to its entry in the error catalogue, which explains the cause and the fix.

Request
curl "https://api.stridge.com/v2/uda/quote?from_network_id=0&from_asset=string&to_network_id=0&to_asset=string&amount=string" \
  -H "Authorization: Bearer $STRIDGE_SECRET_KEY"

Set your secret key as STRIDGE_SECRET_KEY (sent as Authorization: Bearer).

Response200
"network_id": 60,
"asset_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"amount": "12500000",
"amount_decimal": "12.5",
"decimals": 6,
"asset": "USDC"
}
},
"network_id": 60,
"asset_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"amount": "12500000",
"amount_decimal": "12.5",
"decimals": 6,
"asset": "USDC"
}
},
"kind": "platform",
"amount": "12500000",
"amount_decimal": "12.5",
"decimals": 6,
"asset": "USDC"
},
"recipient": "string"
}
],
"amount": "12500000",
"amount_decimal": "12.5",
"decimals": 6,
"asset": "USDC"
},
"provider": "relay",
"scenario": "cross_chain",
"estimated_time_seconds": 45,
"expires_at": "string"
}