
Curve · Reads onchain state
Reads the amount a Curve pool would pay right now for swapping one coin to another. The pool's get_dy is called for the two coin indices and the input amount, returning the output in the output coin's units net of the pool's fee. Indices are resolved at runtime when the coins are coils, and the action requires they differ. Reach for it to compare venues before routing, to set a swap floor from a live quote with a slippage haircut, or to gate a trade behind a minimum rate with a predicate.
On other protocols · 1