Configure the SDK

Each SDK instance is configurable. If no options are provided, Openflow default options will be utilized.

Example

IOpenflowSdk.Options memory options = sdk.options(); // Load existing options
options.auctionDuration = 60 * 5; // Set auction duration to 5 Minutes.
options.slippageBips = 60; // Update slippage bips to 60.
options.manager = msg.sender; // Set instance manager to msg.sender.
options.managerCanSwap = true; // Allow manager to swap.
sdk.setOptions(options); // Set options

All current SDK options are defined here. Let's review the options.

SDK Options

Option
Description

driver

  • Driver is responsible for authenticating quote selection

  • If no driver is set anyone with the signature will be allowed to execute the signed payload.

  • Driver is user-configurable

    • The end user does not have to trust Openflow driver multisig

    • If the user desires, the user can run their own decentralized multisig driver

oracle

  • Oracle is responsible for determining minimum amount out for an order

  • If no oracle is provided the default Openflow oracle will be used

  • Users can use a custom oracle if desired

requireOracle

  • In some cases on-chain pricing is not available and a user would like to use the top quote regardless, or manually specify minimum amount to receive. In these cases requireOracle can be set to false and the user can still be certain that an auction has occurred and the best quote was selected

slippageBips

  • Acceptable slippage threshold denoted in BIPs

auctionDuration

  • Maximum duration for auction. The order is invalid after the auction ends

managerCanSwap

  • Manager is responsible for managing SDK option

Last updated