Place market order with target value

Place market order with target value on Hanji

Base
Base

Acts onchain

Spends an amount of a Hanji order book's quote token on its base token at market, never above a maximum price. The socket approves the book, or sends native ETH as value on a book that settles it, and calls placeMarketOrderWithTargetValue: the book sets the taker fee its getConfig reports aside out of the amount, buys whole lots up the asks from the best to max_price, quoted in the quote token per base token, returns whatever it did not spend, the approval is reset to zero, and the action returns the base token received. When no ask sits at or below max_price the book reverts ZeroTokenTransferNotAllowed() and the plug reverts with it. Reach for it to put a fixed budget into on-chain order book depth at a price you cap, coiling what it buys into the next step.

Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.

Buy ETH Dip Under 2550 on Hanji

hanji
1action
  1. 1·Place market order with target value

    This step submits a market buy on Hanji's ETH/USDC order book, spending 1 USDC [quote token] to acquire ETH [base token] while refusing any fill above the ceiling price of 2550.

Spend on for at a price of at most
  • Buy ETH Dip Under 2550 on Hanji

    hanji
  • USDC Into cbBTC and ETH Limit Buy

    tessera
    hanji

More on Hanji · 1