Skip to main content
POST
Turn a forecast into unsigned approve and buy transactions

Body

application/json

Give exactly one of quantiles or probs. An empty array or null counts as not given.

budget
required

tUSDC to spend, fee included, 1 to 10000.

quantiles
(number | string)[] | null

Your forecast as 7 BTC prices in USD at the 5th, 10th, 25th, 50th, 75th, 90th and 95th percentiles, e.g. [76000, 77500, 79500, 81000, 82500, 84500, 86000].

A number, or the same value as a decimal string.

probs
(number | string)[] | null

Alternative to quantiles: one non-negative weight per price range, in index order. Normalized for you.

A number, or the same value as a decimal string.

wallet
string | null

Your wallet. Lets the API check your balance and skip the approval if it's already granted.

Pattern: ^0x[0-9a-fA-F]{40}$
slippageBps
integer

Price-move allowance in basis points, default 100.

Required range: 0 <= x <= 500

Response

Transactions to sign and send in order.

chainId
number
required
market
string
required

0x-prefixed 20-byte address.

Pattern: ^0x[0-9a-fA-F]{40}$
quote
object
required

Quoted on-chain just now, in tUSDC.

maxCost
string
required

The most the buy can cost, slippage included, in tUSDC.

Pattern: ^-?\d+(\.\d+)?$
maxCostWad
string
required

Integer in 18-decimal base units, as a string. 1 tUSDC = 1000000000000000000.

Pattern: ^\d+$
shares
string[]
required

Shares bought per price range, in index order.

Exact decimal number as a string, e.g. "0.0279" or "77000". Converted directly from the 18-decimal on-chain integer, never through a float.

Pattern: ^-?\d+(\.\d+)?$
sharesWad
string[]
required

Integer in 18-decimal base units, as a string. 1 tUSDC = 1000000000000000000.

Pattern: ^\d+$
activeRanges
integer
required
Required range: -9007199254740991 <= x <= 9007199254740991
transactions
object[]
required

Sign and send in order: approve (when needed), then buy.

wallet
object | null
required
note
string
required