UNPKG

@bancor/carbon-sdk

Version:

The SDK is a READ-ONLY tool, intended to facilitate working with Carbon contracts. It's a convenient wrapper around our matching algorithm, allowing programs and users get a ready to use transaction data that will allow them to manage strategies and fulfi

2 lines (1 loc) 205 B
const t=(t,u)=>{const o=t.output*u.input,p=u.output*t.input,n=o<p,r=o>p,c=!n&&!r;return+(n||c&&t.output<u.output)-+(r||c&&t.output>u.output)},u=(u,o)=>t(o,u);export{u as sortByMaxRate,t as sortByMinRate};