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

Sweep the fees a position has earned.

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
recipient
string | null

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[]