Skip to Content
DevelopersMarket MakersSwift Place-and-Make

Swift Place-and-Make

Complete the Swift MM flow by submitting the signed taker order and your maker fill on-chain (place-and-make). The on-chain program expects an ed25519 verification instruction before the “place signed taker order” instruction (transaction introspection). The SDK provides helpers to build the required instruction sequence.

const ixs = await driftClient.getPlaceAndMakeSignedMsgPerpOrderIxs( signedSignedMsgOrderParams, signedMsgOrderUuid, takerInfo, makerOrderParams );
Method DriftClient.getPlaceAndMakeSignedMsgPerpOrderIxsReference ↗
Parameters:
NameTypeDefault
signedSignedMsgOrderParamsSignedMsgOrderParams
signedMsgOrderUuidUint8Array<ArrayBufferLike>
takerInfo{ taker: PublicKey; takerStats: PublicKey; takerUserAccount: UserAccount; signingAuthority: PublicKey; }
orderParamsOptionalOrderParams
referrerInfoReferrerInfo
subAccountIdnumber
precedingIxsTransactionInstruction[]
overrideCustomIxIndexnumber
Returns:
Promise<TransactionInstruction[]>
const txSig = await driftClient.placeAndMakeSignedMsgPerpOrder( signedSignedMsgOrderParams, signedMsgOrderUuid, takerInfo, makerOrderParams ); console.log(txSig);
Method DriftClient.placeAndMakeSignedMsgPerpOrderReference ↗
Parameters:
NameTypeDefault
signedSignedMsgOrderParamsSignedMsgOrderParams
signedMsgOrderUuidUint8Array<ArrayBufferLike>
takerInfo{ taker: PublicKey; takerStats: PublicKey; takerUserAccount: UserAccount; signingAuthority: PublicKey; }
orderParamsOptionalOrderParams
referrerInfoReferrerInfo
txParamsTxParams
subAccountIdnumber
precedingIxsTransactionInstruction[]
overrideCustomIxIndexnumber
Returns:
Promise<string>

Build maker params from the incoming order

For convenience, use helper builders like getLimitOrderParams(...) to create the maker order params you want to place.

import { getLimitOrderParams } from "@drift-labs/sdk";
Function getLimitOrderParamsReference ↗
Parameters:
NameTypeDefault
paramsOmit<OptionalOrderParams, "orderType"> & { price: BN; }
Returns:
OptionalOrderParams
Last updated on