Skip to main content

Ramses API on Robinhood Chain: Trades, Liquidity Pools and Fee Changes

Ramses runs Ramses V3 concentrated liquidity pools on Robinhood Chain (chain ID 4663), created by one RamsesV3Factory contract. Bitquery decodes every swap in those pools and serves them in the Trading cubes with USD values, under the protocol name ramses_v3. The factory also emits an event each time the swap fee of a pool changes, which you read with the Events cube.

API Key Required

To query or stream data outside the Bitquery IDE, you need an API access token: How to generate Bitquery API token ➤

Related docs

Ramses contract on Robinhood Chain​

ContractAddressFilter
RamsesV3Factory0xe0c4ceb92d08ca985bb70fe0a22feb121a9854a8Pair.Market.Address in the Trading cubes, Log.SmartContract for factory events

In the Trading cubes, Pair.Market.Address is the factory, Pair.Market.Program is the liquidity pool contract, and Pair.Market.Protocol is ramses_v3.


Stream Ramses trades​

The subscription pushes each new swap in a Ramses liquidity pool, with both tokens, amounts, the USD value and the trader. Connection steps are in WebSocket subscriptions.

Run this query in the IDE

subscription {
Trading {
Trades(
where: {Pair: {Market: {NetworkBid: {is: "bid:robinhood"}, Address: {is: "0xe0c4ceb92d08ca985bb70fe0a22feb121a9854a8"}}}}
) {
Block { Time }
TransactionHeader { Hash }
Trader { Address }
Side
Pair {
Market { Protocol Program }
Token { Symbol Id }
QuoteToken { Symbol Id }
}
Amounts { Base Quote }
AmountsInUsd { Base }
Price
}
}
}

Price is the base token's price in the quote token, and AmountsInUsd.Base is the trade size in USD.


Latest Ramses trades​

The same fields as a query: the 20 newest swaps in Ramses liquidity pools.

Run this query in the IDE

{
Trading {
Trades(
where: {Pair: {Market: {NetworkBid: {is: "bid:robinhood"}, Address: {is: "0xe0c4ceb92d08ca985bb70fe0a22feb121a9854a8"}}}}
orderBy: {descending: Block_Time}
limit: {count: 20}
) {
Block { Time }
TransactionHeader { Hash }
Trader { Address }
Side
Pair {
Market { Program }
Token { Symbol Id }
QuoteToken { Symbol Id }
}
Amounts { Base Quote }
AmountsInUsd { Base }
Price
}
}
}

Ramses volume, trades, traders and pools​

Totals for the last 24 hours: trades counts swaps, traders counts distinct trader addresses, pools counts the liquidity pools that traded, and volumeUsd sums the USD size of each trade.

Run this query in the IDE

{
Trading {
Trades(
where: {Pair: {Market: {NetworkBid: {is: "bid:robinhood"}, Address: {is: "0xe0c4ceb92d08ca985bb70fe0a22feb121a9854a8"}}}, Block: {Time: {since_relative: {hours_ago: 24}}}}
) {
trades: count
traders: uniq(of: Trader_Address)
pools: uniq(of: Pair_Market_Program)
volumeUsd: sum(of: AmountsInUsd_Base)
}
}
}

Top Ramses liquidity pools by volume​

Trading.Pairs holds one-hour candles per liquidity pool. Summing Volume.Usd over the last 24 hours ranks the busiest Ramses pools. Market.Program is the liquidity pool address.

Run this query in the IDE

{
Trading {
Pairs(
where: {Market: {NetworkBid: {is: "bid:robinhood"}, Address: {is: "0xe0c4ceb92d08ca985bb70fe0a22feb121a9854a8"}}, Interval: {Time: {Duration: {eq: 3600}}}, Block: {Time: {since_relative: {hours_ago: 24}}}}
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 10}
) {
Market { Program Id }
Token { Symbol Id }
QuoteToken { Symbol Id }
volumeUsd: sum(of: Volume_Usd)
}
}
}

Top Ramses traders​

Trader addresses ranked by USD volume in Ramses liquidity pools over the last 24 hours.

Run this query in the IDE

{
Trading {
Trades(
where: {Pair: {Market: {NetworkBid: {is: "bid:robinhood"}, Address: {is: "0xe0c4ceb92d08ca985bb70fe0a22feb121a9854a8"}}}, Block: {Time: {since_relative: {hours_ago: 24}}}}
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 20}
) {
Trader { Address }
trades: count
volumeUsd: sum(of: AmountsInUsd_Base)
}
}
}

Fee changes per pool​

The factory emits FeeAdjustment each time the swap fee of a pool changes. Its arguments are pool, the liquidity pool address, and newFee, the new fee value. This query returns the latest fee changes on every Ramses pool.

Run this query in the IDE

{
EVM(network: robinhood) {
Events(
where: {Log: {SmartContract: {is: "0xe0c4ceb92d08ca985bb70fe0a22feb121a9854a8"}, Signature: {Name: {is: "FeeAdjustment"}}}}
orderBy: {descending: Block_Time}
limit: {count: 20}
) {
Block { Time }
Transaction { Hash }
Arguments {
Name
Value {
... on EVM_ABI_Address_Value_Arg { address }
... on EVM_ABI_BigInt_Value_Arg { bigInteger }
}
}
}
}
}

Put subscription before the opening brace and drop orderBy and limit to stream fee changes as they happen.

Fee changes of one pool​

Filter the pool argument to follow one liquidity pool. This query uses the WETH and USDG pool 0xfae65eaa11943f45e83d5b45dc7a7c801c51bfb0; take another pool address from the top pools query.

Run this query in the IDE

{
EVM(network: robinhood) {
Events(
where: {Log: {SmartContract: {is: "0xe0c4ceb92d08ca985bb70fe0a22feb121a9854a8"}, Signature: {Name: {is: "FeeAdjustment"}}}, Arguments: {includes: {Name: {is: "pool"}, Value: {Address: {is: "0xfae65eaa11943f45e83d5b45dc7a7c801c51bfb0"}}}}}
orderBy: {descending: Block_Time}
limit: {count: 20}
) {
Block { Time }
Transaction { Hash }
Arguments {
Name
Value {
... on EVM_ABI_Address_Value_Arg { address }
... on EVM_ABI_BigInt_Value_Arg { bigInteger }
}
}
}
}
}

No rows means the pool's fee did not change in the realtime window.


FAQ​

What is the Ramses factory address on Robinhood Chain? 0xe0c4ceb92d08ca985bb70fe0a22feb121a9854a8, the RamsesV3Factory contract. Put it in Pair.Market.Address in the Trading cubes for trades, or in Log.SmartContract for factory events.

What protocol name do Ramses trades have? ramses_v3 in Pair.Market.Protocol. Filtering by the factory address gives the same trades.

How do I track Ramses fee changes? Query or stream the FeeAdjustment event on the factory, as in Fee changes per pool. Each event names a liquidity pool and its new fee value.

How far back do Ramses trades go? The Trading cubes keep a rolling window. See Data coverage and retention.

Build with Bitquery

Ready to run this in production?

Get an API key and run these queries in minutes, or talk to us about plans and enterprise delivery.