Skip to content

Bundler SDK slippage description is incorrect #470

@AustinWoetzel

Description

@AustinWoetzel

Bundler SDK calls "morphoBorrow" with argument of slippageAmount
https://github.com/morpho-org/sdks/blob/03a9a9ebd201c2409c05ca989b13e8db8796537e/packages/bundler-sdk-viem/src/BundlerAction.ts#L1180C4-L1180C165

This is described as the follows:
@param slippageAmount The minimum (resp. maximum) amount of assets (resp. borrow shares) to borrow (resp. mint) (protects the sender from unexpected slippage).

I believe the slippageAmount description is incorrect and should be a minSharePrice which would reflect the solidity code
https://github.com/morpho-org/bundler3/blob/3b22daf606bdef4f119f168c74496f87a90ac8e5/src/adapters/GeneralAdapter1.sol#L238
@param minSharePriceE27 The minimum amount of assets borrowed per borrow share minted, scaled by 1e27.

This is reinforced by the SDK bundler implementation for "Blue_Borrow" which takes the DEFAULT_SLIPPAGE_TOLERANCE and performs a minSharePrice calculation, before calling "morphoBorrow"

const minSharePrice = MathLib.mulDivDown(

The same problem also exists for morphoRepay, morphoSupply, and morphoWithdraw

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions