A REST API service built with Elysia and Bun runtime for querying and interacting with Intuition Curves. This service provides endpoints for calculating prices, previewing operations, and converting between assets and shares.
This project looks for all of the Bonding Curves that have been deployed, clones their source code and constructor arguments, deploys them to a local Anvil node, and then provides an API to query them. This enables us to query curve parameters, calculate prices, and preview operations without having to make an RPC call to the mainnet -- and simulates the curve code in an isolated environment. This API will be expanded to include more utilities and metrics for the Intuition Curves as they are needed to support the Intuition Ecosystem.
- Current price calculation for curves
- Preview calculations for deposits, redeems, mints, and withdrawals
- Asset and share conversion utilities
- Curve parameter queries
- Swagger documentation for all endpoints
- Clone the repository
- Install dependencies:
bun install
To start the development server:
bun run dev
The API will be available at http://localhost:3000/
Once the server is running, visit http://localhost:3000/swagger to access the interactive API documentation.
The project includes a Dockerfile for containerized deployment. Build and run with:
docker build -t intuition-curves .
docker run -p 3000:3000 intuition-curves
You will need to provide the following .env
variables:
MULTIVAULT_ADDRESS=
BASESCAN_API_KEY=
BASE_SEPOLIA_RPC_URL=