1.0.0 • Published 11 months ago

sudocurve v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

SudoCurve

SudoCurve is a lightweight tool designed to calculate the buy price for a specific amount of a nft based on the details of a sudoswap pool. It simplifies complex calculations and is ideal for integration into decentralized finance (DeFi) platforms, providing accurate price estimations based on sudoswap pool parameters.

Table of Contents

Supported Chains

SudoCurve Supports the following chain IDs:

  • 1 (mainnet)
  • 5 (goerli)
  • 42161 (arbitrum)
  • 8453 (base)
  • 84532 (base-sepolia)

Installation

Published on npm.

npm install sudocurve

Code Examples

import { SudoCurve, Pool } from 'sudocurve';

const curve = new SudoCurve(84532);
const pool: Pool = {
  spotPrice: BigInt('10000000000000000'),
  feeAmount: BigInt('0'),
  delta: BigInt('0'),
  bondingCurveAddress: '0x93029eb6b57289b3ebee3fb359d8070f42804a06',
  royalty: BigInt('50000000000000000'),
};
const amountToBuy = 1;
const price = curve.getBuyNFTQuote(pool, amountToBuy);

console.log(`Buy price for ${amountToBuy} tokens is: ${price}`);

Contributing

We welcome contributions to SudoCurve! If you would like to contribute, please fork the repository and create a pull request with your changes.

License

SudoCurve is licensed under the MIT License. See the LICENSE file for more details.

1.0.0

11 months ago