r4bbit 4e4338945d feat(amm): create TWAP price observations on behalf of the pool
Add a `CreatePriceObservations` instruction that registers a TWAP
price-observations account for a pool over a time window, via a chained
call to the configured TWAP oracle program. The pool acts as the price
source: the AMM authorizes it with its pool PDA seed so the oracle ties
the feed to that pool.

The feed's initial tick is read from the pool's authoritative
`CurrentTickAccount` (validated against its pool-derived PDA) rather than
being supplied by the caller, so the feed cannot be seeded at a forged
price — mirroring what `RecordTick` does. The clock is verified to be the
canonical 1-block LEZ clock, and creation is rejected if the observations
account already exists.

To support the chained call, `AmmConfig` and the `Initialize` instruction
are extended with a `twap_oracle_program_id` that the instruction reads.
2026-06-22 09:47:45 +02:00

22 lines
617 B
TOML

[package]
name = "integration_tests"
version = "0.1.0"
edition = "2021"
[lints]
workspace = true
[dependencies]
nssa = { workspace = true }
nssa_core = { workspace = true, features = ["host"] }
amm_core = { workspace = true }
token_core = { workspace = true }
ata_core = { workspace = true }
stablecoin_core = { workspace = true }
twap_oracle_core = { workspace = true }
token-methods = { path = "../token/methods" }
amm-methods = { path = "../amm/methods" }
ata-methods = { path = "../ata/methods" }
stablecoin-methods = { path = "../stablecoin/methods" }
twap-oracle-methods = { path = "../twap_oracle/methods" }