PageSourceSearch

https://aerodrome.finance/assets/quote.worker-D8HiYhVu.js

js aerodrome.finance collected 2026-09-24 19:56:06 UTC 1,179 bytes, 1 lines download raw bytes

1import{m as p,d as l,b as d,f as h,a as g,c as I,Q as O}from"./contracts-Dr-IyFfW.js";import{t as T}from"./wagmi-VxofBtPD.js";import{a as k}from"./lib-BhZTukS-.js";import"./execution-worker-jdv4iEIy.js";import"./regex-q-TrG3TR.js";import"./isAddressEqual-BeXOg0JF.js";function m(n){const{fromToken:t,toToken:e,amount:r,amountOut:s}=n,o=p(r,l(t.price,e.price),t.decimals),u=d(h(s,e.decimals));return g(o,o-u,18)}const E=100n*10n**18n;function Q(n){if(!n.toToken.listed||!n.fromToken.listed)return!1;const t=m(n);return(t<0n?-t:t)>=E}function P(n,t,e,r,s){return Promise.all(s.map(async o=>(await I(o.map(a=>T({chainId:n.id,address:n.superchainConfig.quoter,abi:O,functionName:"quoteExactInput",args:[k(n,a.nodes,"quote"),r]})),{noErrors:!1})).map((a,f)=>{if(!a[0])return[];if(a[1]=="oog")throw new Error("Fetching quotes: read limit reached");const c=[],[i]=a[0];return i!==0n&&c.push({path:o[f],amount:r,amountOut:i,fromToken:t,toToken:e,priceImpact:0n}),c}).flat())).then(o=>o.flat())}function C(n){const t=n.flat().reduce((e,r)=>e&&(e.amountOut>r.amountOut||Q(r))?e:r,null);return t?{...t,priceImpact:m(t)}:null}export{m as calcPriceImpact,P as fetchQuotes,C as getBestQuote};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.