Trade

Trade on SynFutures

Base
Base

Acts onchain

Trades a SynFutures instrument on Base at the market: a long or a short of the size stated, against the instrument's AMM, filled in the same block. The instrument's trade takes two packed words: SynFutures' default referral, the deadline (the plug's own), the limit tick and the expiry, then the signed size above the margin to post. The size is in the instrument's base at 18 decimals; a trade the other way reduces or closes a position, and all reads the Plug account's position on the expiry from the Observer when the program runs and trades exactly its size the other way, closing it. The worst price is converted to the limit tick on the trader's side, and zero trades at any price; the instrument refuses a trade whose fill would land past it, a trade below the instrument's minimum, and one that leaves the position under its initial margin. Closing a position whole returns its margin to the Plug account's Gate reserve. The program approves the Gate for exactly the margin before the call and clears the approval after it: the instrument takes margin out of the Plug account's Gate reserve first and has the Gate pull only what the reserve does not cover from the Plug account, so an approval the reserve covered never lingers. Margin is stated in the instrument's quote token and posted at the instrument's 18-decimal precision. Prices are quote per base on SynFutures' tick ladder, 1.0001 per tick; a price is converted to the tick on the trader's side of it, so a fill never lands past the price stated. SynFutures keys every Gate reserve, position, order and range on its trader, the address that sends the call, and Base's Gate has no operator, depositFor or withdrawFor through which another address could act for a trader. A plug's deposits, trades, orders and ranges are therefore the Plug account's: they sit in the Plug account's reserve and portfolio, later steps act on them from the Plug account, and a withdrawal pays the Plug account. A reserve, position, order or range of the wallet's own is acted on only by a call the wallet sends itself. Reach for it to open a position when a condition is met, to close one before the liquidation price gets close, or to scale in as a price confirms.

Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.

ETH/USDC Long on Syn Futures Under 2600

synfutures
1action
  1. 1·Trade

    Opening a long on the ETH/USDC perpetual at instrument 0x04d72fb4803b4e02f14971e5bd092375eb330749:4294967295, this step buys 0.05 of size against the SynFutures AMM on Base, posts 80 USDC (token 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) as margin, and caps the fill at a price no worse than 2600 so the order reverts rather than filling above that bound.

Trade on posting of margin at no worse than
  • ETH/USDC Long on Syn Futures Under 2600

    synfutures

More on SynFutures · 13