Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ekubo/sdk

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ekubo/sdk - npm Package Compare versions

Comparing version 0.0.1 to 0.0.3

README.md

10

dist/index.d.ts

@@ -0,1 +1,4 @@

declare const MAX_U256 = 115792089237316195423570985008687907853269984665640564039457584007913129639935n;
declare const MAX_U128 = 340282366920938463463374607431768211455n;
declare function amount0Delta(sqrtRatioA: bigint, sqrtRatioB: bigint, liquidity: bigint, roundUp: boolean): bigint;

@@ -24,2 +27,7 @@ declare function amount1Delta(sqrtRatioA: bigint, sqrtRatioB: bigint, liquidity: bigint, roundUp: boolean): bigint;

declare const MIN_TICK = -88722883;
declare const MAX_TICK = 88722883;
declare const MAX_SQRT_RATIO: bigint;
declare const MIN_SQRT_RATIO: bigint;
declare const MAX_TICK_SPACING = 354892;
declare function toSqrtRatio(tick: number): bigint;

@@ -158,2 +166,2 @@

export { BasePool, type BasePoolResources, type BasePoolState, type Block, type NodeKey, type Quote, type QuoteMeta, type QuoteNode, type QuoteParams, type Tick, type TokenAmount, TwammPool, type TwammPoolState, type TwammResources, type TwammSaleRateDelta, amount0Delta, amount1Delta, calculateNextSqrtRatio, computeStep, msb, nextSqrtRatioFromAmount0, nextSqrtRatioFromAmount1, toSqrtRatio };
export { BasePool, type BasePoolResources, type BasePoolState, type Block, MAX_SQRT_RATIO, MAX_TICK, MAX_TICK_SPACING, MAX_U128, MAX_U256, MIN_SQRT_RATIO, MIN_TICK, type NodeKey, type Quote, type QuoteMeta, type QuoteNode, type QuoteParams, type Tick, type TokenAmount, TwammPool, type TwammPoolState, type TwammResources, type TwammSaleRateDelta, amount0Delta, amount1Delta, calculateNextSqrtRatio, computeStep, msb, nextSqrtRatioFromAmount0, nextSqrtRatioFromAmount1, toSqrtRatio };

2

dist/index.js

@@ -1,1 +0,1 @@

var W=Object.defineProperty;var e0=Object.getOwnPropertyDescriptor;var t0=Object.getOwnPropertyNames;var i0=Object.prototype.hasOwnProperty;var o0=(n,f)=>{for(var e in f)W(n,e,{get:f[e],enumerable:!0})},r0=(n,f,e,t)=>{if(f&&typeof f=="object"||typeof f=="function")for(let i of t0(f))!i0.call(n,i)&&i!==e&&W(n,i,{get:()=>f[i],enumerable:!(t=e0(f,i))||t.enumerable});return n};var a0=n=>r0(W({},"__esModule",{value:!0}),n);var h0={};o0(h0,{BasePool:()=>P,TwammPool:()=>B,amount0Delta:()=>A,amount1Delta:()=>R,calculateNextSqrtRatio:()=>U,computeStep:()=>C,msb:()=>V,nextSqrtRatioFromAmount0:()=>M,nextSqrtRatioFromAmount1:()=>y,toSqrtRatio:()=>v});module.exports=a0(h0);var x=0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn,E=0xffffffffffffffffffffffffffffffffn;function A(n,f,e,t){if(e===0n||n===f)return 0n;let[i,a]=n<f?[n,f]:[f,n],o=(e<<128n)*(a-i),s=o/a;if(t&&o%a!==0n&&s++,s>x)throw new Error("AMOUNT0_DELTA_OVERFLOW_U256");let r=s/i;if(t&&r%i!==0n&&r++,r>E)throw new Error("AMOUNT0_DELTA_OVERFLOW_U128");return r}var q=0x100000000000000000000000000000000n;function R(n,f,e,t){if(e===0n||n===f)return 0n;let[i,a]=n<f?[n,f]:[f,n],o=e*(a-i);if(o>x)throw new Error("AMOUNT1_DELTA_OVERFLOW_U256");if(t&&o%q!==0n){let s=o/q+1n;if(s>E)throw new Error("AMOUNT1_DELTA_OVERFLOW_U128");return s}else return o>>128n}var s0=1n<<128n;function V(n){if(n>=s0)throw new Error("x too large");if(n<=0n)throw new Error("x must be positive");let f=0;return n>=0x10000000000000000n&&(n=n>>64n,f+=64),n>=0x100000000n&&(n=n>>32n,f+=32),n>=0x10000n&&(n=n>>16n,f+=16),n>=0x100n&&(n=n>>8n,f+=8),n>=0x10n&&(n=n>>4n,f+=4),n>=0x04n&&(n=n>>2n,f+=2),n>=0x02n&&(f+=1),f}function M(n,f,e){if(e===0n)return n;if(f===0n)throw new Error("NO_LIQUIDITY");let t=f<<128n;if(e<0n){let i=e*-1n*n;if(i>=x)return null;let a=t-i;if(a<0n)return null;let o=t*n,s=o/a+(o%a===0n?0n:1n);return s>x?null:s}else{let a=t/n+e,o=t/a;if(t%a===0n)return o;let r=o+1n;return r>x?null:r}}function y(n,f,e){if(e===0n)return n;if(f===0n)throw new Error("NO_LIQUIDITY");let t=e<<128n,i=t/f,a=t%f;if(e<0n){let o=n+i;return o<0n?null:a===0n?o:o!=0n?o-1n:null}else{let o=n+i;return o>x?null:o}}function Y(n,f){return n<0n!==f}function $(n){return{consumedAmount:0n,calculatedAmount:0n,sqrtRatioNext:n,feeAmount:0n}}function G(n,f){if(f===0n)return n;let e=n<<128n,t=(1n<<128n)-f,a=e/t+(e%t!==0n?1n:0n);if(a>E)throw new Error("AMOUNT_BEFORE_FEE_OVERFLOW");return a}function c0(n,f){let e=n*f,t=2n**128n;return e%t!==0n?e/t+1n:e/t}function C({sqrtRatio:n,liquidity:f,sqrtRatioLimit:e,amount:t,isToken1:i,fee:a}){if(t===0n||n===e)return $(n);let o=Y(t,i);if(e<n===o)throw new Error("computeStep: wrong direction");if(f===0n)return $(e);let s;t<0n?s=t:s=t-c0(t,a);let r;if(i?r=y(n,f,s):r=M(n,f,s),r===null||r>e===o){let[l,u]=i?[R(e,n,f,t>=0n)*(t<0n?-1n:1n),A(e,n,f,t<0n)]:[A(e,n,f,t>=0n)*(t<0n?-1n:1n),R(e,n,f,t<0n)];if(t<0n){let b=G(u,a);return{consumedAmount:l,calculatedAmount:b,feeAmount:b-u,sqrtRatioNext:e}}else{let b=G(l,a);return{consumedAmount:b,calculatedAmount:u,feeAmount:b-l,sqrtRatioNext:e}}}if(r===n)return{consumedAmount:t,calculatedAmount:0n,feeAmount:t,sqrtRatioNext:n};let c=i?A(r,n,f,t<0n):R(r,n,f,t<0n);if(t<0n){let l=G(c,a);return{consumedAmount:t,calculatedAmount:l,sqrtRatioNext:r,feeAmount:l-c}}else return{consumedAmount:t,calculatedAmount:c,sqrtRatioNext:r,feeAmount:t-s}}var l0=-88722883,u0=88722883,I=6277100250585753475930931601400621808602321654880405518632n,O=18446748437148339061n,j=354892;function v(n){if(n<l0||n>u0)throw new Error(`Invalid tick: ${n}`);let f=n<0;n=Math.abs(n);let e=0x100000000000000000000000000000000n;return n&1&&(e=0xfffff79c8499329c7cbb2510d893283bn),n&2&&(e=e*0xffffef390978c398134b4ff3764fe410n>>128n),n&4&&(e=e*0xffffde72140b00a354bd3dc828e976c9n>>128n),n&8&&(e=e*0xffffbce42c7be6c998ad6318193c0b18n>>128n),n&16&&(e=e*0xffff79c86a8f6150a32d9778eceef97cn>>128n),n&32&&(e=e*0xfffef3911b7cff24ba1b3dbb5f8f5974n>>128n),n&64&&(e=e*0xfffde72350725cc4ea8feece3b5f13c8n>>128n),n&128&&(e=e*0xfffbce4b06c196e9247ac87695d53c60n>>128n),n&256&&(e=e*0xfff79ca7a4d1bf1ee8556cea23cdbaa5n>>128n),n&512&&(e=e*0xffef3995a5b6a6267530f207142a5764n>>128n),n&1024&&(e=e*0xffde7444b28145508125d10077ba83b8n>>128n),n&2048&&(e=e*0xffbceceeb791747f10df216f2e53ec57n>>128n),n&4096&&(e=e*0xff79eb706b9a64c6431d76e63531e929n>>128n),n&8192&&(e=e*0xfef41d1a5f2ae3a20676bec6f7f9459an>>128n),n&16384&&(e=e*0xfde95287d26d81bea159c37073122c73n>>128n),n&32768&&(e=e*0xfbd701c7cbc4c8a6bb81efd232d1e4e7n>>128n),n&65536&&(e=e*0xf7bf5211c72f5185f372aeb1d48f937en>>128n),n&131072&&(e=e*0xefc2bf59df33ecc28125cf78ec4f167fn>>128n),n&262144&&(e=e*0xe08d35706200796273f0b3a981d90cfdn>>128n),n&524288&&(e=e*0xc4f76b68947482dc198a48a54348c4edn>>128n),n&1048576&&(e=e*0x978bcb9894317807e5fa4498eee7c0fan>>128n),n&2097152&&(e=e*0x59b63684b86e9f486ec54727371ba6can>>128n),n&4194304&&(e=e*0x1f703399d88f6aa83a28b22d4a1f56e3n>>128n),n&8388608&&(e=e*0x3dc5dac7376e20fc8679758d1bcdcfcn>>128n),n&16777216&&(e=e*0xee7e32d61fdb0a5e622b820f681d0n>>128n),n&33554432&&(e=e*0xde2ee4bc381afa7089aa84bb66n>>128n),n&67108864&&(e=e*0xc0d55d4d7152c25fb139n>>128n),n>0&&!f&&(e=x/e),e}var b0=Math.log(1.0000005);function H(n,f,e){let t=Math.log(Number(f)/Number(n))/b0;return Math.floor(Math.abs(t/(e*251)))}var d0=1623313478486440542208n;function U(n,f,e,t,i,a){let o=J((t<<128n)/e)<<64n;if(f===0n)return o;let s=J(t*e)*((1n<<128n)-a)/(1n<<128n),r=n>o,c=Q(0x200000000n*i*s,f,r);if(c>d0)return o;let l=Z(c),[u,b]=r?[n-o,!0]:[o-n,!1],g=Q(u<<128n,o+n,r),[m,d]=[l-g,l+g],w=b?Q(d<<128n,m,r):Q(m<<128n,d,r);return o*w>>128n}function Q(n,f,e){let t=n/f,i=n%f;return t+(i!==0n&&e?1n:0n)}function Z(n){if(n>=36893488147419103e3){let f=Z(n/2n);return f*f>>128n}else return m0(n)}function m0(n){if(n>=0x20000000000000000n)throw new Error("Invalid input");let f=0x100000000000000000000000000000000n;return(n&0x1n)!=0n&&(f=0xffffffffffffffff0000000000000000n),(n&0x2n)!=0n&&(f=f*0xfffffffffffffffe0000000000000002n>>128n),(n&0x4n)!=0n&&(f=f*0xfffffffffffffffc0000000000000008n>>128n),(n&0x8n)!=0n&&(f=f*0xfffffffffffffff80000000000000020n>>128n),(n&0x10n)!=0n&&(f=f*0xfffffffffffffff00000000000000080n>>128n),(n&0x20n)!=0n&&(f=f*0xffffffffffffffe00000000000000200n>>128n),(n&0x40n)!=0n&&(f=f*0xffffffffffffffc00000000000000800n>>128n),(n&0x80n)!=0n&&(f=f*0xffffffffffffff800000000000002000n>>128n),(n&0x100n)!=0n&&(f=f*0xffffffffffffff000000000000008000n>>128n),(n&0x200n)!=0n&&(f=f*0xfffffffffffffe000000000000020000n>>128n),(n&0x400n)!=0n&&(f=f*0xfffffffffffffc000000000000080000n>>128n),(n&0x800n)!=0n&&(f=f*0xfffffffffffff8000000000000200000n>>128n),(n&0x1000n)!=0n&&(f=f*0xfffffffffffff0000000000000800000n>>128n),(n&0x2000n)!=0n&&(f=f*0xffffffffffffe0000000000002000000n>>128n),(n&0x4000n)!=0n&&(f=f*0xffffffffffffc0000000000008000000n>>128n),(n&0x8000n)!=0n&&(f=f*0xffffffffffff80000000000020000000n>>128n),(n&0x10000n)!=0n&&(f=f*0xffffffffffff00000000000080000000n>>128n),(n&0x20000n)!=0n&&(f=f*0xfffffffffffe00000000000200000000n>>128n),(n&0x40000n)!=0n&&(f=f*0xfffffffffffc00000000000800000000n>>128n),(n&0x80000n)!=0n&&(f=f*0xfffffffffff800000000002000000000n>>128n),(n&0x100000n)!=0n&&(f=f*0xfffffffffff000000000008000000000n>>128n),(n&0x200000n)!=0n&&(f=f*0xffffffffffe000000000020000000000n>>128n),(n&0x400000n)!=0n&&(f=f*0xffffffffffc00000000007ffffffffffn>>128n),(n&0x800000n)!=0n&&(f=f*0xffffffffff80000000001ffffffffffbn>>128n),(n&0x1000000n)!=0n&&(f=f*0xffffffffff00000000007fffffffffd5n>>128n),(n&0x2000000n)!=0n&&(f=f*0xfffffffffe0000000001fffffffffeabn>>128n),(n&0x4000000n)!=0n&&(f=f*0xfffffffffc0000000007fffffffff555n>>128n),(n&0x8000000n)!=0n&&(f=f*0xfffffffff8000000001fffffffffaaabn>>128n),(n&0x10000000n)!=0n&&(f=f*0xfffffffff0000000007ffffffffd5555n>>128n),(n&0x20000000n)!=0n&&(f=f*0xffffffffe000000001ffffffffeaaaabn>>128n),(n&0x40000000n)!=0n&&(f=f*0xffffffffc000000007ffffffff555555n>>128n),(n&0x80000000n)!=0n&&(f=f*0xffffffff800000001ffffffffaaaaaabn>>128n),(n&0x100000000n)!=0n&&(f=f*0xffffffff000000007fffffffd5555555n>>128n),(n&0x200000000n)!=0n&&(f=f*0xfffffffe00000001fffffffeaaaaaaabn>>128n),(n&0x400000000n)!=0n&&(f=f*0xfffffffc00000007fffffff555555560n>>128n),(n&0x800000000n)!=0n&&(f=f*0xfffffff80000001fffffffaaaaaaab55n>>128n),(n&0x1000000000n)!=0n&&(f=f*0xfffffff00000007ffffffd5555556000n>>128n),(n&0x2000000000n)!=0n&&(f=f*0xffffffe0000001ffffffeaaaaaab5555n>>128n),(n&0x4000000000n)!=0n&&(f=f*0xffffffc0000007ffffff555555600000n>>128n),(n&0x8000000000n)!=0n&&(f=f*0xffffff8000001ffffffaaaaaab555555n>>128n),(n&0x10000000000n)!=0n&&(f=f*0xffffff0000007fffffd555555ffffffen>>128n),(n&0x20000000000n)!=0n&&(f=f*0xfffffe000001fffffeaaaaab55555511n>>128n),(n&0x40000000000n)!=0n&&(f=f*0xfffffc000007fffff555555ffffff777n>>128n),(n&0x80000000000n)!=0n&&(f=f*0xfffff800001fffffaaaaab5555544444n>>128n),(n&0x100000000000n)!=0n&&(f=f*0xfffff000007ffffd55555fffffddddden>>128n),(n&0x200000000000n)!=0n&&(f=f*0xffffe00001ffffeaaaab555551111128n>>128n),(n&0x400000000000n)!=0n&&(f=f*0xffffc00007ffff55555fffff77777d28n>>128n),(n&0x800000000000n)!=0n&&(f=f*0xffff80001ffffaaaab5555444445b05bn>>128n),(n&0x1000000000000n)!=0n&&(f=f*0xffff00007fffd5555ffffdddde38e381n>>128n),(n&0x2000000000000n)!=0n&&(f=f*0xfffe0001fffeaaab5555111127d276a7n>>128n),(n&0x4000000000000n)!=0n&&(f=f*0xfffc0007fff5555ffff7777d27cf3cf5n>>128n),(n&0x8000000000000n)!=0n&&(f=f*0xfff8001fffaaab55544445b0596597f9n>>128n),(n&0x10000000000000n)!=0n&&(f=f*0xfff0007ffd555fffddde38e2be2d82d5n>>128n),(n&0x20000000000000n)!=0n&&(f=f*0xffe001ffeaab55511127d21522f2295cn>>128n),(n&0x40000000000000n)!=0n&&(f=f*0xffc007ff555fff777d279e7b87acece0n>>128n),(n&0x80000000000000n)!=0n&&(f=f*0xff801ffaab554445b04105b043e8f48dn>>128n),(n&0x100000000000000n)!=0n&&(f=f*0xff007fd55ffdde38d68f08c257e0ce3fn>>128n),(n&0x200000000000000n)!=0n&&(f=f*0xfe01feab551127cbfe5f89994c44216fn>>128n),(n&0x400000000000000n)!=0n&&(f=f*0xfc07f55ff77d2493e885eeaa756ad523n>>128n),(n&0x800000000000000n)!=0n&&(f=f*0xf81fab5445aebc8a58055fcbbb139ae9n>>128n),(n&0x1000000000000000n)!=0n&&(f=f*0xf07d5fde38151e72f18ff03049ac5d7fn>>128n),(n&0x2000000000000000n)!=0n&&(f=f*0xe1eb51276c110c3c3eb1269f2f5d4afbn>>128n),(n&0x4000000000000000n)!=0n&&(f=f*0xc75f7cf564105743415cbc9d6368f3b9n>>128n),(n&0x8000000000000000n)!=0n&&(f=f*0x9b4597e37cb04ff3d675a35530cdd768n>>128n),(n&0x10000000000000000n)!=0n&&(f=f*0x5e2d58d8b3bcdf1abadec7829054f90en>>128n),n!=0n&&(f=x/f),f}function J(n){if(n<0n)throw new Error("Square root of negative numbers is not supported.");if(n<2n)return n;let f=n/2n,e=(f+n/f)/2n;for(;f>e;)f=e,e=(f+n/f)/2n;return f}function x0(n,f){let e=0,t=n.length;for(;e<t;){let i=Math.floor((e+t)/2);if(n[i].tick<=f){if(i===n.length-1||n[i+1].tick>f)return i;e=i}else t=i}return-1}var P=class{constructor({token0:f,token1:e,tickSpacing:t,fee:i,sqrtRatio:a,liquidity:o,tick:s,sortedTicks:r}){this.key={token0:f,token1:e,fee:i,tickSpacing:t,extension:0n},this.sortedTicks=r,this.state={sqrtRatio:a,liquidity:o,activeTickIndex:x0(r,s)}}combineResources(f,e){return{initializedTicksCrossed:f.initializedTicksCrossed+e.initializedTicksCrossed,tickSpacingsCrossed:f.tickSpacingsCrossed+e.tickSpacingsCrossed}}initialResources(){return{initializedTicksCrossed:0,tickSpacingsCrossed:0}}quote({tokenAmount:{amount:f,token:e},sqrtRatioLimit:t,overrideState:i}){let a=e===this.key.token1;if(!a&&this.key.token0!==e)throw new Error("Invalid token");let o=i??this.state,s=this.initialResources();if(f===0n)return{isPriceIncreasing:a,consumedAmount:0n,calculatedAmount:0n,executionResources:s,stateAfter:o,feesPaid:0n};let r=Y(f,a),{sqrtRatio:c,liquidity:l,activeTickIndex:u}=o;if(t){if(r&&t<c)throw new Error("sqrtRatioLimit cannot be less than sqrtRatio");if(!r&&t>c)throw new Error("sqrtRatioLimit cannot be greater than sqrtRatio");if(t<O)throw new Error("sqrtRatioLimit lt min");if(t>I)throw new Error("sqrtRatioLimit gt max")}else t=r?I:O;let b=0n,g=0n,m=s.initializedTicksCrossed,d=f,w=c;for(;d!==0n&&c!==t;){let p=(r?this.sortedTicks[u+1]:this.sortedTicks[u])??null,S=p?v(p.tick):null,F=S===null?t:S<t===r?S:t,h=C({fee:this.key.fee,sqrtRatio:c,liquidity:l,isToken1:a,sqrtRatioLimit:F,amount:d});d-=h.consumedAmount,b+=h.calculatedAmount,g+=h.feeAmount,c=h.sqrtRatioNext,p&&c===S&&(u=r?u+1:u-1,m++,l+=r?p.liquidityDelta:-p.liquidityDelta)}return{isPriceIncreasing:r,consumedAmount:f-d,calculatedAmount:b,feesPaid:g,executionResources:{initializedTicksCrossed:m,tickSpacingsCrossed:s.tickSpacingsCrossed+H(w,c,this.key.tickSpacing)},stateAfter:{sqrtRatio:c,liquidity:l,activeTickIndex:u}}}hasLiquidity(){return this.state.liquidity>0n||this.sortedTicks.length>0}};var f0=88368108,g0=22027144413679976675n,p0=5256790760649093508123362461711849782692726119655358142129n,B=class{get key(){return{...this.basePool.key,extension:this.extension}}get sortedTicks(){return this.basePool.sortedTicks}constructor({token0:f,token1:e,fee:t,extension:i,sqrtRatio:a,liquidity:o,tick:s,token0SaleRate:r,token1SaleRate:c,lastExecutionTime:l,saleRateDeltas:u}){this.extension=i,this.basePool=new P({token0:f,token1:e,fee:t,sqrtRatio:a,liquidity:o,tick:s,tickSpacing:j,sortedTicks:[{tick:-f0,liquidityDelta:o},{tick:f0,liquidityDelta:-o}]}),this.token0SaleRate=r,this.token1SaleRate=c,this.lastExecutionTime=l,this.saleRateDeltas=u}initialResources(){return{...this.basePool.initialResources(),virtualOrderSecondsExecuted:0,virtualOrderDeltaTimesCrossed:0}}combineResources(f,e){return{...this.basePool.combineResources(f,e),virtualOrderDeltaTimesCrossed:f.virtualOrderDeltaTimesCrossed+e.virtualOrderDeltaTimesCrossed,virtualOrderSecondsExecuted:f.virtualOrderSecondsExecuted+e.virtualOrderSecondsExecuted}}quote({tokenAmount:f,sqrtRatioLimit:e,overrideState:t,meta:i}){let{block:{time:a}}=i,o=t??this.state,{sqrtRatio:s,token0SaleRate:r,token1SaleRate:c,lastExecutionTime:l}=o,u=a-l;if(u<0)throw new Error("Last execution time exceeds block time");let b=0,g=this.saleRateDeltas.findIndex(T=>T.time>l),m=t,d=this.basePool.initialResources();for(;l!==a;){let T=this.saleRateDeltas[g],X=T?Math.min(T.time,a):a,K=BigInt(X-l),[_,N]=[r*K>>32n,c*K>>32n];if(_>0n&&N>0n){let D=S0(g0,T0(p0,s));s=U(D,this.basePool.sortedTicks[0].liquidityDelta,r,c,K,this.key.fee);let[z,L]=D<s?[this.basePool.key.token1,N]:[this.basePool.key.token0,_],k=this.basePool.quote({tokenAmount:{amount:L,token:z},sqrtRatioLimit:s,meta:i,overrideState:m});m=k.stateAfter,d=this.basePool.combineResources(d,k.executionResources)}else if(_>0n||N>0n){let[D,z,L]=_!==0n?[_,!1,O]:[N,!0,I],k=this.basePool.quote({tokenAmount:{amount:D,token:z?this.basePool.key.token1:this.basePool.key.token0},sqrtRatioLimit:L,meta:i,overrideState:m});m=k.stateAfter,d=this.basePool.combineResources(d,k.executionResources),s=m.sqrtRatio}X===T?.time&&(r+=T.saleRateDelta0,c+=T.saleRateDelta1,g++,b++),l=X}let{consumedAmount:w,calculatedAmount:p,executionResources:S,stateAfter:F,isPriceIncreasing:h,feesPaid:n0}=this.basePool.quote({tokenAmount:f,sqrtRatioLimit:e,meta:i,overrideState:m});return{isPriceIncreasing:h,consumedAmount:w,calculatedAmount:p,feesPaid:n0,executionResources:{...this.basePool.combineResources(d,S),virtualOrderSecondsExecuted:u,virtualOrderDeltaTimesCrossed:b},stateAfter:{...F,token0SaleRate:r,token1SaleRate:c,lastExecutionTime:a}}}hasLiquidity(){return this.basePool.hasLiquidity()}get state(){return{...this.basePool.state,token0SaleRate:this.token0SaleRate,token1SaleRate:this.token1SaleRate,lastExecutionTime:this.lastExecutionTime}}};function T0(n,f){return n>f?f:n}function S0(n,f){return n>f?n:f}0&&(module.exports={BasePool,TwammPool,amount0Delta,amount1Delta,calculateNextSqrtRatio,computeStep,msb,nextSqrtRatioFromAmount0,nextSqrtRatioFromAmount1,toSqrtRatio});
var V=Object.defineProperty;var i0=Object.getOwnPropertyDescriptor;var o0=Object.getOwnPropertyNames;var r0=Object.prototype.hasOwnProperty;var a0=(n,f)=>{for(var e in f)V(n,e,{get:f[e],enumerable:!0})},s0=(n,f,e,t)=>{if(f&&typeof f=="object"||typeof f=="function")for(let i of o0(f))!r0.call(n,i)&&i!==e&&V(n,i,{get:()=>f[i],enumerable:!(t=i0(f,i))||t.enumerable});return n};var c0=n=>s0(V({},"__esModule",{value:!0}),n);var A0={};a0(A0,{BasePool:()=>I,MAX_SQRT_RATIO:()=>A,MAX_TICK:()=>j,MAX_TICK_SPACING:()=>y,MAX_U128:()=>S,MAX_U256:()=>b,MIN_SQRT_RATIO:()=>R,MIN_TICK:()=>$,TwammPool:()=>B,amount0Delta:()=>_,amount1Delta:()=>w,calculateNextSqrtRatio:()=>X,computeStep:()=>Q,msb:()=>G,nextSqrtRatioFromAmount0:()=>D,nextSqrtRatioFromAmount1:()=>C,toSqrtRatio:()=>v});module.exports=c0(A0);var b=0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn,S=0xffffffffffffffffffffffffffffffffn;function _(n,f,e,t){if(e===0n||n===f)return 0n;let[i,a]=n<f?[n,f]:[f,n],o=(e<<128n)*(a-i),s=o/a;if(t&&o%a!==0n&&s++,s>b)throw new Error("AMOUNT0_DELTA_OVERFLOW_U256");let r=s/i;if(t&&r%i!==0n&&r++,r>S)throw new Error("AMOUNT0_DELTA_OVERFLOW_U128");return r}var H=0x100000000000000000000000000000000n;function w(n,f,e,t){if(e===0n||n===f)return 0n;let[i,a]=n<f?[n,f]:[f,n],o=e*(a-i);if(o>b)throw new Error("AMOUNT1_DELTA_OVERFLOW_U256");if(t&&o%H!==0n){let s=o/H+1n;if(s>S)throw new Error("AMOUNT1_DELTA_OVERFLOW_U128");return s}else return o>>128n}var l0=1n<<128n;function G(n){if(n>=l0)throw new Error("x too large");if(n<=0n)throw new Error("x must be positive");let f=0;return n>=0x10000000000000000n&&(n=n>>64n,f+=64),n>=0x100000000n&&(n=n>>32n,f+=32),n>=0x10000n&&(n=n>>16n,f+=16),n>=0x100n&&(n=n>>8n,f+=8),n>=0x10n&&(n=n>>4n,f+=4),n>=0x04n&&(n=n>>2n,f+=2),n>=0x02n&&(f+=1),f}function D(n,f,e){if(e===0n)return n;if(f===0n)throw new Error("NO_LIQUIDITY");let t=f<<128n;if(e<0n){let i=e*-1n*n;if(i>=b)return null;let a=t-i;if(a<0n)return null;let o=t*n,s=o/a+(o%a===0n?0n:1n);return s>b?null:s}else{let a=t/n+e,o=t/a;if(t%a===0n)return o;let r=o+1n;return r>b?null:r}}function C(n,f,e){if(e===0n)return n;if(f===0n)throw new Error("NO_LIQUIDITY");let t=e<<128n,i=t/f,a=t%f;if(e<0n){let o=n+i;return o<0n?null:a===0n?o:o!=0n?o-1n:null}else{let o=n+i;return o>b?null:o}}function q(n,f){return n<0n!==f}function J(n){return{consumedAmount:0n,calculatedAmount:0n,sqrtRatioNext:n,feeAmount:0n}}function Y(n,f){if(f===0n)return n;let e=n<<128n,t=(1n<<128n)-f,a=e/t+(e%t!==0n?1n:0n);if(a>S)throw new Error("AMOUNT_BEFORE_FEE_OVERFLOW");return a}function u0(n,f){let e=n*f,t=2n**128n;return e%t!==0n?e/t+1n:e/t}function Q({sqrtRatio:n,liquidity:f,sqrtRatioLimit:e,amount:t,isToken1:i,fee:a}){if(t===0n||n===e)return J(n);let o=q(t,i);if(e<n===o)throw new Error("computeStep: wrong direction");if(f===0n)return J(e);let s;t<0n?s=t:s=t-u0(t,a);let r;if(i?r=C(n,f,s):r=D(n,f,s),r===null||r>e===o){let[l,u]=i?[w(e,n,f,t>=0n)*(t<0n?-1n:1n),_(e,n,f,t<0n)]:[_(e,n,f,t>=0n)*(t<0n?-1n:1n),w(e,n,f,t<0n)];if(t<0n){let d=Y(u,a);return{consumedAmount:l,calculatedAmount:d,feeAmount:d-u,sqrtRatioNext:e}}else{let d=Y(l,a);return{consumedAmount:d,calculatedAmount:u,feeAmount:d-l,sqrtRatioNext:e}}}if(r===n)return{consumedAmount:t,calculatedAmount:0n,feeAmount:t,sqrtRatioNext:n};let c=i?_(r,n,f,t<0n):w(r,n,f,t<0n);if(t<0n){let l=Y(c,a);return{consumedAmount:t,calculatedAmount:l,sqrtRatioNext:r,feeAmount:l-c}}else return{consumedAmount:t,calculatedAmount:c,sqrtRatioNext:r,feeAmount:t-s}}var $=-88722883,j=88722883,A=6277100250585753475930931601400621808602321654880405518632n,R=18446748437148339061n,y=354892;function v(n){if(n<$||n>j)throw new Error(`Invalid tick: ${n}`);let f=n<0;n=Math.abs(n);let e=0x100000000000000000000000000000000n;return n&1&&(e=0xfffff79c8499329c7cbb2510d893283bn),n&2&&(e=e*0xffffef390978c398134b4ff3764fe410n>>128n),n&4&&(e=e*0xffffde72140b00a354bd3dc828e976c9n>>128n),n&8&&(e=e*0xffffbce42c7be6c998ad6318193c0b18n>>128n),n&16&&(e=e*0xffff79c86a8f6150a32d9778eceef97cn>>128n),n&32&&(e=e*0xfffef3911b7cff24ba1b3dbb5f8f5974n>>128n),n&64&&(e=e*0xfffde72350725cc4ea8feece3b5f13c8n>>128n),n&128&&(e=e*0xfffbce4b06c196e9247ac87695d53c60n>>128n),n&256&&(e=e*0xfff79ca7a4d1bf1ee8556cea23cdbaa5n>>128n),n&512&&(e=e*0xffef3995a5b6a6267530f207142a5764n>>128n),n&1024&&(e=e*0xffde7444b28145508125d10077ba83b8n>>128n),n&2048&&(e=e*0xffbceceeb791747f10df216f2e53ec57n>>128n),n&4096&&(e=e*0xff79eb706b9a64c6431d76e63531e929n>>128n),n&8192&&(e=e*0xfef41d1a5f2ae3a20676bec6f7f9459an>>128n),n&16384&&(e=e*0xfde95287d26d81bea159c37073122c73n>>128n),n&32768&&(e=e*0xfbd701c7cbc4c8a6bb81efd232d1e4e7n>>128n),n&65536&&(e=e*0xf7bf5211c72f5185f372aeb1d48f937en>>128n),n&131072&&(e=e*0xefc2bf59df33ecc28125cf78ec4f167fn>>128n),n&262144&&(e=e*0xe08d35706200796273f0b3a981d90cfdn>>128n),n&524288&&(e=e*0xc4f76b68947482dc198a48a54348c4edn>>128n),n&1048576&&(e=e*0x978bcb9894317807e5fa4498eee7c0fan>>128n),n&2097152&&(e=e*0x59b63684b86e9f486ec54727371ba6can>>128n),n&4194304&&(e=e*0x1f703399d88f6aa83a28b22d4a1f56e3n>>128n),n&8388608&&(e=e*0x3dc5dac7376e20fc8679758d1bcdcfcn>>128n),n&16777216&&(e=e*0xee7e32d61fdb0a5e622b820f681d0n>>128n),n&33554432&&(e=e*0xde2ee4bc381afa7089aa84bb66n>>128n),n&67108864&&(e=e*0xc0d55d4d7152c25fb139n>>128n),n>0&&!f&&(e=b/e),e}var b0=Math.log(1.0000005);function Z(n,f,e){let t=Math.log(Number(f)/Number(n))/b0;return Math.floor(Math.abs(t/(e*251)))}var d0=1623313478486440542208n;function X(n,f,e,t,i,a){let o=f0((t<<128n)/e)<<64n;if(f===0n)return o;let s=f0(t*e)*((1n<<128n)-a)/(1n<<128n),r=n>o,c=U(0x200000000n*i*s,f,r);if(c>d0)return o;let l=n0(c),[u,d]=r?[n-o,!0]:[o-n,!1],g=U(u<<128n,o+n,r),[x,m]=[l-g,l+g],k=d?U(m<<128n,x,r):U(x<<128n,m,r);return o*k>>128n}function U(n,f,e){let t=n/f,i=n%f;return t+(i!==0n&&e?1n:0n)}function n0(n){if(n>=36893488147419103e3){let f=n0(n/2n);return f*f>>128n}else return m0(n)}function m0(n){if(n>=0x20000000000000000n)throw new Error("Invalid input");let f=0x100000000000000000000000000000000n;return(n&0x1n)!=0n&&(f=0xffffffffffffffff0000000000000000n),(n&0x2n)!=0n&&(f=f*0xfffffffffffffffe0000000000000002n>>128n),(n&0x4n)!=0n&&(f=f*0xfffffffffffffffc0000000000000008n>>128n),(n&0x8n)!=0n&&(f=f*0xfffffffffffffff80000000000000020n>>128n),(n&0x10n)!=0n&&(f=f*0xfffffffffffffff00000000000000080n>>128n),(n&0x20n)!=0n&&(f=f*0xffffffffffffffe00000000000000200n>>128n),(n&0x40n)!=0n&&(f=f*0xffffffffffffffc00000000000000800n>>128n),(n&0x80n)!=0n&&(f=f*0xffffffffffffff800000000000002000n>>128n),(n&0x100n)!=0n&&(f=f*0xffffffffffffff000000000000008000n>>128n),(n&0x200n)!=0n&&(f=f*0xfffffffffffffe000000000000020000n>>128n),(n&0x400n)!=0n&&(f=f*0xfffffffffffffc000000000000080000n>>128n),(n&0x800n)!=0n&&(f=f*0xfffffffffffff8000000000000200000n>>128n),(n&0x1000n)!=0n&&(f=f*0xfffffffffffff0000000000000800000n>>128n),(n&0x2000n)!=0n&&(f=f*0xffffffffffffe0000000000002000000n>>128n),(n&0x4000n)!=0n&&(f=f*0xffffffffffffc0000000000008000000n>>128n),(n&0x8000n)!=0n&&(f=f*0xffffffffffff80000000000020000000n>>128n),(n&0x10000n)!=0n&&(f=f*0xffffffffffff00000000000080000000n>>128n),(n&0x20000n)!=0n&&(f=f*0xfffffffffffe00000000000200000000n>>128n),(n&0x40000n)!=0n&&(f=f*0xfffffffffffc00000000000800000000n>>128n),(n&0x80000n)!=0n&&(f=f*0xfffffffffff800000000002000000000n>>128n),(n&0x100000n)!=0n&&(f=f*0xfffffffffff000000000008000000000n>>128n),(n&0x200000n)!=0n&&(f=f*0xffffffffffe000000000020000000000n>>128n),(n&0x400000n)!=0n&&(f=f*0xffffffffffc00000000007ffffffffffn>>128n),(n&0x800000n)!=0n&&(f=f*0xffffffffff80000000001ffffffffffbn>>128n),(n&0x1000000n)!=0n&&(f=f*0xffffffffff00000000007fffffffffd5n>>128n),(n&0x2000000n)!=0n&&(f=f*0xfffffffffe0000000001fffffffffeabn>>128n),(n&0x4000000n)!=0n&&(f=f*0xfffffffffc0000000007fffffffff555n>>128n),(n&0x8000000n)!=0n&&(f=f*0xfffffffff8000000001fffffffffaaabn>>128n),(n&0x10000000n)!=0n&&(f=f*0xfffffffff0000000007ffffffffd5555n>>128n),(n&0x20000000n)!=0n&&(f=f*0xffffffffe000000001ffffffffeaaaabn>>128n),(n&0x40000000n)!=0n&&(f=f*0xffffffffc000000007ffffffff555555n>>128n),(n&0x80000000n)!=0n&&(f=f*0xffffffff800000001ffffffffaaaaaabn>>128n),(n&0x100000000n)!=0n&&(f=f*0xffffffff000000007fffffffd5555555n>>128n),(n&0x200000000n)!=0n&&(f=f*0xfffffffe00000001fffffffeaaaaaaabn>>128n),(n&0x400000000n)!=0n&&(f=f*0xfffffffc00000007fffffff555555560n>>128n),(n&0x800000000n)!=0n&&(f=f*0xfffffff80000001fffffffaaaaaaab55n>>128n),(n&0x1000000000n)!=0n&&(f=f*0xfffffff00000007ffffffd5555556000n>>128n),(n&0x2000000000n)!=0n&&(f=f*0xffffffe0000001ffffffeaaaaaab5555n>>128n),(n&0x4000000000n)!=0n&&(f=f*0xffffffc0000007ffffff555555600000n>>128n),(n&0x8000000000n)!=0n&&(f=f*0xffffff8000001ffffffaaaaaab555555n>>128n),(n&0x10000000000n)!=0n&&(f=f*0xffffff0000007fffffd555555ffffffen>>128n),(n&0x20000000000n)!=0n&&(f=f*0xfffffe000001fffffeaaaaab55555511n>>128n),(n&0x40000000000n)!=0n&&(f=f*0xfffffc000007fffff555555ffffff777n>>128n),(n&0x80000000000n)!=0n&&(f=f*0xfffff800001fffffaaaaab5555544444n>>128n),(n&0x100000000000n)!=0n&&(f=f*0xfffff000007ffffd55555fffffddddden>>128n),(n&0x200000000000n)!=0n&&(f=f*0xffffe00001ffffeaaaab555551111128n>>128n),(n&0x400000000000n)!=0n&&(f=f*0xffffc00007ffff55555fffff77777d28n>>128n),(n&0x800000000000n)!=0n&&(f=f*0xffff80001ffffaaaab5555444445b05bn>>128n),(n&0x1000000000000n)!=0n&&(f=f*0xffff00007fffd5555ffffdddde38e381n>>128n),(n&0x2000000000000n)!=0n&&(f=f*0xfffe0001fffeaaab5555111127d276a7n>>128n),(n&0x4000000000000n)!=0n&&(f=f*0xfffc0007fff5555ffff7777d27cf3cf5n>>128n),(n&0x8000000000000n)!=0n&&(f=f*0xfff8001fffaaab55544445b0596597f9n>>128n),(n&0x10000000000000n)!=0n&&(f=f*0xfff0007ffd555fffddde38e2be2d82d5n>>128n),(n&0x20000000000000n)!=0n&&(f=f*0xffe001ffeaab55511127d21522f2295cn>>128n),(n&0x40000000000000n)!=0n&&(f=f*0xffc007ff555fff777d279e7b87acece0n>>128n),(n&0x80000000000000n)!=0n&&(f=f*0xff801ffaab554445b04105b043e8f48dn>>128n),(n&0x100000000000000n)!=0n&&(f=f*0xff007fd55ffdde38d68f08c257e0ce3fn>>128n),(n&0x200000000000000n)!=0n&&(f=f*0xfe01feab551127cbfe5f89994c44216fn>>128n),(n&0x400000000000000n)!=0n&&(f=f*0xfc07f55ff77d2493e885eeaa756ad523n>>128n),(n&0x800000000000000n)!=0n&&(f=f*0xf81fab5445aebc8a58055fcbbb139ae9n>>128n),(n&0x1000000000000000n)!=0n&&(f=f*0xf07d5fde38151e72f18ff03049ac5d7fn>>128n),(n&0x2000000000000000n)!=0n&&(f=f*0xe1eb51276c110c3c3eb1269f2f5d4afbn>>128n),(n&0x4000000000000000n)!=0n&&(f=f*0xc75f7cf564105743415cbc9d6368f3b9n>>128n),(n&0x8000000000000000n)!=0n&&(f=f*0x9b4597e37cb04ff3d675a35530cdd768n>>128n),(n&0x10000000000000000n)!=0n&&(f=f*0x5e2d58d8b3bcdf1abadec7829054f90en>>128n),n!=0n&&(f=b/f),f}function f0(n){if(n<0n)throw new Error("Square root of negative numbers is not supported.");if(n<2n)return n;let f=n/2n,e=(f+n/f)/2n;for(;f>e;)f=e,e=(f+n/f)/2n;return f}function x0(n,f){let e=0,t=n.length;for(;e<t;){let i=Math.floor((e+t)/2);if(n[i].tick<=f){if(i===n.length-1||n[i+1].tick>f)return i;e=i}else t=i}return-1}var I=class{constructor({token0:f,token1:e,tickSpacing:t,fee:i,sqrtRatio:a,liquidity:o,tick:s,sortedTicks:r}){this.key={token0:f,token1:e,fee:i,tickSpacing:t,extension:0n},this.sortedTicks=r,this.state={sqrtRatio:a,liquidity:o,activeTickIndex:x0(r,s)}}combineResources(f,e){return{initializedTicksCrossed:f.initializedTicksCrossed+e.initializedTicksCrossed,tickSpacingsCrossed:f.tickSpacingsCrossed+e.tickSpacingsCrossed}}initialResources(){return{initializedTicksCrossed:0,tickSpacingsCrossed:0}}quote({tokenAmount:{amount:f,token:e},sqrtRatioLimit:t,overrideState:i}){let a=e===this.key.token1;if(!a&&this.key.token0!==e)throw new Error("Invalid token");let o=i??this.state,s=this.initialResources();if(f===0n)return{isPriceIncreasing:a,consumedAmount:0n,calculatedAmount:0n,executionResources:s,stateAfter:o,feesPaid:0n};let r=q(f,a),{sqrtRatio:c,liquidity:l,activeTickIndex:u}=o;if(t){if(r&&t<c)throw new Error("sqrtRatioLimit cannot be less than sqrtRatio");if(!r&&t>c)throw new Error("sqrtRatioLimit cannot be greater than sqrtRatio");if(t<R)throw new Error("sqrtRatioLimit lt min");if(t>A)throw new Error("sqrtRatioLimit gt max")}else t=r?A:R;let d=0n,g=0n,x=s.initializedTicksCrossed,m=f,k=c;for(;m!==0n&&c!==t;){let p=(r?this.sortedTicks[u+1]:this.sortedTicks[u])??null,h=p?v(p.tick):null,F=h===null?t:h<t===r?h:t,P=Q({fee:this.key.fee,sqrtRatio:c,liquidity:l,isToken1:a,sqrtRatioLimit:F,amount:m});m-=P.consumedAmount,d+=P.calculatedAmount,g+=P.feeAmount,c=P.sqrtRatioNext,p&&c===h&&(u=r?u+1:u-1,x++,l+=r?p.liquidityDelta:-p.liquidityDelta)}return{isPriceIncreasing:r,consumedAmount:f-m,calculatedAmount:d,feesPaid:g,executionResources:{initializedTicksCrossed:x,tickSpacingsCrossed:s.tickSpacingsCrossed+Z(k,c,this.key.tickSpacing)},stateAfter:{sqrtRatio:c,liquidity:l,activeTickIndex:u}}}hasLiquidity(){return this.state.liquidity>0n||this.sortedTicks.length>0}};var e0=88368108,g0=22027144413679976675n,p0=5256790760649093508123362461711849782692726119655358142129n,B=class{get key(){return{...this.basePool.key,extension:this.extension}}get sortedTicks(){return this.basePool.sortedTicks}constructor({token0:f,token1:e,fee:t,extension:i,sqrtRatio:a,liquidity:o,tick:s,token0SaleRate:r,token1SaleRate:c,lastExecutionTime:l,saleRateDeltas:u}){this.extension=i,this.basePool=new I({token0:f,token1:e,fee:t,sqrtRatio:a,liquidity:o,tick:s,tickSpacing:y,sortedTicks:[{tick:-e0,liquidityDelta:o},{tick:e0,liquidityDelta:-o}]}),this.token0SaleRate=r,this.token1SaleRate=c,this.lastExecutionTime=l,this.saleRateDeltas=u}initialResources(){return{...this.basePool.initialResources(),virtualOrderSecondsExecuted:0,virtualOrderDeltaTimesCrossed:0}}combineResources(f,e){return{...this.basePool.combineResources(f,e),virtualOrderDeltaTimesCrossed:f.virtualOrderDeltaTimesCrossed+e.virtualOrderDeltaTimesCrossed,virtualOrderSecondsExecuted:f.virtualOrderSecondsExecuted+e.virtualOrderSecondsExecuted}}quote({tokenAmount:f,sqrtRatioLimit:e,overrideState:t,meta:i}){let{block:{time:a}}=i,o=t??this.state,{sqrtRatio:s,token0SaleRate:r,token1SaleRate:c,lastExecutionTime:l}=o,u=a-l;if(u<0)throw new Error("Last execution time exceeds block time");let d=0,g=this.saleRateDeltas.findIndex(T=>T.time>l),x=t,m=this.basePool.initialResources();for(;l!==a;){let T=this.saleRateDeltas[g],K=T?Math.min(T.time,a):a,z=BigInt(K-l),[E,N]=[r*z>>32n,c*z>>32n];if(E>0n&&N>0n){let M=S0(g0,T0(p0,s));s=X(M,this.basePool.sortedTicks[0].liquidityDelta,r,c,z,this.key.fee);let[L,W]=M<s?[this.basePool.key.token1,N]:[this.basePool.key.token0,E],O=this.basePool.quote({tokenAmount:{amount:W,token:L},sqrtRatioLimit:s,meta:i,overrideState:x});x=O.stateAfter,m=this.basePool.combineResources(m,O.executionResources)}else if(E>0n||N>0n){let[M,L,W]=E!==0n?[E,!1,R]:[N,!0,A],O=this.basePool.quote({tokenAmount:{amount:M,token:L?this.basePool.key.token1:this.basePool.key.token0},sqrtRatioLimit:W,meta:i,overrideState:x});x=O.stateAfter,m=this.basePool.combineResources(m,O.executionResources),s=x.sqrtRatio}K===T?.time&&(r+=T.saleRateDelta0,c+=T.saleRateDelta1,g++,d++),l=K}let{consumedAmount:k,calculatedAmount:p,executionResources:h,stateAfter:F,isPriceIncreasing:P,feesPaid:t0}=this.basePool.quote({tokenAmount:f,sqrtRatioLimit:e,meta:i,overrideState:x});return{isPriceIncreasing:P,consumedAmount:k,calculatedAmount:p,feesPaid:t0,executionResources:{...this.basePool.combineResources(m,h),virtualOrderSecondsExecuted:u,virtualOrderDeltaTimesCrossed:d},stateAfter:{...F,token0SaleRate:r,token1SaleRate:c,lastExecutionTime:a}}}hasLiquidity(){return this.basePool.hasLiquidity()}get state(){return{...this.basePool.state,token0SaleRate:this.token0SaleRate,token1SaleRate:this.token1SaleRate,lastExecutionTime:this.lastExecutionTime}}};function T0(n,f){return n>f?f:n}function S0(n,f){return n>f?n:f}0&&(module.exports={BasePool,MAX_SQRT_RATIO,MAX_TICK,MAX_TICK_SPACING,MAX_U128,MAX_U256,MIN_SQRT_RATIO,MIN_TICK,TwammPool,amount0Delta,amount1Delta,calculateNextSqrtRatio,computeStep,msb,nextSqrtRatioFromAmount0,nextSqrtRatioFromAmount1,toSqrtRatio});
{
"name": "@ekubo/sdk",
"version": "0.0.1",
"version": "0.0.3",
"description": "SDK for working with Ekubo protocol",

@@ -9,3 +9,3 @@ "main": "dist/index.js",

"build": "tsup src/index.ts --dts --minify",
"prepublish": "rm -rf dist/ && npm run build"
"prepublishOnly": "rm -rf dist/ && npm run build"
},

@@ -12,0 +12,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc