Auction Params Endpoint (#442)

* move auction endpoint changes to fresh branch

* final cleanup and add testing for util functions

* fix tests

* fix quote amount conversion
This commit is contained in:
lowkeynicc
2025-07-14 19:13:43 -04:00
committed by GitHub
parent dd524de371
commit 7483704d09
7 changed files with 2553 additions and 35 deletions

24
src/utils/types.ts Normal file
View File

@@ -0,0 +1,24 @@
import { AssetType, MarketTypeStr } from "@drift-labs/sdk";
import { TradeOffsetPrice } from "@drift/common";
export type AuctionParamArgs = {
// mandatory args
marketIndex: number;
marketType: MarketTypeStr;
direction: 'long' | 'short';
amount: string;
assetType: AssetType;
// optional settings args
reduceOnly?: boolean;
allowInfSlippage?: boolean;
slippageTolerance?: number;
isOracleOrder?: boolean;
auctionDuration?: number;
auctionStartPriceOffset?: number | 'marketBased';
auctionEndPriceOffset?: number;
auctionStartPriceOffsetFrom?: TradeOffsetPrice | 'marketBased';
auctionEndPriceOffsetFrom?: TradeOffsetPrice;
additionalEndPriceBuffer?: string;
userOrderId?: number;
};