Skip to main content
POST
Python (SDK)

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Open a new position.

owner
string
default:0x06A9aF046187895AcFc7258450B15397CAc67400
required

The wallet that owns the Risk Yield Account.

Example:

"0x06A9aF046187895AcFc7258450B15397CAc67400"

pool
PoolSelector · object
required

Which pool, by id or by its key.

A pool id is stable and is what the list endpoints return. The long form exists so a caller who knows the pair can address a pool without a lookup — on a chain minting twenty thousand pools a day, a client should not have to search for one it just created.

Example:
range
SymmetricRange · object
required

A range centred on the current price, given as a percentage either side.

The usual way to ask for a position: narrow earns more fees per dollar while the price stays inside it, and stops earning entirely when it leaves.

Example:
deposit
BothSidesDeposit · object
required

Explicit amounts of each token.

Example:
chain
enum<string>
default:robinhood

Risk Yield is available on Robinhood Chain only.

Available options:
robinhood
Example:

"robinhood"

gas_sponsorship
boolean
default:false

Return EIP-712 typed data for the owner to sign instead of a transaction, so a sponsor can broadcast it.

preview
boolean
default:false

Return the plan and its simulation without building a transaction. Nothing is signed and nothing can be broadcast.

slippage_pct
default:0.5

How far the executed amounts may fall short of the quote before the transaction reverts. Memecoin pools move between the quote and the block that includes the transaction.

Required range: 0 < x <= 10
deadline_seconds
integer
default:300

How long the transaction stays valid once built.

Required range: 30 <= x <= 3600
recipient
string | null

Who receives the position NFT. Defaults to the Risk Yield Account, which is what makes it manageable through this API.

Response

Successful Response

The shape every liquidity-changing endpoint returns.

transaction
UnsignedTransaction · object | null
Example:
position_id
integer | null
range
ResolvedRange · object | null

A range after the API has snapped it to the pool's tick spacing.

Returned because the range you asked for is rarely the range you get: ticks are discrete, and a 30% band becomes whichever usable ticks bracket it.

plan
DepositPlan · object | null

What will actually be deposited, and what is left over.

A range fixes the ratio of the two assets, so a deposit rarely uses all of both. The leftovers are reported rather than silently swept: they stay in the account, and a caller who expected them to be used should know.

expected_liquidity
string | null
liquidity_removed
string | null
amount0_min
string | null
amount1_min
string | null
steps
PlanStep · object[]
simulation
Simulation · object | null

The result of executing the transaction against current state.

Meme tokens on this chain carry transfer taxes, blacklists and pause switches, none of which are visible from a pool's parameters. Simulating is the only way to find out before the owner signs.

warnings
string[]