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

Move a position to a new range.

Rebalancing is not free: it realizes the impermanent loss taken so far, pays gas twice and a swap, and puts the position back at risk from a new price. The API will answer NOOP when it thinks the move is not worth making.

owner
string
default:0x06A9aF046187895AcFc7258450B15397CAc67400
required

The wallet that owns the Risk Yield Account.

Example:

"0x06A9aF046187895AcFc7258450B15397CAc67400"

position_id
integer
default:1076416
required
Example:

1076416

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
dex_version
enum<string>
default:V3

Which Uniswap deployment a pool belongs to.

v3 pools hold their own tokens and pay LPs the fee tier. v4 pools live in a shared PoolManager and may route the fee through a hook, which is where the launchpad pools' zero LP yield comes from.

Available options:
V3,
V4
strategy
enum<string>
default:vol_scaled

How to choose the new range.

Available options:
recenter_symmetric_pct,
vol_scaled,
manual
Example:

"vol_scaled"

width_pct

Required for recenter_symmetric_pct.

Required range: 0 < x <= 1000
horizon_days
integer
default:7

For vol_scaled: how long the range should survive an ordinary move. A range narrower than the asset's usual movement spends most of its life out of range earning nothing.

Required range: 1 <= x <= 365
Example:

7

tick_lower
integer | null

For manual.

tick_upper
integer | null

For manual.

burn_old
boolean
default:true

Destroy the emptied NFT once it is unwound.

Response

Successful Response

action
string
required

NOOP, COLLECT_ONLY or RECENTER. NOOP is a real answer and often the right one — moving a position realizes its loss and pays for a swap.

reason
string
required
transaction
UnsignedTransaction · object | null
Example:
old_position_id
integer | null
old_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.

new_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.

liquidity_removed
string | null
amount0_floor
string | null

What the unwind is guaranteed to return. The new position is sized from this rather than from the quote, because every leg executes in the same transaction and a mint sized from a quote reverts when the decrease comes back a wei short.

amount1_floor
string | null
expected_liquidity_floor
string | null
estimated_dust0
string | null
estimated_dust1
string | null
phases
RebalancePhase · 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[]