positions

Prepare a position — returns UNSIGNED transactions for your wallet to sign

The only endpoint that needs a write key, and even it cannot execute anything.

What it does. Authenticates the key, validates the intent, embeds the 0.05% protocol fee into the order, reads your live allowance (and optionally balance) from the chain, and returns the complete, ordered set of unsigned transactions required to create the position. Nothing is broadcast, nothing is signed, no allowance is created.

What you do. Sign each transaction in transactions[] with the wallet you named, in the order given, then broadcast. We are not involved in either step.

Approvals are conditional. The approve steps are omitted when your live allowance already covers the amount, so the same logical position may come back as one step or three.

No expiry, deliberately. A prepared payload holds no reservation and no server-side lock; it is a pure function of its inputs plus a salt. The salt is derived from (your key, Idempotency-Key), so a retry returns the same strategyHash and cannot create a second position. Omit the header and every call is a new position.

Fees. The fee object reports what is already embedded in the unsigned order data. There is no parameter that removes it.

post/v1/positions

Request

  • Base URL: https://yield.trdefi.com
  • URL: https://yield.trdefi.com/v1/positions
  • Auth: HTTP bearer

Headers

Idempotency-Keystring uuid

Recommended. The salt is derived from this, so repeating the request with the same key returns the same strategyHash instead of creating a second position.

Request body

chain'base' | 'arc' | 'baseSepolia' required

Chain key. base = 8453, arc = 5042, baseSepolia = 84532. A test key may only name baseSepolia; a live key may not.

walletstring required

The address that will sign. It must be yours. We only ever prepare for the address you name here.

makerFeeBpsinteger

Your commission, in the protocol's 1e7 fee scale (30000 = 0.30%). Independent of, and on top of, the 0.05% protocol fee.

includeApprovalsboolean

Set false to receive only the ship step. By default the approve steps are included only where your live allowance is short.

checkBalancesboolean

Add live balance checks to preflight so you can tell a human the transfer will succeed before asking them to approve.

metadataobject

Bounded free-form map (no secrets). Echoed back; returned in webhooks and exports.

Example request

{
  "chain": "arc",
  "deposits": [
    {
      "symbol": "USDC",
      "amount": "1000000"
    }
  ]
}

Response

Prepared position. Inert: nothing has been signed or broadcast.

Example response

{
  "meta": {
    "apiVersion": "v1"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.