@@ -28,6 +28,7 @@ import { sorobanMath } from './tools/soroban_math.js';
2828import { decodeLedgerEntryTool , decodeLedgerEntrySchema } from './tools/decode_ledger_entry.js' ;
2929import { computeVestingSchedule } from './tools/compute_vesting_schedule.js' ;
3030import { deployContract } from './tools/deploy_contract.js' ;
31+ import { calculateDutchAuctionPrice , calculateEnglishAuctionState } from './tools/auction_compute.js' ;
3132import { manageDaoTreasury } from './tools/manage_dao_treasury.js' ;
3233import { computeInterestRates , calculateBorrowingCapacity } from './tools/lending_compute.js' ;
3334import { trackLedgerConsensusTime } from './tools/track_ledger_consensus_time.js' ;
@@ -62,6 +63,9 @@ import {
6263 SorobanMathInputSchema ,
6364 ComputeVestingScheduleInputSchema ,
6465 DeployContractInputSchema ,
66+ CalculateDutchAuctionPriceInputSchema ,
67+ CalculateEnglishAuctionStateInputSchema ,
68+ } from './schemas/tools.js' ;
6569 ManageDaoTreasuryInputSchema ,
6670 ComputeInterestRatesInputSchema ,
6771 CalculateBorrowingCapacityInputSchema ,
@@ -706,6 +710,37 @@ class PulsarServer {
706710 } ,
707711 } ,
708712 {
713+ name : 'calculate_dutch_auction_price' ,
714+ description : 'Calculate the current price of an asset in a Dutch auction (linear price decay). Useful for NFT drops or fair price discovery.' ,
715+ inputSchema : {
716+ type : 'object' ,
717+ properties : {
718+ start_price : { type : 'number' , description : 'Initial auction price.' } ,
719+ reserve_price : { type : 'number' , description : 'Minimum/floor price.' } ,
720+ start_timestamp : { type : 'number' , description : 'Unix timestamp when decay begins.' } ,
721+ end_timestamp : { type : 'number' , description : 'Unix timestamp when price reaches reserve.' } ,
722+ current_timestamp : { type : 'number' , description : 'Optional override for current time.' } ,
723+ } ,
724+ required : [ 'start_price' , 'reserve_price' , 'start_timestamp' , 'end_timestamp' ] ,
725+ } ,
726+ } ,
727+ {
728+ name : 'calculate_english_auction_state' ,
729+ description : 'Calculate the next bid requirements and state for an English auction.' ,
730+ inputSchema : {
731+ type : 'object' ,
732+ properties : {
733+ current_highest_bid : { type : 'number' , description : 'Current top bid (0 if no bids).' } ,
734+ reserve_price : { type : 'number' , description : 'Minimum bid to win/start.' } ,
735+ bid_increment : { type : 'number' , description : 'Required increase over the current bid.' } ,
736+ bid_increment_type : { type : 'string' , enum : [ 'absolute' , 'percentage' ] , default : 'absolute' } ,
737+ end_timestamp : { type : 'number' , description : 'Unix timestamp when auction ends.' } ,
738+ current_timestamp : { type : 'number' , description : 'Optional override for current time.' } ,
739+ } ,
740+ required : [ 'current_highest_bid' , 'reserve_price' , 'bid_increment' , 'end_timestamp' ] ,
741+ } ,
742+ } ,
743+ ] ,
709744 name : 'compute_interest_rates' ,
710745 description : 'Calculate borrow and supply interest rates using a Jump Rate Model (standard for protocols like Aave). Useful for simulating lending pool dynamics.' ,
711746 inputSchema : {
@@ -1496,6 +1531,9 @@ class PulsarServer {
14961531 case 'get_account_balance' : {
14971532 const parsed = GetAccountBalanceInputSchema . safeParse ( args ) ;
14981533 if ( ! parsed . success ) {
1534+ throw new PulsarValidationError ( `Invalid input for get_account_balance` , parsed . error . format ( ) ) ;
1535+ }
1536+ const result = await getAccountBalance ( parsed . data ) ;
14991537 throw new PulsarValidationError (
15001538 `Invalid input for get_account_balance` ,
15011539 parsed . error . format ( )
@@ -2053,6 +2091,21 @@ class PulsarServer {
20532091 } ;
20542092 }
20552093
2094+ case 'calculate_dutch_auction_price' : {
2095+ const parsed = CalculateDutchAuctionPriceInputSchema . safeParse ( args ) ;
2096+ if ( ! parsed . success ) {
2097+ throw new PulsarValidationError ( `Invalid input for calculate_dutch_auction_price` , parsed . error . format ( ) ) ;
2098+ }
2099+ const result = await calculateDutchAuctionPrice ( parsed . data ) ;
2100+ return { content : [ { type : 'text' , text : JSON . stringify ( result ) } ] } ;
2101+ }
2102+
2103+ case 'calculate_english_auction_state' : {
2104+ const parsed = CalculateEnglishAuctionStateInputSchema . safeParse ( args ) ;
2105+ if ( ! parsed . success ) {
2106+ throw new PulsarValidationError ( `Invalid input for calculate_english_auction_state` , parsed . error . format ( ) ) ;
2107+ }
2108+ const result = await calculateEnglishAuctionState ( parsed . data ) ;
20562109 case 'compute_interest_rates' : {
20572110 const parsed = ComputeInterestRatesInputSchema . safeParse ( args ) ;
20582111 if ( ! parsed . success ) {
0 commit comments