Skip to content

API ReferenceOrders

Endpoints

Orders

Limit and DCA orders: list them, and get the calldata to create or cancel one.

Base URLhttps://api.lane.markets/v1local instance: http://localhost:3000/v1

Open limit/DCA orders

GET/v1/orders

Query parameters

  • owneraddress

Responses

200Orders

  • ordersobject[]

  • orders[].iduint string

  • orders[].owneraddress

  • orders[].tokenInstring

  • orders[].tokenOutstring

  • orders[].remaininguint string

  • orders[].perSliceuint string

  • orders[].minOutPerSliceuint string

  • orders[].intervaluint string

  • orders[].nextFillAtuint string

  • orders[].expiryuint string

  • orders[].statusobject | null

    Keeper's last check

  • orders[].status.state"scheduled" | "waiting_price" | "no_route" | "filling"

  • orders[].status.bestOutstring | null

  • orders[].status.minOutuint string

  • orders[].status.checkedAtinteger

503OrderBook not configured

Request
curl "https://api.lane.markets/v1/orders"

Calldata to place a limit order (slices=1) or a DCA (slices>1)

GET/v1/orders/create

Query parameters

  • intoken idrequired

    ERC20 address, or HYPE for native

  • outtoken idrequired

    ERC20 address, or HYPE for native

  • amountuint stringrequired

    Total input, base units

  • owneraddressrequired

  • minOutuint stringrequired

    Minimum output for the WHOLE amount (> 0), enforced pro rata per slice

  • slicesintegerdefault 1

  • intervalintegerdefault 0

    Seconds between slices (required if slices > 1)

  • expiresInintegerdefault 604800

    Seconds until expiry

Responses

200Simulated create transaction

  • orderobject

  • order.perSliceuint string

  • order.minOutPerSliceuint string

  • order.slicesuint string

  • order.intervaluint string

  • order.expiryuint string

  • txobject

  • tx.fromaddress

  • tx.toaddress

  • tx.datastring

  • tx.valueuint string

  • tx.chainIdinteger

  • tx.warningstring

    Present when the simulation failed. Do not send.

  • approvalobject | null

    ERC20 approve to send before tx (null if the allowance is enough)

  • approval.toaddress

  • approval.datastring

  • simulationobject

  • simulation.okboolean

  • simulation.gasuint string

  • simulation.errorstring

400Invalid input

Request
curl "https://api.lane.markets/v1/orders/create?in=HYPE&out=0x7D29d8047B905000459c0E80c34a26CeedcB47b2&amount=1000000000000000000&owner=0xYourAddress&minOut=26000000"

Calldata to cancel an order

GET/v1/orders/cancel

The owner can cancel any time; anyone can cancel after expiry. The refund always goes to the owner.

Query parameters

  • iduint stringrequired

    Unsigned integer as a decimal string

Responses

200Cancel transaction

  • txobject

  • tx.fromaddress

  • tx.toaddress

  • tx.datastring

  • tx.valueuint string

  • tx.chainIdinteger

  • tx.warningstring

    Present when the simulation failed. Do not send.

Request
curl "https://api.lane.markets/v1/orders/cancel?id=1"
lane.markets · Make the most of every move.