QuoteValue
Defined in: protocol-swap2-router/src/value.ts:61
A quote’s value in USD: what the user pays, what arrives, the loss, and a better alternative when one exists. Use it to warn before a bad-value swap.
Properties
Section titled “Properties”betterAlternative?
Section titled “betterAlternative?”
optionalbetterAlternative?:object
Defined in: protocol-swap2-router/src/value.ts:71
Another provider in the same set that delivers more than betterByPct more. Every quote of a request pays out the
same destination token, so the comparison is by delivered USD when priced and by raw destAmount otherwise.
byPct:
number
destAmount
Section titled “destAmount”destAmount:
string
provider
Section titled “provider”provider:
string
valueUsdOut
Section titled “valueUsdOut”valueUsdOut:
number|null
lossPct
Section titled “lossPct”lossPct:
number|null
Defined in: protocol-swap2-router/src/value.ts:68
(in − out) / in × 100. Positive = the user receives less value than they pay. null when either side is unpriced.
priceImpactBps?
Section titled “priceImpactBps?”
optionalpriceImpactBps?:number
Defined in: protocol-swap2-router/src/value.ts:73
The venue’s own price impact in basis points (providerData.priceImpactBps), when it measures one.
provider
Section titled “provider”provider:
string
Defined in: protocol-swap2-router/src/value.ts:62
valueUsdIn
Section titled “valueUsdIn”valueUsdIn:
number|null
Defined in: protocol-swap2-router/src/value.ts:64
USD the user pays: the source amount at the current price. null when unpriced.
valueUsdOut
Section titled “valueUsdOut”valueUsdOut:
number|null
Defined in: protocol-swap2-router/src/value.ts:66
USD the quote delivers: the expected destAmount at the current price, minus a native fee paid on top. null when unpriced.