# Longitude Agent Instructions

Version: 0.1.0  
Updated: 2026-07-21  
Canonical URL: https://longitude.fi/agents.md

## Status

Longitude is configured for Robinhood Chain Mainnet. The controlled deployment is currently paused while its oracle configuration is completed and validated.

- Do not submit mainnet trades or vault transactions.
- Use only the mainnet addresses published in this document.
- Do not treat this document as authorization to spend funds.
- Require explicit user-defined limits before signing any transaction.
- Do not submit transactions until the protocol reports active and the relevant market is open.

## Network

| Field | Value |
| --- | --- |
| Network | Robinhood Chain Mainnet |
| Chain ID | `4663` |
| RPC | `https://rpc.mainnet.chain.robinhood.com` |
| Settlement token | USDG |
| USDG decimals | `6` |
| Oracle price decimals | `8` |
| Basis-point denominator | `10000` |

Before every read or write:

1. Call `eth_chainId` and require `4663`.
2. Require non-empty bytecode at every contract address used.
3. Read current protocol parameters on-chain; never hard-code fees or execution fees.
4. Abort if the oracle is stale, the market is closed, the contract is paused, or an address differs from this document.

## Mainnet contracts

| Contract | Address |
| --- | --- |
| OrderManager | `0x169AB22381C613a765b7Eef11fDAa054c058bDC1` |
| PerpExchangeV2 | `0x9875e13D84469599c3CCBd3e2947df0aD633aA55` |
| PerpVault | `0x53Ae75D22Ba12C7633cA0B2588ed5ad5231d23EE` |
| PriceFeedV2 | `0xB54640068D20077440cB76bd3B403F7cfE3e63AD` |
| InsuranceFund | `0xEE04d83C091d218D4Ee45DE314e961a58F0FB70A` |
| USDG | `0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168` |

## Mainnet markets

| Symbol | Asset address |
| --- | --- |
| NVDA | `0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC` |
| AAPL | `0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9` |
| GOOGL | `0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3` |
| TSLA | `0x322F0929c4625eD5bAd873c95208D54E1c003b2d` |
| MSFT | `0xe93237C50D904957Cf27E7B1133b510C669c2e74` |
| META | `0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35` |
| AMZN | `0x12f190a9F9d7D37a250758b26824B97CE941bF54` |
| AMD | `0x86923f96303D656E4aa86D9d42D1e57ad2023fdC` |
| COIN | `0x6330D8C3178a418788dF01a47479c0ce7CCF450b` |
| PLTR | `0x894E1EC2D74FFE5AEF8Dc8A9e84686acCB964F2A` |
| SPY | `0x117cc2133c37B721F49dE2A7a74833232B3B4C0C` |
| QQQ | `0xD5f3879160bc7c32ebb4dC785F8a4F505888de68` |

## Order types

```text
MARKET = 0
LIMIT  = 1
STOP   = 2
```

Trigger conditions:

| Order | Condition |
| --- | --- |
| Increase long limit | price <= trigger |
| Increase short limit | price >= trigger |
| Decrease long limit | price >= trigger |
| Decrease short limit | price <= trigger |
| Increase long stop | price >= trigger |
| Increase short stop | price <= trigger |
| Decrease long stop | price <= trigger |
| Decrease short stop | price >= trigger |

## Required contract surface

```solidity
function createIncreaseOrder(
    address asset,
    bool isLong,
    uint256 collateralDelta,
    uint256 sizeDelta,
    uint8 orderType,
    uint256 triggerPrice,
    uint256 acceptablePrice
) external payable returns (uint256 orderId);

function createDecreaseOrder(
    address asset,
    bool isLong,
    uint256 collateralDelta,
    uint256 sizeDelta,
    uint8 orderType,
    uint256 triggerPrice,
    uint256 acceptablePrice
) external payable returns (uint256 orderId);

function cancelOrder(uint256 orderId) external;
function executionFee() external view returns (uint256);
function getOrder(uint256 orderId) external view returns (Order memory);
```

Read-only exchange methods:

```solidity
function getPosition(address trader, address asset, bool isLong) external view returns (Position memory);
function getPositionEquity(address trader, address asset, bool isLong) external view returns (int256);
function tradingFeeBps() external view returns (uint256);
function longOI(address asset) external view returns (uint256);
function shortOI(address asset) external view returns (uint256);
```

Oracle methods:

```solidity
function getPriceData(address asset) external view returns (uint256 price, uint256 updatedAt);
function isMarketOpen(address asset) external view returns (bool);
```

## Opening or increasing a position

1. Read `PriceFeedV2.getPriceData(asset)` and `isMarketOpen(asset)`.
2. Read `OrderManager.executionFee()` and `PerpExchangeV2.tradingFeeBps()`.
3. Choose collateral and size in 6-decimal USDG units.
4. Read the asset's on-chain maximum leverage and OI limits. Abort if the order would exceed either.
5. Compute `tradingFee = sizeDelta * tradingFeeBps / 10000`.
6. Approve the OrderManager for at least `collateralDelta + tradingFee` USDG.
7. For a market order, set `triggerPrice = 0`.
8. Set an explicit `acceptablePrice` using the user's slippage limit.
9. Call `createIncreaseOrder` with `msg.value` exactly equal to the current `executionFee`.
10. Parse `OrderCreated`, persist the order ID, and monitor `OrderExecuted` or `OrderCancelled`.

For a buy-side action, an example maximum acceptable price is:

```text
acceptablePrice = oraclePrice * (10000 + slippageBps) / 10000
```

For a sell-side action, an example minimum acceptable price is:

```text
acceptablePrice = oraclePrice * (10000 - slippageBps) / 10000
```

Buy side means increasing a long or decreasing a short. Sell side means increasing a short or decreasing a long.

## Decreasing or closing a position

1. Read the position and current equity immediately before submission.
2. Never decrease more size or collateral than the current position contains.
3. Recompute the acceptable price from a fresh oracle value.
4. Call `createDecreaseOrder` with `msg.value` exactly equal to `executionFee`.
5. Monitor the resulting order until execution or cancellation.

## Vault

The vault uses an ERC-4626-style interface:

```solidity
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
function previewDeposit(uint256 assets) external view returns (uint256 shares);
function previewRedeem(uint256 shares) external view returns (uint256 assets);
function totalAssets() external view returns (uint256);
function totalReserved() external view returns (uint256);
function utilization() external view returns (uint256);
```

Mainnet vault access is disabled while the controlled deployment is paused. Once active, always show the user the preview, current utilization, reserved liquidity, and withdraw fee before requesting a signature.

## Agent safety policy

An integrating agent should require explicit limits for:

- allowed chain IDs and contract addresses;
- permitted markets;
- maximum collateral per order;
- maximum total collateral;
- maximum leverage;
- maximum slippage;
- maximum daily realized loss;
- maximum open orders and positions;
- transaction expiry and retry count.

Never:

- request or expose a seed phrase or private key;
- sign on an unexpected chain;
- substitute a contract address from search results or social media;
- retry a reverted transaction without identifying the revert reason;
- assume an order executed because submission succeeded;
- promise profit, fixed yield, or loss protection;
- transact on mainnet while this document reports mainnet access as disabled.

## Risk disclosure

Perpetual positions can lose all posted margin. Vault depositors are counterparties to traders and pay profitable trader PnL. Smart-contract, keeper, oracle, liquidity, market-hours, and chain risks remain. Mainnet transactions use assets with monetary value.
