AstaVerde is a platform for trading verified carbon offsets as non-fungible tokens (NFTs). Built on Ethereum using the ERC-1155 standard, it employs a Dutch Auction mechanism for pricing carbon credit batches.
The AstaVerde platform uses a Dutch auction mechanism for pricing carbon credit batches. Here are the key features of the auction:
- Starting Price: Each batch starts at the current
basePrice
(default: 230 USDC) per unit. - Price Floor: A minimum price of
priceFloor
(default: 40 USDC) per unit is enforced for all batches. - Daily Price Reduction: The price of each batch decreases by
priceDecreaseRate
(default: 1 USDC) per day for unsold tokens. - Dynamic Base Price: The
basePrice
for new batches is adjusted based on recent sales:- If a sale occurs within
dayIncreaseThreshold
days (default: 2) of the last price adjustment, thebasePrice
increases bypriceDelta
(default: 10 USDC). - If no sales occur for
dayDecreaseThreshold
days (default: 4), thebasePrice
decreases according to the daily reduction rate.
- If a sale occurs within
- Independent Batch Pricing: Each batch's price evolves independently based on its creation time, regardless of sales within the batch.
- Revenue Split:
100 - platformSharePercentage
% (default: 70%) of each sale goes to the token producer, whileplatformSharePercentage
% (default: 30%) goes to the platform.
The smart contract owner can adjust various parameters, including:
platformSharePercentage
: The percentage of sales that goes to the platformmaxBatchSize
: The maximum number of tokens in a batchbasePrice
: The starting price for new batchespriceFloor
: The minimum price for tokenspriceDelta
: The amount by which the base price increases after a quick salepriceDecreaseRate
: The daily price reduction ratedayIncreaseThreshold
: The number of days within which a sale triggers a price increasedayDecreaseThreshold
: The number of days without sales that trigger a price decrease
These parameters allow for fine-tuning of the auction mechanism to respond to market conditions and platform requirements. The contract owner can modify these values using specific setter functions provided in the smart contract.
- Credit Producers: Generate and verify carbon offsets, listing them as NFTs.
- Platform Owner: Mints new batches of NFTs and manages the auction.
- Buyers: Bid on and purchase batches of NFTs.
- Node.js and npm
- MetaMask or another Ethereum wallet
- Docker (for deployment)
-
Clone the repository:
git clone git@github.com:orpheuslummis/AstaVerde.git cd AstaVerde
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.local.example .env.local cp ./webapp/.env.local.example ./webapp/.env.local
Edit
.env.local
andwebapp/.env.local
with your specific private values. -
Compile the contracts:
npm run compile
-
Start a local Hardhat node:
npm run node
-
In a new terminal, deploy contracts to the local network:
npm run deploy:local
-
Start the webapp in development mode:
npm run webapp:dev
-
(Optional) For automatic recompilation and redeployment on contract changes:
npm run watch:dev
-
(Optional) For local minting:
npm run task:mintlocal
OWNER_ADDRESS=0x... p deploy:testnet
- Install Docker Desktop from https://docs.docker.com/desktop/install/mac-install/
- Clone the repository:
git clone git@github.com:orpheuslummis/AstaVerde.git && cd AstaVerde
- To deploy: Configure and run
./deploy.sh
- To mint: Configure and run
./mint.sh
-
Deploy contract on testnet:
npm run test npm run compile && npm run postinstall npm run deploy:contracts -- --network base-sepolia
-
Set environment variables on Vercel:
- CHAIN_SELECTION
- ALCHEMY_API_KEY
- WALLET_CONNECT_PROJECT_ID
- Prepare a CSV file with token metadata and an image folder.
- Update the
.env.local
file with the correct paths. - Run
npm run task:mint
- Update default values in
/scripts/events/index.mjs
. - Run
npm run task:events
When updating the contract, remember to update the contract address and ABI in:
webapp/src/lib/contracts.ts
scripts/events/contracts.mjs
.env.local
for minting scripts
This project is licensed under the MIT License - see the LICENSE file for details.
- The market can be paused if USDC becomes depegged.
- Always ensure your
.env.local
andwebapp/.env.local
files are up to date and never committed to the repository.